diff options
Diffstat (limited to 'poky/meta/lib/oeqa/selftest')
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/bblayers.py | 8 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/bbtests.py | 17 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/imagefeatures.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py | 18 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/oescripts.py | 6 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/recipetool.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/runtime_test.py | 2 |
7 files changed, 42 insertions, 15 deletions
diff --git a/poky/meta/lib/oeqa/selftest/cases/bblayers.py b/poky/meta/lib/oeqa/selftest/cases/bblayers.py index 954488dfd..f131d9856 100644 --- a/poky/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/poky/meta/lib/oeqa/selftest/cases/bblayers.py @@ -14,21 +14,21 @@ class BitbakeLayers(OESelftestTestCase): def test_bitbakelayers_showcrossdepends(self): result = runCmd('bitbake-layers show-cross-depends') - self.assertTrue('aspell' in result.output, msg = "No dependencies were shown. bitbake-layers show-cross-depends output: %s" % result.output) + self.assertIn('aspell', result.output) def test_bitbakelayers_showlayers(self): result = runCmd('bitbake-layers show-layers') - self.assertTrue('meta-selftest' in result.output, msg = "No layers were shown. bitbake-layers show-layers output: %s" % result.output) + self.assertIn('meta-selftest', result.output) def test_bitbakelayers_showappends(self): recipe = "xcursor-transparent-theme" bb_file = self.get_recipe_basename(recipe) result = runCmd('bitbake-layers show-appends') - self.assertTrue(bb_file in result.output, msg="%s file was not recognised. bitbake-layers show-appends output: %s" % (bb_file, result.output)) + self.assertIn(bb_file, result.output) def test_bitbakelayers_showoverlayed(self): result = runCmd('bitbake-layers show-overlayed') - self.assertTrue('aspell' in result.output, msg="aspell overlayed recipe was not recognised bitbake-layers show-overlayed %s" % result.output) + self.assertIn('aspell', result.output) def test_bitbakelayers_flatten(self): recipe = "xcursor-transparent-theme" diff --git a/poky/meta/lib/oeqa/selftest/cases/bbtests.py b/poky/meta/lib/oeqa/selftest/cases/bbtests.py index 9461c7ed1..dc423ec43 100644 --- a/poky/meta/lib/oeqa/selftest/cases/bbtests.py +++ b/poky/meta/lib/oeqa/selftest/cases/bbtests.py @@ -44,7 +44,7 @@ class BitbakeTests(OESelftestTestCase): find_build_completed = re.search(r"Tasks Summary:.*(\n.*)*NOTE: Test for bb\.event\.BuildCompleted", result.output) self.assertTrue(find_build_started, msg = "Match failed in:\n%s" % result.output) self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output) - self.assertFalse('Test for bb.event.InvalidEvent' in result.output, msg = "\"Test for bb.event.InvalidEvent\" message found during bitbake process. bitbake output: %s" % result.output) + self.assertNotIn('Test for bb.event.InvalidEvent', result.output) def test_local_sstate(self): bitbake('m4-native') @@ -59,7 +59,7 @@ class BitbakeTests(OESelftestTestCase): def test_bitbake_invalid_target(self): result = bitbake('asdf', ignore_status=True) - self.assertTrue("ERROR: Nothing PROVIDES 'asdf'" in result.output, msg = "Though no 'asdf' target exists, bitbake didn't output any err. message. bitbake output: %s" % result.output) + self.assertIn("ERROR: Nothing PROVIDES 'asdf'", result.output) def test_warnings_errors(self): result = bitbake('-b asdf', ignore_status=True) @@ -123,7 +123,7 @@ class BitbakeTests(OESelftestTestCase): for f in ['pn-buildlist', 'task-depends.dot']: self.addCleanup(os.remove, f) self.assertTrue('Task dependencies saved to \'task-depends.dot\'' in result.output, msg = "No task dependency \"task-depends.dot\" file was generated for the given task target. bitbake output: %s" % result.output) - self.assertTrue(recipe in ftools.read_file(os.path.join(self.builddir, 'task-depends.dot')), msg = "No \"%s\" dependency found in task-depends.dot file." % recipe) + self.assertIn(recipe, ftools.read_file(os.path.join(self.builddir, 'task-depends.dot'))) def test_image_manifest(self): bitbake('core-image-minimal') @@ -147,8 +147,7 @@ INHERIT_remove = \"report-error\" bitbake('-ccleanall man-db') self.delete_recipeinc('man-db') self.assertEqual(result.status, 1, msg="Command succeded when it should have failed. bitbake output: %s" % result.output) - self.assertTrue('Fetcher failure: Unable to find file file://invalid anywhere. The paths that were searched were:' in result.output, msg = "\"invalid\" file \ -doesn't exist, yet no error message encountered. bitbake output: %s" % result.output) + self.assertIn('Fetcher failure: Unable to find file file://invalid anywhere. The paths that were searched were:', result.output) line = self.getline(result, 'Fetcher failure for URL: \'file://invalid\'. Unable to fetch URL from any source.') self.assertTrue(line and line.startswith("ERROR:"), msg = "\"invalid\" file \ doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output) @@ -173,7 +172,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" def test_environment(self): self.write_config("TEST_ENV=\"localconf\"") result = runCmd('bitbake -e | grep TEST_ENV=') - self.assertTrue('localconf' in result.output, msg = "bitbake didn't report any value for TEST_ENV variable. To test, run 'bitbake -e | grep TEST_ENV='") + self.assertIn('localconf', result.output) def test_dry_run(self): result = runCmd('bitbake -n m4-native') @@ -193,10 +192,10 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" self.track_for_cleanup(preconf) ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"") result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') - self.assertTrue('prefile' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration. ") + self.assertIn('prefile', result.output) self.write_config("TEST_PREFILE=\"localconf\"") result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') - self.assertTrue('localconf' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration.") + self.assertIn('localconf', result.output) def test_postfile(self): postconf = os.path.join(self.builddir, 'conf/postfile.conf') @@ -204,7 +203,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"") self.write_config("TEST_POSTFILE=\"localconf\"") result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=') - self.assertTrue('postfile' in result.output, "Postconfigure file \"postfile.conf\"was not taken into consideration.") + self.assertIn('postfile', result.output) def test_checkuri(self): result = runCmd('bitbake -c checkuri m4') diff --git a/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py index cf2a42aab..ef2eefa86 100644 --- a/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py +++ b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py @@ -124,7 +124,7 @@ class ImageFeatures(OESelftestTestCase): # check if result image is sparse image_stat = os.stat(image_path) - self.assertTrue(image_stat.st_size > image_stat.st_blocks * 512) + self.assertGreater(image_stat.st_size, image_stat.st_blocks * 512) # check if the resulting gzip is valid self.assertTrue(runCmd('gzip -t %s' % gzip_path)) diff --git a/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py index 424a9e69c..904b5b409 100644 --- a/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py +++ b/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py @@ -73,3 +73,21 @@ INCOMPATIBLE_LICENSE_pn-core-image-minimal = "GPL-3.0 LGPL-3.0" bitbake('core-image-minimal') +class NoGPL3InImagesTests(OESelftestTestCase): + def test_core_image_minimal(self): + self.write_config(""" +INCOMPATIBLE_LICENSE_pn-core-image-minimal = "GPL-3.0 LGPL-3.0" +""") + bitbake('core-image-minimal') + + def test_core_image_full_cmdline(self): + self.write_config(""" +INHERIT += "testimage"\n +INCOMPATIBLE_LICENSE_pn-core-image-full-cmdline = "GPL-3.0 LGPL-3.0"\n +RDEPENDS_packagegroup-core-full-cmdline-utils_remove = "bash bc coreutils cpio ed findutils gawk grep mc mc-fish mc-helpers mc-helpers-perl sed tar time"\n +RDEPENDS_packagegroup-core-full-cmdline-dev-utils_remove = "diffutils m4 make patch"\n +RDEPENDS_packagegroup-core-full-cmdline-multiuser_remove = "gzip"\n +""") + bitbake('core-image-full-cmdline') + bitbake('-c testimage core-image-full-cmdline') + diff --git a/poky/meta/lib/oeqa/selftest/cases/oescripts.py b/poky/meta/lib/oeqa/selftest/cases/oescripts.py index c169885cf..80d8b2c4c 100644 --- a/poky/meta/lib/oeqa/selftest/cases/oescripts.py +++ b/poky/meta/lib/oeqa/selftest/cases/oescripts.py @@ -121,3 +121,9 @@ class OEGitproxyTests(OESelftestTestCase): if dash is None: self.skipTest("No \"dash\" found on test system.") self.run_oegitproxy(custom_shell=dash) + +class OeRunNativeTest(OESelftestTestCase): + def test_oe_run_native(self): + bitbake("qemu-helper-native -c addto_recipe_sysroot") + result = runCmd("oe-run-native qemu-helper-native tunctl -h") + self.assertIn("Delete: tunctl -d device-name [-f tun-clone-device]", result.output) diff --git a/poky/meta/lib/oeqa/selftest/cases/recipetool.py b/poky/meta/lib/oeqa/selftest/cases/recipetool.py index 1c701a40b..c1562c63b 100644 --- a/poky/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/poky/meta/lib/oeqa/selftest/cases/recipetool.py @@ -685,7 +685,9 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase): self._test_appendsrcfile(testrecipe, filepath, srcdir=subdir) bitbake('%s:do_unpack' % testrecipe) - self.assertEqual(open(self.testfile, 'r').read(), open(os.path.join(srcdir, filepath), 'r').read()) + with open(self.testfile, 'r') as testfile: + with open(os.path.join(srcdir, filepath), 'r') as makefilein: + self.assertEqual(testfile.read(), makefilein.read()) def test_recipetool_appendsrcfiles_basic(self, destdir=None): newfiles = [self.testfile] diff --git a/poky/meta/lib/oeqa/selftest/cases/runtime_test.py b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py index 3f212bd0e..7d3922ce4 100644 --- a/poky/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py @@ -179,6 +179,8 @@ class TestImage(OESelftestTestCase): distro = oe.lsb.distro_identifier() if distro and distro == 'debian-8': self.skipTest('virgl isn\'t working with Debian 8') + if distro and distro == 'centos-7': + self.skipTest('virgl isn\'t working with Centos 7') qemu_packageconfig = get_bb_var('PACKAGECONFIG', 'qemu-system-native') features = 'INHERIT += "testimage"\n' |