diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-12-04 09:01:44 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-12-14 20:17:23 +0300 |
commit | 37a0e4ddff58c0120cc5cfef104b60d0e180638c (patch) | |
tree | 1628857a2eb33ab517ba93d6a3ca25e55bd3e628 /import-layers/yocto-poky/meta/lib/oeqa | |
parent | 3c4c45d1e9a2324191a8640b22df1b71f15f3037 (diff) | |
download | openbmc-37a0e4ddff58c0120cc5cfef104b60d0e180638c.tar.xz |
Squashed 'import-layers/yocto-poky/' changes from dc8508f6099..67491b0c104
Yocto 2.2.2 (Morty)
Change-Id: Id9a452e28940d9f166957de243d9cb1d8818704e
git-subtree-dir: import-layers/yocto-poky
git-subtree-split: 67491b0c104101bb9f366d697edd23c895be4302
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/yocto-poky/meta/lib/oeqa')
11 files changed, 52 insertions, 67 deletions
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/controllers/testtargetloader.py b/import-layers/yocto-poky/meta/lib/oeqa/controllers/testtargetloader.py index a1b7b1d92..b51d04b21 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/controllers/testtargetloader.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/controllers/testtargetloader.py @@ -61,8 +61,6 @@ class TestTargetLoader: obj = getattr(module, target) if obj: from oeqa.targetcontrol import BaseTarget - if (not isinstance(obj, (type, types.ClassType))): - bb.warn("Target {0} found, but not of type Class".format(target)) if( not issubclass(obj, BaseTarget)): bb.warn("Target {0} found, but subclass is not BaseTarget".format(target)) except: diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py index 8efe2d1de..aa5008bba 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py @@ -43,6 +43,7 @@ common_errors = [ "controller can't do DEVSLP, turning off", "stmmac_dvr_probe: warning: cannot get CSR clock", "error: couldn\'t mount because of unsupported optional features", + "GPT: Use GNU Parted to correct GPT errors", ] video_related = [ @@ -58,6 +59,7 @@ x86_common = [ 'failed to setup card detect gpio', 'amd_nb: Cannot enumerate AMD northbridges', 'failed to retrieve link info, disabling eDP', + 'Direct firmware load for iwlwifi', ] + common_errors qemux86_common = [ @@ -69,7 +71,7 @@ qemux86_common = [ 'tsc: HPET/PMTIMER calibration failed', ] + common_errors -ignore_errors = { +ignore_errors = { 'default' : common_errors, 'qemux86' : [ 'Failed to access perfctr msr (MSR', @@ -140,6 +142,7 @@ ignore_errors = { 'Failed to load firmware i915', 'Failed to fetch GuC', 'Failed to initialize GuC', + 'Failed to load DMC firmware', 'The driver is built-in, so to load the firmware you need to', ] + x86_common, 'edgerouter' : [ @@ -200,7 +203,7 @@ class ParseLogsTest(oeRuntimeTest): hwi += "*******************************\n" return hwi - #go through the log locations provided and if it's a folder create a list with all the .log files in it, if it's a file just add + #go through the log locations provided and if it's a folder create a list with all the .log files in it, if it's a file just add #it to that list def getLogList(self, log_locations): logs = [] diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py index baae1e0e5..4ce935fc1 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py @@ -37,7 +37,6 @@ class BitbakeTests(oeSelfTest): @testcase(103) def test_local_sstate(self): - bitbake('m4-native -ccleansstate') bitbake('m4-native') bitbake('m4-native -cclean') result = bitbake('m4-native') @@ -83,8 +82,8 @@ class BitbakeTests(oeSelfTest): pkgsplit_dir = get_bb_var('PKGDEST', test_recipe) man_dir = get_bb_var('mandir', test_recipe) - bitbake('-c cleansstate %s' % test_recipe) - bitbake(test_recipe) + bitbake('-c clean %s' % test_recipe) + bitbake('-c package -f %s' % test_recipe) self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe) man_file = os.path.join(image_dir + man_dir, 'man3/zlib.3') @@ -103,7 +102,6 @@ class BitbakeTests(oeSelfTest): # test 2 from bug 5875 test_recipe = 'zlib' - bitbake('-c cleansstate %s' % test_recipe) bitbake(test_recipe) self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe) @@ -221,7 +219,7 @@ INHERIT_remove = \"report-error\" self.track_for_cleanup(os.path.join(self.builddir, "download-selftest")) self.write_recipeinc('man',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n" ) runCmd('bitbake -c cleanall man xcursor-transparent-theme') - result = runCmd('bitbake man xcursor-transparent-theme -k', ignore_status=True) + result = runCmd('bitbake -c unpack -k man xcursor-transparent-theme', ignore_status=True) errorpos = result.output.find('ERROR: Function failed: do_fail_task') manver = re.search("NOTE: recipe xcursor-transparent-theme-(.*?): task do_unpack: Started", result.output) continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1)) diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py index 9487898b0..47549550c 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py @@ -35,9 +35,8 @@ class ImageOptionsTests(oeSelfTest): bitbake("ccache-native") self.assertTrue(os.path.isfile(os.path.join(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native'), "ccache")), msg = "No ccache found under %s" % str(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native'))) self.write_config('INHERIT += "ccache"') - bitbake("m4 -c cleansstate") - bitbake("m4 -c compile") - self.addCleanup(bitbake, 'ccache-native -ccleansstate') + self.add_command_to_tearDown('bitbake -c clean m4') + bitbake("m4 -f -c compile") res = runCmd("grep ccache %s" % (os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile")), ignore_status=True) self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile")) @@ -71,14 +70,14 @@ class SanityOptionsTest(oeSelfTest): @testcase(927) def test_options_warnqa_errorqa_switch(self): - bitbake("xcursor-transparent-theme -ccleansstate") self.write_config("INHERIT_remove = \"report-error\"") if "packages-list" not in get_bb_var("ERROR_QA"): self.append_config("ERROR_QA_append = \" packages-list\"") self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') - res = bitbake("xcursor-transparent-theme", ignore_status=True) + self.add_command_to_tearDown('bitbake -c clean xcursor-transparent-theme') + res = bitbake("xcursor-transparent-theme -f -c package", ignore_status=True) self.delete_recipeinc('xcursor-transparent-theme') line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.") self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) @@ -86,8 +85,7 @@ class SanityOptionsTest(oeSelfTest): self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') self.append_config('ERROR_QA_remove = "packages-list"') self.append_config('WARN_QA_append = " packages-list"') - bitbake("xcursor-transparent-theme -ccleansstate") - res = bitbake("xcursor-transparent-theme") + res = bitbake("xcursor-transparent-theme -f -c package") self.delete_recipeinc('xcursor-transparent-theme') line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.") self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) @@ -96,8 +94,8 @@ class SanityOptionsTest(oeSelfTest): def test_sanity_unsafe_script_references(self): self.write_config('WARN_QA_append = " unsafe-references-in-scripts"') - bitbake("-ccleansstate gzip") - res = bitbake("gzip") + self.add_command_to_tearDown('bitbake -c clean gzip') + res = bitbake("gzip -f -c package_qa") line = self.getline(res, "QA Issue: gzip") self.assertFalse(line, "WARNING: QA Issue: gzip message is present in bitbake's output and shouldn't be: %s" % res.output) @@ -106,29 +104,10 @@ do_install_append_pn-gzip () { echo "\n${bindir}/test" >> ${D}${bindir}/zcat } """) - res = bitbake("gzip") + res = bitbake("gzip -f -c package_qa") line = self.getline(res, "QA Issue: gzip") self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output) - @testcase(1434) - def test_sanity_unsafe_binary_references(self): - self.write_config('WARN_QA_append = " unsafe-references-in-binaries"') - - bitbake("-ccleansstate nfs-utils") - #res = bitbake("nfs-utils") - # FIXME when nfs-utils passes this test - #line = self.getline(res, "QA Issue: nfs-utils") - #self.assertFalse(line, "WARNING: QA Issue: nfs-utils message is present in bitbake's output and shouldn't be: %s" % res.output) - -# self.append_config(""" -#do_install_append_pn-nfs-utils () { -# echo "\n${bindir}/test" >> ${D}${base_sbindir}/osd_login -#} -#""") - res = bitbake("nfs-utils") - line = self.getline(res, "QA Issue: nfs-utils") - self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output) - @testcase(1421) def test_layer_without_git_dir(self): """ diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py index e992dcf77..302ec5d42 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py @@ -9,7 +9,8 @@ import fnmatch import oeqa.utils.ftools as ftools from oeqa.selftest.base import oeSelfTest -from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer, runqemu, get_test_layer +from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer +from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer from oeqa.utils.decorators import testcase class DevtoolBase(oeSelfTest): @@ -114,6 +115,20 @@ class DevtoolBase(oeSelfTest): class DevtoolTests(DevtoolBase): + @classmethod + def setUpClass(cls): + bb_vars = get_bb_vars(['TOPDIR', 'SSTATE_DIR']) + cls.original_sstate = bb_vars['SSTATE_DIR'] + cls.devtool_sstate = os.path.join(bb_vars['TOPDIR'], 'sstate_devtool') + cls.sstate_conf = 'SSTATE_DIR = "%s"\n' % cls.devtool_sstate + cls.sstate_conf += ('SSTATE_MIRRORS += "file://.* file:///%s/PATH"\n' + % cls.original_sstate) + + @classmethod + def tearDownClass(cls): + cls.log.debug('Deleting devtool sstate cache on %s' % cls.devtool_sstate) + runCmd('rm -rf %s' % cls.devtool_sstate) + def setUp(self): """Test case setup function""" super(DevtoolTests, self).setUp() @@ -121,6 +136,7 @@ class DevtoolTests(DevtoolBase): self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory ' 'under the build directory') + self.append_config(self.sstate_conf) def _check_src_repo(self, repo_dir): """Check srctree git repository""" diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py index 31cd50809..28345dc6a 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py @@ -17,12 +17,8 @@ class TestScripts(oeSelfTest): path = os.path.dirname(get_bb_var('WORKDIR', 'gzip')) old_version_recipe = os.path.join(get_bb_var('COREBASE'), 'meta/recipes-extended/gzip/gzip_1.3.12.bb') old_version = '1.3.12' - bitbake("-ccleansstate gzip") - bitbake("-ccleansstate -b %s" % old_version_recipe) - if os.path.exists(get_bb_var('WORKDIR', "-b %s" % old_version_recipe)): - shutil.rmtree(get_bb_var('WORKDIR', "-b %s" % old_version_recipe)) - if os.path.exists(get_bb_var('WORKDIR', 'gzip')): - shutil.rmtree(get_bb_var('WORKDIR', 'gzip')) + bitbake("-c clean gzip") + bitbake("-c clean -b %s" % old_version_recipe) if os.path.exists(path): initial_contents = os.listdir(path) diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py index 1b9a510fd..0b2dfe649 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py @@ -37,7 +37,6 @@ class BitbakePrTests(oeSelfTest): def increment_package_pr(self, package_name): inc_data = "do_package_append() {\n bb.build.exec_func('do_test_prserv', d)\n}\ndo_test_prserv() {\necho \"The current date is: %s\"\n}" % datetime.datetime.now() self.write_recipeinc(package_name, inc_data) - bitbake("-ccleansstate %s" % package_name) res = bitbake(package_name, ignore_status=True) self.delete_recipeinc(package_name) self.assertEqual(res.status, 0, msg=res.output) @@ -60,7 +59,6 @@ class BitbakePrTests(oeSelfTest): pr_2 = self.get_pr_version(package_name) stamp_2 = self.get_task_stamp(package_name, track_task) - bitbake("-ccleansstate %s" % package_name) self.assertTrue(pr_2 - pr_1 == 1, "Step between same pkg. revision is greater than 1") self.assertTrue(stamp_1 != stamp_2, "Different pkg rev. but same stamp: %s" % stamp_1) @@ -86,7 +84,6 @@ class BitbakePrTests(oeSelfTest): self.increment_package_pr(package_name) pr_2 = self.get_pr_version(package_name) - bitbake("-ccleansstate %s" % package_name) self.assertTrue(pr_2 - pr_1 == 1, "Step between same pkg. revision is greater than 1") @testcase(930) diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py index db1f8deeb..9b669248f 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py @@ -71,11 +71,6 @@ class RecipetoolTests(RecipetoolBase): logger.info('Running bitbake to generate pkgdata') bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile') - @classmethod - def tearDownClass(cls): - # Shouldn't leave any traces of this artificial recipe behind - bitbake('-c cleansstate selftest-recipetool-appendfile') - def _try_recipetool_appendfile(self, testrecipe, destfile, newfile, options, expectedlines, expectedfiles): cmd = 'recipetool appendfile %s %s %s %s' % (self.templayerdir, destfile, newfile, options) return self._try_recipetool_appendcmd(cmd, testrecipe, expectedfiles, expectedlines) @@ -369,15 +364,15 @@ class RecipetoolTests(RecipetoolBase): tempsrc = os.path.join(self.tempdir, 'srctree') os.makedirs(tempsrc) recipefile = os.path.join(self.tempdir, 'logrotate_3.8.7.bb') - srcuri = 'https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.7.tar.gz' + srcuri = 'https://github.com/logrotate/logrotate/archive/r3-8-7.tar.gz' result = runCmd('recipetool create -o %s %s -x %s' % (recipefile, srcuri, tempsrc)) self.assertTrue(os.path.isfile(recipefile)) checkvars = {} checkvars['LICENSE'] = 'GPLv2' checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=18810669f13b87348459e611d31ab760' - checkvars['SRC_URI'] = 'https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.gz' - checkvars['SRC_URI[md5sum]'] = '99e08503ef24c3e2e3ff74cc5f3be213' - checkvars['SRC_URI[sha256sum]'] = 'f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64' + checkvars['SRC_URI'] = 'https://github.com/logrotate/logrotate/archive/r3-8-7.tar.gz' + checkvars['SRC_URI[md5sum]'] = '6b1aa0e0d07eda3c9a2526520850397a' + checkvars['SRC_URI[sha256sum]'] = 'dece4bfeb9d8374a0ecafa34be139b5a697db5c926dcc69a9b8715431a22e733' self._test_recipe_contents(recipefile, checkvars, []) @testcase(1194) @@ -447,8 +442,8 @@ class RecipetoolTests(RecipetoolBase): temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) recipefile = os.path.join(temprecipe, 'meson_git.bb') - srcuri = 'https://github.com/mesonbuild/meson' - result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) + srcuri = 'https://github.com/mesonbuild/meson;rev=0.32.0' + result = runCmd(['recipetool', 'create', '-o', temprecipe, srcuri]) self.assertTrue(os.path.isfile(recipefile)) checkvars = {} checkvars['LICENSE'] = set(['Apache-2.0']) diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py index 4c12d6d94..606bfd3e9 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py @@ -54,8 +54,9 @@ class Signing(oeSelfTest): self.write_config(feature) - bitbake('-c cleansstate %s' % test_recipe) - bitbake(test_recipe) + bitbake('-c clean %s' % test_recipe) + bitbake('-f -c package_write_rpm %s' % test_recipe) + self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe) pkgdatadir = get_bb_var('PKGDATA_DIR', test_recipe) @@ -98,7 +99,6 @@ class Signing(oeSelfTest): sstatedir = os.path.join(builddir, 'test-sstate') self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe) - self.add_command_to_tearDown('bitbake -c cleansstate %s' % test_recipe) self.add_command_to_tearDown('rm -rf %s' % sstatedir) # Determine the pub key signature @@ -112,10 +112,12 @@ class Signing(oeSelfTest): feature += 'SSTATE_VERIFY_SIG ?= "1"\n' feature += 'GPG_PATH = "%s"\n' % self.gpg_dir feature += 'SSTATE_DIR = "%s"\n' % sstatedir + # Any mirror might have partial sstate without .sig files, triggering failures + feature += 'SSTATE_MIRRORS_forcevariable = ""\n' self.write_config(feature) - bitbake('-c cleansstate %s' % test_recipe) + bitbake('-c clean %s' % test_recipe) bitbake(test_recipe) recipe_sig = glob.glob(sstatedir + '/*/*:ed:*_package.tgz.sig') diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py index 6642539eb..f99d74684 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py @@ -16,7 +16,7 @@ class SStateTests(SStateBase): # Test sstate files creation and their location def run_test_sstate_creation(self, targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True, should_pass=True): - self.config_sstate(temp_sstate_location) + self.config_sstate(temp_sstate_location, [self.sstate_path]) if self.temp_sstate_location: bitbake(['-cclean'] + targets) @@ -60,7 +60,7 @@ class SStateTests(SStateBase): # Test the sstate files deletion part of the do_cleansstate task def run_test_cleansstate_task(self, targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True): - self.config_sstate(temp_sstate_location) + self.config_sstate(temp_sstate_location, [self.sstate_path]) bitbake(['-ccleansstate'] + targets) @@ -92,7 +92,7 @@ class SStateTests(SStateBase): # Test rebuilding of distro-specific sstate files def run_test_rebuild_distro_specific_sstate(self, targets, temp_sstate_location=True): - self.config_sstate(temp_sstate_location) + self.config_sstate(temp_sstate_location, [self.sstate_path]) bitbake(['-ccleansstate'] + targets) diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py index faac11e21..e652fad24 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py @@ -42,7 +42,8 @@ class Wic(oeSelfTest): def setUpLocal(self): """This code is executed before each test method.""" self.write_config('IMAGE_FSTYPES += " hddimg"\n' - 'MACHINE_FEATURES_append = " efi"\n') + 'MACHINE_FEATURES_append = " efi"\n' + 'WKS_FILE = "wic-image-minimal"\n') # Do this here instead of in setUpClass as the base setUp does some # clean up which can result in the native tools built earlier in |