diff options
Diffstat (limited to 'poky/meta/lib/oeqa/selftest/cases')
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/bblogging.py | 90 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/bbtests.py | 51 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/buildoptions.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/distrodata.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/eSDK.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/imagefeatures.py | 8 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/newlib.py | 11 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/recipetool.py | 19 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/reproducible.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/sstatetests.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/wic.py | 34 |
11 files changed, 177 insertions, 52 deletions
diff --git a/poky/meta/lib/oeqa/selftest/cases/bblogging.py b/poky/meta/lib/oeqa/selftest/cases/bblogging.py index ea6c3c8c77..317e68b82f 100644 --- a/poky/meta/lib/oeqa/selftest/cases/bblogging.py +++ b/poky/meta/lib/oeqa/selftest/cases/bblogging.py @@ -11,7 +11,7 @@ class BitBakeLogging(OESelftestTestCase): def assertCount(self, item, entry, count): self.assertEqual(item.count(entry), count, msg="Output:\n'''\n%s\n'''\ndoesn't contain %d copies of:\n'''\n%s\n'''\n" % (item, count, entry)) - def test_shell_logging(self): + def test_shell_loggingA(self): # no logs, no verbose self.write_config('BBINCLUDELOGS = ""') result = bitbake("logging-test -c shelltest -f", ignore_status = True) @@ -19,6 +19,7 @@ class BitBakeLogging(OESelftestTestCase): self.assertNotIn("This is shell stdout", result.output) self.assertNotIn("This is shell stderr", result.output) + def test_shell_loggingB(self): # logs, no verbose self.write_config('BBINCLUDELOGS = "yes"') result = bitbake("logging-test -c shelltest -f", ignore_status = True) @@ -26,14 +27,16 @@ class BitBakeLogging(OESelftestTestCase): self.assertCount(result.output, "This is shell stdout", 1) self.assertCount(result.output, "This is shell stderr", 1) + def test_shell_loggingC(self): # no logs, verbose self.write_config('BBINCLUDELOGS = ""') result = bitbake("logging-test -c shelltest -f -v", ignore_status = True) self.assertIn("ERROR: Logfile of failure stored in:", result.output) - # two copies due to set +x + # two copies due to set +x self.assertCount(result.output, "This is shell stdout", 2) self.assertCount(result.output, "This is shell stderr", 2) + def test_shell_loggingD(self): # logs, verbose self.write_config('BBINCLUDELOGS = "yes"') result = bitbake("logging-test -c shelltest -f -v", ignore_status = True) @@ -42,13 +45,52 @@ class BitBakeLogging(OESelftestTestCase): self.assertCount(result.output, "This is shell stdout", 2) self.assertCount(result.output, "This is shell stderr", 2) - def test_python_exit_logging(self): + def test_python_exec_func_shell_loggingA(self): + # no logs, no verbose + self.write_config('BBINCLUDELOGS = ""') + result = bitbake("logging-test -c pythontest_exec_func_shell -f", + ignore_status = True) + self.assertIn("ERROR: Logfile of failure stored in:", result.output) + self.assertNotIn("This is shell stdout", result.output) + self.assertNotIn("This is shell stderr", result.output) + + def test_python_exec_func_shell_loggingB(self): + # logs, no verbose + self.write_config('BBINCLUDELOGS = "yes"') + result = bitbake("logging-test -c pythontest_exec_func_shell -f", + ignore_status = True) + self.assertIn("ERROR: Logfile of failure stored in:", result.output) + self.assertCount(result.output, "This is shell stdout", 1) + self.assertCount(result.output, "This is shell stderr", 1) + + def test_python_exec_func_shell_loggingC(self): + # no logs, verbose + self.write_config('BBINCLUDELOGS = ""') + result = bitbake("logging-test -c pythontest_exec_func_shell -f -v", + ignore_status = True) + self.assertIn("ERROR: Logfile of failure stored in:", result.output) + # two copies due to set +x + self.assertCount(result.output, "This is shell stdout", 2) + self.assertCount(result.output, "This is shell stderr", 2) + + def test_python_exec_func_shell_loggingD(self): + # logs, verbose + self.write_config('BBINCLUDELOGS = "yes"') + result = bitbake("logging-test -c pythontest_exec_func_shell -f -v", + ignore_status = True) + self.assertIn("ERROR: Logfile of failure stored in:", result.output) + # two copies due to set +x + self.assertCount(result.output, "This is shell stdout", 2) + self.assertCount(result.output, "This is shell stderr", 2) + + def test_python_exit_loggingA(self): # no logs, no verbose self.write_config('BBINCLUDELOGS = ""') result = bitbake("logging-test -c pythontest_exit -f", ignore_status = True) self.assertIn("ERROR: Logfile of failure stored in:", result.output) self.assertNotIn("This is python stdout", result.output) + def test_python_exit_loggingB(self): # logs, no verbose self.write_config('BBINCLUDELOGS = "yes"') result = bitbake("logging-test -c pythontest_exit -f", ignore_status = True) @@ -56,6 +98,7 @@ class BitBakeLogging(OESelftestTestCase): # A sys.exit() should include the output self.assertCount(result.output, "This is python stdout", 1) + def test_python_exit_loggingC(self): # no logs, verbose self.write_config('BBINCLUDELOGS = ""') result = bitbake("logging-test -c pythontest_exit -f -v", ignore_status = True) @@ -63,6 +106,7 @@ class BitBakeLogging(OESelftestTestCase): # python tasks don't log output with -v currently #self.assertCount(result.output, "This is python stdout", 1) + def test_python_exit_loggingD(self): # logs, verbose self.write_config('BBINCLUDELOGS = "yes"') result = bitbake("logging-test -c pythontest_exit -f -v", ignore_status = True) @@ -70,7 +114,42 @@ class BitBakeLogging(OESelftestTestCase): # python tasks don't log output with -v currently #self.assertCount(result.output, "This is python stdout", 1) - def test_python_fatal_logging(self): + def test_python_exec_func_python_loggingA(self): + # no logs, no verbose + self.write_config('BBINCLUDELOGS = ""') + result = bitbake("logging-test -c pythontest_exec_func_python -f", + ignore_status = True) + self.assertIn("ERROR: Logfile of failure stored in:", result.output) + self.assertNotIn("This is python stdout", result.output) + + def test_python_exec_func_python_loggingB(self): + # logs, no verbose + self.write_config('BBINCLUDELOGS = "yes"') + result = bitbake("logging-test -c pythontest_exec_func_python -f", + ignore_status = True) + self.assertIn("ERROR: Logfile of failure stored in:", result.output) + # A sys.exit() should include the output + self.assertCount(result.output, "This is python stdout", 1) + + def test_python_exec_func_python_loggingC(self): + # no logs, verbose + self.write_config('BBINCLUDELOGS = ""') + result = bitbake("logging-test -c pythontest_exec_func_python -f -v", + ignore_status = True) + self.assertIn("ERROR: Logfile of failure stored in:", result.output) + # python tasks don't log output with -v currently + #self.assertCount(result.output, "This is python stdout", 1) + + def test_python_exec_func_python_loggingD(self): + # logs, verbose + self.write_config('BBINCLUDELOGS = "yes"') + result = bitbake("logging-test -c pythontest_exec_func_python -f -v", + ignore_status = True) + self.assertIn("ERROR: Logfile of failure stored in:", result.output) + # python tasks don't log output with -v currently + #self.assertCount(result.output, "This is python stdout", 1) + + def test_python_fatal_loggingA(self): # no logs, no verbose self.write_config('BBINCLUDELOGS = ""') result = bitbake("logging-test -c pythontest_fatal -f", ignore_status = True) @@ -78,6 +157,7 @@ class BitBakeLogging(OESelftestTestCase): self.assertNotIn("This is python fatal test stdout", result.output) self.assertCount(result.output, "This is a fatal error", 1) + def test_python_fatal_loggingB(self): # logs, no verbose self.write_config('BBINCLUDELOGS = "yes"') result = bitbake("logging-test -c pythontest_fatal -f", ignore_status = True) @@ -86,6 +166,7 @@ class BitBakeLogging(OESelftestTestCase): self.assertNotIn("This is python fatal test stdout", result.output) self.assertCount(result.output, "This is a fatal error", 1) + def test_python_fatal_loggingC(self): # no logs, verbose self.write_config('BBINCLUDELOGS = ""') result = bitbake("logging-test -c pythontest_fatal -f -v", ignore_status = True) @@ -94,6 +175,7 @@ class BitBakeLogging(OESelftestTestCase): #self.assertCount(result.output, "This is python fatal test stdout", 1) self.assertCount(result.output, "This is a fatal error", 1) + def test_python_fatal_loggingD(self): # logs, verbose self.write_config('BBINCLUDELOGS = "yes"') result = bitbake("logging-test -c pythontest_fatal -f -v", ignore_status = True) diff --git a/poky/meta/lib/oeqa/selftest/cases/bbtests.py b/poky/meta/lib/oeqa/selftest/cases/bbtests.py index 246cb032bf..35ad9f3cd6 100644 --- a/poky/meta/lib/oeqa/selftest/cases/bbtests.py +++ b/poky/meta/lib/oeqa/selftest/cases/bbtests.py @@ -63,8 +63,8 @@ class BitbakeTests(OESelftestTestCase): def test_warnings_errors(self): result = bitbake('-b asdf', ignore_status=True) - find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages* shown", result.output) - find_errors = re.search("Summary: There w.{2,3}? [1-9][0-9]* ERROR messages* shown", result.output) + find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages*", result.output) + find_errors = re.search("Summary: There w.{2,3}? [1-9][0-9]* ERROR messages*", result.output) self.assertTrue(find_warnings, msg="Did not find the mumber of warnings at the end of the build:\n" + result.output) self.assertTrue(find_errors, msg="Did not find the mumber of errors at the end of the build:\n" + result.output) @@ -228,8 +228,8 @@ INHERIT:remove = \"report-error\" result = bitbake('selftest-ed', ignore_status=True) self.assertEqual(result.status, 0, "Bitbake failed, exit code %s, output %s" % (result.status, result.output)) lic_dir = get_bb_var('LICENSE_DIRECTORY') - self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv3'))) - self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv2'))) + self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPL-3.0-or-later'))) + self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPL-2.0-or-later'))) def test_setscene_only(self): """ Bitbake option to restore from sstate only within a build (i.e. execute no real tasks, only setscene)""" @@ -307,8 +307,47 @@ INHERIT:remove = \"report-error\" src = get_bb_var("SRC_URI",test_recipe) gitscm = re.search("git://", src) self.assertFalse(gitscm, "test_git_patchtool pre-condition failed: {} test recipe contains git repo!".format(test_recipe)) - result = bitbake('man-db -c patch', ignore_status=False) + result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False) fatal = re.search("fatal: not a git repository (or any of the parent directories)", result.output) self.assertFalse(fatal, "Failed to patch using PATCHTOOL=\"git\"") self.delete_recipeinc(test_recipe) - bitbake('-cclean man-db') + bitbake('-cclean {}'.format(test_recipe)) + + def test_git_patchtool2(self): + """ Test if PATCHTOOL=git works with git repo and doesn't reinitialize it + """ + test_recipe = "gitrepotest" + src = get_bb_var("SRC_URI",test_recipe) + gitscm = re.search("git://", src) + self.assertTrue(gitscm, "test_git_patchtool pre-condition failed: {} test recipe doesn't contains git repo!".format(test_recipe)) + result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False) + srcdir = get_bb_var('S', test_recipe) + result = runCmd("git log", cwd = srcdir) + self.assertFalse("bitbake_patching_started" in result.output, msg = "Repository has been reinitialized. {}".format(srcdir)) + self.delete_recipeinc(test_recipe) + bitbake('-cclean {}'.format(test_recipe)) + + + def test_git_unpack_nonetwork(self): + """ + Test that a recipe with a floating tag that needs to be resolved upstream doesn't + access the network in a patch task run in a separate builld invocation + """ + + # Enable the recipe to float using a distro override + self.write_config("DISTROOVERRIDES .= \":gitunpack-enable-recipe\"") + + bitbake('gitunpackoffline -c fetch') + bitbake('gitunpackoffline -c patch') + + def test_git_unpack_nonetwork_fail(self): + """ + Test that a recipe with a floating tag which doesn't call get_srcrev() in the fetcher + raises an error when the fetcher is called. + """ + + # Enable the recipe to float using a distro override + self.write_config("DISTROOVERRIDES .= \":gitunpack-enable-recipe\"") + + result = bitbake('gitunpackoffline-fail -c fetch', ignore_status=True) + self.assertTrue("Recipe uses a floating tag/branch without a fixed SRCREV" in result.output, msg = "Recipe without PV set to SRCPV should have failed: %s" % result.output) diff --git a/poky/meta/lib/oeqa/selftest/cases/buildoptions.py b/poky/meta/lib/oeqa/selftest/cases/buildoptions.py index 651bb03c7e..bfe613b847 100644 --- a/poky/meta/lib/oeqa/selftest/cases/buildoptions.py +++ b/poky/meta/lib/oeqa/selftest/cases/buildoptions.py @@ -62,9 +62,9 @@ class DiskMonTest(OESelftestTestCase): res = bitbake("delay -c delay", ignore_status = True) self.assertTrue('ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!' in res.output, msg = "Tasks should have stopped. Disk monitor is set to STOPTASK: %s" % res.output) self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) - self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"') + self.write_config('BB_DISKMON_DIRS = "HALT,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"') res = bitbake("delay -c delay", ignore_status = True) - self.assertTrue('ERROR: Immediately abort since the disk space monitor action is "ABORT"!' in res.output, "Tasks should have been aborted immediatelly. Disk monitor is set to ABORT: %s" % res.output) + self.assertTrue('ERROR: Immediately halt since the disk space monitor action is "HALT"!' in res.output, "Tasks should have been halted immediately. Disk monitor is set to HALT: %s" % res.output) self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"') res = bitbake("delay -c delay") diff --git a/poky/meta/lib/oeqa/selftest/cases/distrodata.py b/poky/meta/lib/oeqa/selftest/cases/distrodata.py index 908979804a..03f31e9fcb 100644 --- a/poky/meta/lib/oeqa/selftest/cases/distrodata.py +++ b/poky/meta/lib/oeqa/selftest/cases/distrodata.py @@ -18,7 +18,7 @@ class Distrodata(OESelftestTestCase): Product: oe-core Author: Alexander Kanavin <alex.kanavin@gmail.com> """ - feature = 'LICENSE_FLAGS_WHITELIST += " commercial"\n' + feature = 'LICENSE_FLAGS_ACCEPTED += " commercial"\n' self.write_config(feature) pkgs = oe.recipeutils.get_recipe_upgrade_status() @@ -99,7 +99,7 @@ The following recipes do not have a DESCRIPTION. Please add an entry for DESCRIP return True return False - feature = 'require conf/distro/include/maintainers.inc\nLICENSE_FLAGS_WHITELIST += " commercial"\nPARSE_ALL_RECIPES = "1"\nPACKAGE_CLASSES = "package_ipk package_deb package_rpm"\n' + feature = 'require conf/distro/include/maintainers.inc\nLICENSE_FLAGS_ACCEPTED += " commercial"\nPARSE_ALL_RECIPES = "1"\nPACKAGE_CLASSES = "package_ipk package_deb package_rpm"\n' self.write_config(feature) with bb.tinfoil.Tinfoil() as tinfoil: diff --git a/poky/meta/lib/oeqa/selftest/cases/eSDK.py b/poky/meta/lib/oeqa/selftest/cases/eSDK.py index d0c402ba8a..f7279b3230 100644 --- a/poky/meta/lib/oeqa/selftest/cases/eSDK.py +++ b/poky/meta/lib/oeqa/selftest/cases/eSDK.py @@ -63,7 +63,7 @@ class oeSDKExtSelfTest(OESelftestTestCase): cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA) sstate_config=""" -SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" +ESDK_LOCALCONF_ALLOW = "SSTATE_MIRRORS" SSTATE_MIRRORS = "file://.* file://%s/PATH" CORE_IMAGE_EXTRA_INSTALL = "perl" """ % sstate_dir @@ -91,7 +91,7 @@ CORE_IMAGE_EXTRA_INSTALL = "perl" # Configure eSDK to use sstate mirror from poky sstate_config=""" -SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" +ESDK_LOCALCONF_ALLOW = "SSTATE_MIRRORS" SSTATE_MIRRORS = "file://.* file://%s/PATH" """ % bb_vars["SSTATE_DIR"] with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f: diff --git a/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py index 18f37c6d7d..d36d45c551 100644 --- a/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py +++ b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py @@ -198,8 +198,8 @@ class ImageFeatures(OESelftestTestCase): image_name = 'core-image-minimal' all_image_types = set(get_bb_var("IMAGE_TYPES", image_name).split()) - blacklist = set(('container', 'elf', 'f2fs', 'multiubi', 'tar.zst', 'wic.zst')) - img_types = all_image_types - blacklist + skip_image_types = set(('container', 'elf', 'f2fs', 'multiubi', 'tar.zst', 'wic.zst')) + img_types = all_image_types - skip_image_types config = 'IMAGE_FSTYPES += "%s"\n'\ 'MKUBIFS_ARGS ?= "-m 2048 -e 129024 -c 2047"\n'\ @@ -245,8 +245,8 @@ VIRTUAL-RUNTIME_base-utils = "packagegroup-core-base-utils" VIRTUAL-RUNTIME_base-utils-hwclock = "util-linux-hwclock" VIRTUAL-RUNTIME_base-utils-syslog = "" -# Blacklist busybox -PNBLACKLIST[busybox] = "Don't build this" +# Skip busybox +SKIP_RECIPE[busybox] = "Don't build this" """ self.write_config(config) diff --git a/poky/meta/lib/oeqa/selftest/cases/newlib.py b/poky/meta/lib/oeqa/selftest/cases/newlib.py new file mode 100644 index 0000000000..999e3e78b0 --- /dev/null +++ b/poky/meta/lib/oeqa/selftest/cases/newlib.py @@ -0,0 +1,11 @@ +# +# SPDX-License-Identifier: MIT +# + +from oeqa.selftest.case import OESelftestTestCase +from oeqa.utils.commands import bitbake + +class NewlibTest(OESelftestTestCase): + def test_newlib(self): + self.write_config('TCLIBC = "newlib"') + bitbake("newlib libgloss") diff --git a/poky/meta/lib/oeqa/selftest/cases/recipetool.py b/poky/meta/lib/oeqa/selftest/cases/recipetool.py index 9db1ddb532..09448bad01 100644 --- a/poky/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/poky/meta/lib/oeqa/selftest/cases/recipetool.py @@ -472,25 +472,6 @@ class RecipetoolCreateTests(RecipetoolBase): inherits = ['setuptools3'] self._test_recipe_contents(recipefile, checkvars, inherits) - def test_recipetool_create_python3_distutils(self): - # Test creating python3 package from tarball (using distutils3 class) - temprecipe = os.path.join(self.tempdir, 'recipe') - os.makedirs(temprecipe) - pn = 'docutils' - pv = '0.14' - recipefile = os.path.join(temprecipe, '%s_%s.bb' % (pn, pv)) - srcuri = 'https://files.pythonhosted.org/packages/84/f4/5771e41fdf52aabebbadecc9381d11dea0fa34e4759b4071244fa094804c/docutils-%s.tar.gz' % pv - result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) - self.assertTrue(os.path.isfile(recipefile)) - checkvars = {} - checkvars['LICENSE'] = 'BSD-3-Clause & GPL & PSF' - checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING.txt;md5=35a23d42b615470583563132872c97d6' - checkvars['SRC_URI'] = 'https://files.pythonhosted.org/packages/84/f4/5771e41fdf52aabebbadecc9381d11dea0fa34e4759b4071244fa094804c/docutils-${PV}.tar.gz' - checkvars['SRC_URI[md5sum]'] = 'c53768d63db3873b7d452833553469de' - checkvars['SRC_URI[sha256sum]'] = '51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274' - inherits = ['distutils3'] - self._test_recipe_contents(recipefile, checkvars, inherits) - def test_recipetool_create_github_tarball(self): # Basic test to ensure github URL mangling doesn't apply to release tarballs temprecipe = os.path.join(self.tempdir, 'recipe') diff --git a/poky/meta/lib/oeqa/selftest/cases/reproducible.py b/poky/meta/lib/oeqa/selftest/cases/reproducible.py index e539365031..7caf8c3e7d 100644 --- a/poky/meta/lib/oeqa/selftest/cases/reproducible.py +++ b/poky/meta/lib/oeqa/selftest/cases/reproducible.py @@ -206,7 +206,7 @@ class ReproducibleTests(OESelftestTestCase): PACKAGE_CLASSES = "{package_classes}" INHIBIT_PACKAGE_STRIP = "1" TMPDIR = "{tmpdir}" - LICENSE_FLAGS_WHITELIST = "commercial" + LICENSE_FLAGS_ACCEPTED = "commercial" DISTRO_FEATURES:append = ' systemd pam' USERADDEXTENSION = "useradd-staticids" USERADD_ERROR_DYNAMIC = "skip" diff --git a/poky/meta/lib/oeqa/selftest/cases/sstatetests.py b/poky/meta/lib/oeqa/selftest/cases/sstatetests.py index 96b2d115ed..3038b40021 100644 --- a/poky/meta/lib/oeqa/selftest/cases/sstatetests.py +++ b/poky/meta/lib/oeqa/selftest/cases/sstatetests.py @@ -177,7 +177,7 @@ class SStateTests(SStateBase): # QA checks for this test. It may report errors otherwise. self.append_config('ERROR_QA:remove = "version-going-backwards"') - # For not this only checks if random sstate tasks are handled correctly as a group. + # For now this only checks if random sstate tasks are handled correctly as a group. # In the future we should add control over what tasks we check for. sstate_archs_list = [] diff --git a/poky/meta/lib/oeqa/selftest/cases/wic.py b/poky/meta/lib/oeqa/selftest/cases/wic.py index 5fc8e65142..6f3dc27743 100644 --- a/poky/meta/lib/oeqa/selftest/cases/wic.py +++ b/poky/meta/lib/oeqa/selftest/cases/wic.py @@ -851,7 +851,7 @@ class Wic2(WicTestCase): self.assertEqual(0, bitbake('wic-image-minimal').status) self.remove_config(config) - with runqemu('wic-image-minimal', ssh=False) as qemu: + with runqemu('wic-image-minimal', ssh=False, runqemuparams='nographic') as qemu: cmd = "mount | grep '^/dev/' | cut -f1,3 -d ' ' | egrep -c -e '/dev/sda1 /boot' " \ "-e '/dev/root /|/dev/sda2 /' -e '/dev/sda3 /media' -e '/dev/sda4 /mnt'" status, output = qemu.run_serial(cmd) @@ -871,7 +871,7 @@ class Wic2(WicTestCase): self.remove_config(config) with runqemu('core-image-minimal', ssh=False, - runqemuparams='ovmf', image_fstype='wic') as qemu: + runqemuparams='nographic ovmf', image_fstype='wic') as qemu: cmd = "grep sda. /proc/partitions |wc -l" status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) @@ -1059,21 +1059,21 @@ class Wic2(WicTestCase): self.assertEqual(0, bitbake('core-image-minimal-mtdutils').status) self.remove_config(config) - with runqemu('core-image-minimal-mtdutils', ssh=False, image_fstype='wic') as qemu: + with runqemu('core-image-minimal-mtdutils', ssh=False, + runqemuparams='nographic', image_fstype='wic') as qemu: cmd = "grep sda. /proc/partitions |wc -l" status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) self.assertEqual(output, '2') - def test_rawcopy_plugin(self): + def _rawcopy_plugin(self, fstype): """Test rawcopy plugin""" img = 'core-image-minimal' machine = get_bb_var('MACHINE', img) + params = ',unpack' if fstype.endswith('.gz') else '' with NamedTemporaryFile("w", suffix=".wks") as wks: - wks.writelines(['part /boot --active --source bootimg-pcbios\n', - 'part / --source rawcopy --sourceparams="file=%s-%s.ext4" --use-uuid\n'\ - % (img, machine), - 'bootloader --timeout=0 --append="console=ttyS0,115200n8"\n']) + wks.write('part / --source rawcopy --sourceparams="file=%s-%s.%s%s"\n'\ + % (img, machine, fstype, params)) wks.flush() cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) runCmd(cmd) @@ -1081,6 +1081,17 @@ class Wic2(WicTestCase): out = glob(self.resultdir + "%s-*direct" % wksname) self.assertEqual(1, len(out)) + def test_rawcopy_plugin(self): + self._rawcopy_plugin('ext4') + + def test_rawcopy_plugin_unpack(self): + fstype = 'ext4.gz' + config = 'IMAGE_FSTYPES = "%s"\n' % fstype + self.append_config(config) + self.assertEqual(0, bitbake('core-image-minimal').status) + self.remove_config(config) + self._rawcopy_plugin(fstype) + def test_empty_plugin(self): """Test empty plugin""" config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n' @@ -1109,7 +1120,8 @@ class Wic2(WicTestCase): self.assertEqual(0, bitbake('core-image-minimal').status) self.remove_config(config) - with runqemu('core-image-minimal', ssh=False, image_fstype='wic') as qemu: + with runqemu('core-image-minimal', ssh=False, + runqemuparams='nographic', image_fstype='wic') as qemu: # Check that we have ONLY two /dev/sda* partitions (/boot and /) cmd = "grep sda. /proc/partitions | wc -l" status, output = qemu.run_serial(cmd) @@ -1170,7 +1182,7 @@ class Wic2(WicTestCase): self.remove_config(config) with runqemu('core-image-minimal', ssh=False, - runqemuparams='ovmf', image_fstype='wic') as qemu: + runqemuparams='nographic ovmf', image_fstype='wic') as qemu: # Check that /boot has EFI bootx64.efi (required for EFI) cmd = "ls /boot/EFI/BOOT/bootx64.efi | wc -l" status, output = qemu.run_serial(cmd) @@ -1408,7 +1420,7 @@ class Wic2(WicTestCase): bb.utils.rename(new_image_path, image_path) # Check if it boots in qemu - with runqemu('core-image-minimal', ssh=False) as qemu: + with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic') as qemu: cmd = "ls /etc/" status, output = qemu.run_serial('true') self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) |