diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-20 11:53:11 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:10:02 +0100 |
commit | caebd862bac7eed725e0f0321bf50793671b5312 (patch) | |
tree | 2da96b5da7b9b0e0ef04c03cf74f14ddfd180f30 /meta/lib/oeqa | |
parent | 2476bdcbef591e951d11d57d53f1315848758571 (diff) | |
download | openembedded-core-caebd862bac7eed725e0f0321bf50793671b5312.tar.gz openembedded-core-caebd862bac7eed725e0f0321bf50793671b5312.tar.bz2 openembedded-core-caebd862bac7eed725e0f0321bf50793671b5312.zip |
classes/lib: Update to explictly create lists where needed
Iterators now return views, not lists in python3. Where we need
lists, handle this explicitly.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/pkgdata.py | 56 | ||||
-rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 2 |
2 files changed, 29 insertions, 29 deletions
diff --git a/meta/lib/oeqa/selftest/pkgdata.py b/meta/lib/oeqa/selftest/pkgdata.py index 138b03aadb..5a63f89ff2 100644 --- a/meta/lib/oeqa/selftest/pkgdata.py +++ b/meta/lib/oeqa/selftest/pkgdata.py @@ -131,15 +131,15 @@ class OePkgdataUtilTests(oeSelfTest): # Test recipe-space package name result = runCmd('oe-pkgdata-util list-pkg-files zlib-dev zlib-doc') files = splitoutput(result.output) - self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-dev', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-doc', list(files.keys()), "listed pkgs. files: %s" %result.output) self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev']) self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc']) # Test runtime package name result = runCmd('oe-pkgdata-util list-pkg-files -r libz1 libz-dev') files = splitoutput(result.output) - self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output) + self.assertIn('libz1', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz-dev', list(files.keys()), "listed pkgs. files: %s" %result.output) self.assertGreater(len(files['libz1']), 1) libspec = os.path.join(base_libdir, 'libz.so.1.*') found = False @@ -152,12 +152,12 @@ class OePkgdataUtilTests(oeSelfTest): # Test recipe result = runCmd('oe-pkgdata-util list-pkg-files -p zlib') files = splitoutput(result.output) - self.assertIn('zlib-dbg', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib-staticdev', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertNotIn('zlib-locale', files.keys(), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-doc', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-dev', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertNotIn('zlib-locale', list(files.keys()), "listed pkgs. files: %s" %result.output) # (ignore ptest, might not be there depending on config) self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev']) self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc']) @@ -165,36 +165,36 @@ class OePkgdataUtilTests(oeSelfTest): # Test recipe, runtime result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r') files = splitoutput(result.output) - self.assertIn('libz-dbg', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz-doc', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz-staticdev', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertNotIn('libz-locale', files.keys(), "listed pkgs. files: %s" %result.output) + self.assertIn('libz-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz-doc', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz-dev', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz1', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertNotIn('libz-locale', list(files.keys()), "listed pkgs. files: %s" %result.output) self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev']) self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc']) self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev']) # Test recipe, unpackaged result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -u') files = splitoutput(result.output) - self.assertIn('zlib-dbg', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib-staticdev', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('zlib-locale', files.keys(), "listed pkgs. files: %s" %result.output) # this is the key one + self.assertIn('zlib-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-doc', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-dev', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('zlib-locale', list(files.keys()), "listed pkgs. files: %s" %result.output) # this is the key one self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev']) self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc']) self.assertIn(os.path.join(libdir, 'libz.a'), files['zlib-staticdev']) # Test recipe, runtime, unpackaged result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r -u') files = splitoutput(result.output) - self.assertIn('libz-dbg', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz-doc', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz-staticdev', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output) - self.assertIn('libz-locale', files.keys(), "listed pkgs. files: %s" %result.output) # this is the key one + self.assertIn('libz-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz-doc', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz-dev', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz1', list(files.keys()), "listed pkgs. files: %s" %result.output) + self.assertIn('libz-locale', list(files.keys()), "listed pkgs. files: %s" %result.output) # this is the key one self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev']) self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc']) self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev']) diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index f51de99458..c1d07d9b41 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -22,7 +22,7 @@ import logging logger = logging.getLogger("BitBake.QemuRunner") # Get Unicode non printable control chars -control_range = range(0,32)+range(127,160) +control_range = list(range(0,32))+list(range(127,160)) control_chars = [unichr(x) for x in control_range if unichr(x) not in string.printable] re_control_char = re.compile('[%s]' % re.escape("".join(control_chars))) |