summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/cases/debuginfod.py14
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py111
-rw-r--r--meta/lib/oeqa/selftest/cases/layerappend.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/minidebuginfo.py16
-rw-r--r--meta/lib/oeqa/selftest/cases/oescripts.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/recipetool.py34
-rw-r--r--meta/lib/oeqa/selftest/cases/recipeutils.py4
-rw-r--r--meta/lib/oeqa/selftest/cases/reproducible.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/runtime_test.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/rust.py5
-rw-r--r--meta/lib/oeqa/selftest/cases/spdx.py3
-rw-r--r--meta/lib/oeqa/selftest/cases/sstatetests.py31
12 files changed, 157 insertions, 69 deletions
diff --git a/meta/lib/oeqa/selftest/cases/debuginfod.py b/meta/lib/oeqa/selftest/cases/debuginfod.py
index 505b4be837..46c0cd87bb 100644
--- a/meta/lib/oeqa/selftest/cases/debuginfod.py
+++ b/meta/lib/oeqa/selftest/cases/debuginfod.py
@@ -62,7 +62,7 @@ class Debuginfod(OESelftestTestCase):
62 62
63 raise TimeoutError("Cannot connect debuginfod, still %d scan jobs running" % latest) 63 raise TimeoutError("Cannot connect debuginfod, still %d scan jobs running" % latest)
64 64
65 def start_debuginfod(self): 65 def start_debuginfod(self, feed_dir):
66 # We assume that the caller has already bitbake'd elfutils-native:do_addto_recipe_sysroot 66 # We assume that the caller has already bitbake'd elfutils-native:do_addto_recipe_sysroot
67 67
68 # Save some useful paths for later 68 # Save some useful paths for later
@@ -82,7 +82,7 @@ class Debuginfod(OESelftestTestCase):
82 # Disable rescanning, this is a one-shot test 82 # Disable rescanning, this is a one-shot test
83 "--rescan-time=0", 83 "--rescan-time=0",
84 "--groom-time=0", 84 "--groom-time=0",
85 get_bb_var("DEPLOY_DIR"), 85 feed_dir,
86 ] 86 ]
87 87
88 format = get_bb_var("PACKAGE_CLASSES").split()[0] 88 format = get_bb_var("PACKAGE_CLASSES").split()[0]
@@ -114,11 +114,12 @@ class Debuginfod(OESelftestTestCase):
114 self.write_config(""" 114 self.write_config("""
115TMPDIR = "${TOPDIR}/tmp-debuginfod" 115TMPDIR = "${TOPDIR}/tmp-debuginfod"
116DISTRO_FEATURES:append = " debuginfod" 116DISTRO_FEATURES:append = " debuginfod"
117INHERIT += "localpkgfeed"
117""") 118""")
118 bitbake("elfutils-native:do_addto_recipe_sysroot xz xz:do_package") 119 bitbake("elfutils-native:do_addto_recipe_sysroot xz xz:do_package xz:do_localpkgfeed")
119 120
120 try: 121 try:
121 self.start_debuginfod() 122 self.start_debuginfod(get_bb_var("LOCALPKGFEED_DIR", "xz"))
122 123
123 env = os.environ.copy() 124 env = os.environ.copy()
124 env["DEBUGINFOD_URLS"] = "http://localhost:%d/" % self.port 125 env["DEBUGINFOD_URLS"] = "http://localhost:%d/" % self.port
@@ -141,12 +142,13 @@ DISTRO_FEATURES:append = " debuginfod"
141 self.write_config(""" 142 self.write_config("""
142TMPDIR = "${TOPDIR}/tmp-debuginfod" 143TMPDIR = "${TOPDIR}/tmp-debuginfod"
143DISTRO_FEATURES:append = " debuginfod" 144DISTRO_FEATURES:append = " debuginfod"
145INHERIT += "localpkgfeed"
144CORE_IMAGE_EXTRA_INSTALL += "elfutils xz" 146CORE_IMAGE_EXTRA_INSTALL += "elfutils xz"
145 """) 147 """)
146 bitbake("core-image-minimal elfutils-native:do_addto_recipe_sysroot") 148 bitbake("core-image-minimal elfutils-native:do_addto_recipe_sysroot xz:do_localpkgfeed")
147 149
148 try: 150 try:
149 self.start_debuginfod() 151 self.start_debuginfod(get_bb_var("LOCALPKGFEED_DIR", "xz"))
150 152
151 with runqemu("core-image-minimal", runqemuparams="nographic") as qemu: 153 with runqemu("core-image-minimal", runqemuparams="nographic") as qemu:
152 cmd = "DEBUGINFOD_URLS=http://%s:%d/ debuginfod-find debuginfo /usr/bin/xz" % (qemu.server_ip, self.port) 154 cmd = "DEBUGINFOD_URLS=http://%s:%d/ debuginfod-find debuginfo /usr/bin/xz" % (qemu.server_ip, self.port)
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index c8f9534e41..432d9c9a67 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -753,6 +753,25 @@ class DevtoolModifyTests(DevtoolBase):
753 result = runCmd('devtool status') 753 result = runCmd('devtool status')
754 self.assertNotIn('mdadm', result.output) 754 self.assertNotIn('mdadm', result.output)
755 755
756 def test_devtool_modify_go(self):
757 import oe.path
758 from tempfile import TemporaryDirectory
759 with TemporaryDirectory(prefix='devtoolqa') as tempdir:
760 self.track_for_cleanup(self.workspacedir)
761 self.add_command_to_tearDown('bitbake -c clean go-helloworld')
762 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
763 result = runCmd('devtool modify go-helloworld -x %s' % tempdir)
764 self.assertExists(
765 oe.path.join(tempdir, 'src', 'golang.org', 'x', 'example', 'go.mod'),
766 'Extracted source could not be found'
767 )
768 self.assertExists(
769 oe.path.join(self.workspacedir, 'conf', 'layer.conf'),
770 'Workspace directory not created'
771 )
772 matches = glob.glob(oe.path.join(self.workspacedir, 'appends', 'go-helloworld_*.bbappend'))
773 self.assertTrue(matches, 'bbappend not created %s' % result.output)
774
756 def test_devtool_buildclean(self): 775 def test_devtool_buildclean(self):
757 def assertFile(path, *paths): 776 def assertFile(path, *paths):
758 f = os.path.join(path, *paths) 777 f = os.path.join(path, *paths)
@@ -879,13 +898,8 @@ class DevtoolModifyTests(DevtoolBase):
879 self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe) 898 self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
880 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') 899 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
881 result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) 900 result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
882 srcfile = os.path.join(tempdir, 'oe-local-files/share/dot.bashrc') 901 srcfile = os.path.join(tempdir, 'share/dot.bashrc')
883 srclink = os.path.join(tempdir, 'share/dot.bashrc')
884 self.assertExists(srcfile, 'Extracted source could not be found') 902 self.assertExists(srcfile, 'Extracted source could not be found')
885 if os.path.islink(srclink) and os.path.exists(srclink) and os.path.samefile(srcfile, srclink):
886 correct_symlink = True
887 self.assertTrue(correct_symlink, 'Source symlink to oe-local-files is broken')
888
889 matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe)) 903 matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe))
890 self.assertTrue(matches, 'bbappend not created') 904 self.assertTrue(matches, 'bbappend not created')
891 # Test devtool status 905 # Test devtool status
@@ -956,9 +970,9 @@ class DevtoolModifyTests(DevtoolBase):
956 # others git:// in SRC_URI 970 # others git:// in SRC_URI
957 # cointains a patch 971 # cointains a patch
958 testrecipe = 'hello-rs' 972 testrecipe = 'hello-rs'
959 bb_vars = get_bb_vars(['SRC_URI', 'FILE', 'WORKDIR', 'CARGO_HOME'], testrecipe) 973 bb_vars = get_bb_vars(['SRC_URI', 'FILE', 'UNPACKDIR', 'CARGO_HOME'], testrecipe)
960 recipefile = bb_vars['FILE'] 974 recipefile = bb_vars['FILE']
961 workdir = bb_vars['WORKDIR'] 975 unpackdir = bb_vars['UNPACKDIR']
962 cargo_home = bb_vars['CARGO_HOME'] 976 cargo_home = bb_vars['CARGO_HOME']
963 src_uri = bb_vars['SRC_URI'].split() 977 src_uri = bb_vars['SRC_URI'].split()
964 self.assertTrue(src_uri[0].startswith('git://'), 978 self.assertTrue(src_uri[0].startswith('git://'),
@@ -1029,7 +1043,7 @@ class DevtoolModifyTests(DevtoolBase):
1029 self.assertEqual(parms['type'], 'git-dependency', 'git dependencies uri should have "type=git-dependency"') 1043 self.assertEqual(parms['type'], 'git-dependency', 'git dependencies uri should have "type=git-dependency"')
1030 raw_url = raw_url.replace("git://", '%s://' % parms['protocol']) 1044 raw_url = raw_url.replace("git://", '%s://' % parms['protocol'])
1031 patch_line = '[patch."%s"]' % raw_url 1045 patch_line = '[patch."%s"]' % raw_url
1032 path_patched = os.path.join(workdir, parms['destsuffix']) 1046 path_patched = os.path.join(unpackdir, parms['destsuffix'])
1033 path_override_line = '%s = { path = "%s" }' % (parms['name'], path_patched) 1047 path_override_line = '%s = { path = "%s" }' % (parms['name'], path_patched)
1034 # Would have been better to use tomllib to read this file :/ 1048 # Would have been better to use tomllib to read this file :/
1035 self.assertIn(patch_line, cargo_config_contents) 1049 self.assertIn(patch_line, cargo_config_contents)
@@ -1278,7 +1292,7 @@ class DevtoolUpdateTests(DevtoolBase):
1278 with open(bbappendfile, 'r') as f: 1292 with open(bbappendfile, 'r') as f:
1279 self.assertEqual(expectedlines, f.readlines()) 1293 self.assertEqual(expectedlines, f.readlines())
1280 # Drop new commit and check patch gets deleted 1294 # Drop new commit and check patch gets deleted
1281 result = runCmd('git reset HEAD^', cwd=tempsrcdir) 1295 result = runCmd('git reset HEAD^ --hard', cwd=tempsrcdir)
1282 result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir)) 1296 result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
1283 self.assertNotExists(patchfile, 'Patch file not deleted') 1297 self.assertNotExists(patchfile, 'Patch file not deleted')
1284 expectedlines2 = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n', 1298 expectedlines2 = ['FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n',
@@ -1287,6 +1301,7 @@ class DevtoolUpdateTests(DevtoolBase):
1287 self.assertEqual(expectedlines2, f.readlines()) 1301 self.assertEqual(expectedlines2, f.readlines())
1288 # Put commit back and check we can run it if layer isn't in bblayers.conf 1302 # Put commit back and check we can run it if layer isn't in bblayers.conf
1289 os.remove(bbappendfile) 1303 os.remove(bbappendfile)
1304 result = runCmd("sed 's!\\(#define VERSION\\W*\"[^\"]*\\)\"!\\1-custom\"!' -i ReadMe.c", cwd=tempsrcdir)
1290 result = runCmd('git commit -a -m "Add our custom version"', cwd=tempsrcdir) 1305 result = runCmd('git commit -a -m "Add our custom version"', cwd=tempsrcdir)
1291 result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir) 1306 result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir)
1292 result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir)) 1307 result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
@@ -1361,7 +1376,7 @@ class DevtoolUpdateTests(DevtoolBase):
1361 with open(bbappendfile, 'r') as f: 1376 with open(bbappendfile, 'r') as f:
1362 self.assertEqual(expectedlines, set(f.readlines())) 1377 self.assertEqual(expectedlines, set(f.readlines()))
1363 # Drop new commit and check SRCREV changes 1378 # Drop new commit and check SRCREV changes
1364 result = runCmd('git reset HEAD^', cwd=tempsrcdir) 1379 result = runCmd('git reset HEAD^ --hard', cwd=tempsrcdir)
1365 result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir)) 1380 result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
1366 self.assertNotExists(os.path.join(appenddir, testrecipe), 'Patch directory should not be created') 1381 self.assertNotExists(os.path.join(appenddir, testrecipe), 'Patch directory should not be created')
1367 result = runCmd('git rev-parse HEAD', cwd=tempsrcdir) 1382 result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
@@ -1373,6 +1388,7 @@ class DevtoolUpdateTests(DevtoolBase):
1373 self.assertEqual(expectedlines, set(f.readlines())) 1388 self.assertEqual(expectedlines, set(f.readlines()))
1374 # Put commit back and check we can run it if layer isn't in bblayers.conf 1389 # Put commit back and check we can run it if layer isn't in bblayers.conf
1375 os.remove(bbappendfile) 1390 os.remove(bbappendfile)
1391 result = runCmd('echo "# Additional line" >> Makefile.am', cwd=tempsrcdir)
1376 result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempsrcdir) 1392 result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempsrcdir)
1377 result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir) 1393 result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir)
1378 result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir)) 1394 result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
@@ -1404,11 +1420,12 @@ class DevtoolUpdateTests(DevtoolBase):
1404 # Try building just to ensure we haven't broken that 1420 # Try building just to ensure we haven't broken that
1405 bitbake("%s" % testrecipe) 1421 bitbake("%s" % testrecipe)
1406 # Edit / commit local source 1422 # Edit / commit local source
1407 runCmd('echo "/* Foobar */" >> oe-local-files/makedevs.c', cwd=tempdir) 1423 runCmd('echo "/* Foobar */" >> makedevs.c', cwd=tempdir)
1408 runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir) 1424 runCmd('echo "Foo" > new-local', cwd=tempdir)
1409 runCmd('echo "Bar" > new-file', cwd=tempdir) 1425 runCmd('echo "Bar" > new-file', cwd=tempdir)
1410 runCmd('git add new-file', cwd=tempdir) 1426 runCmd('git add new-file', cwd=tempdir)
1411 runCmd('git commit -m "Add new file"', cwd=tempdir) 1427 runCmd('git commit -m "Add new file"', cwd=tempdir)
1428 runCmd('git add new-local', cwd=tempdir)
1412 runCmd('devtool update-recipe %s' % testrecipe) 1429 runCmd('devtool update-recipe %s' % testrecipe)
1413 expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)), 1430 expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
1414 (' M', '.*/makedevs/makedevs.c$'), 1431 (' M', '.*/makedevs/makedevs.c$'),
@@ -1434,8 +1451,8 @@ class DevtoolUpdateTests(DevtoolBase):
1434 self.assertExists(local_file, 'File makedevs.c not created') 1451 self.assertExists(local_file, 'File makedevs.c not created')
1435 self.assertExists(patchfile, 'File new_local not created') 1452 self.assertExists(patchfile, 'File new_local not created')
1436 1453
1437 def test_devtool_update_recipe_local_files_2(self): 1454 def _test_devtool_update_recipe_local_files_2(self):
1438 """Check local source files support when oe-local-files is in Git""" 1455 """Check local source files support when editing local files in Git"""
1439 testrecipe = 'devtool-test-local' 1456 testrecipe = 'devtool-test-local'
1440 recipefile = get_bb_var('FILE', testrecipe) 1457 recipefile = get_bb_var('FILE', testrecipe)
1441 recipedir = os.path.dirname(recipefile) 1458 recipedir = os.path.dirname(recipefile)
@@ -1450,17 +1467,13 @@ class DevtoolUpdateTests(DevtoolBase):
1450 result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) 1467 result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
1451 # Check git repo 1468 # Check git repo
1452 self._check_src_repo(tempdir) 1469 self._check_src_repo(tempdir)
1453 # Add oe-local-files to Git
1454 runCmd('rm oe-local-files/.gitignore', cwd=tempdir)
1455 runCmd('git add oe-local-files', cwd=tempdir)
1456 runCmd('git commit -m "Add local sources"', cwd=tempdir)
1457 # Edit / commit local sources 1470 # Edit / commit local sources
1458 runCmd('echo "# Foobar" >> oe-local-files/file1', cwd=tempdir) 1471 runCmd('echo "# Foobar" >> file1', cwd=tempdir)
1459 runCmd('git commit -am "Edit existing file"', cwd=tempdir) 1472 runCmd('git commit -am "Edit existing file"', cwd=tempdir)
1460 runCmd('git rm oe-local-files/file2', cwd=tempdir) 1473 runCmd('git rm file2', cwd=tempdir)
1461 runCmd('git commit -m"Remove file"', cwd=tempdir) 1474 runCmd('git commit -m"Remove file"', cwd=tempdir)
1462 runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir) 1475 runCmd('echo "Foo" > new-local', cwd=tempdir)
1463 runCmd('git add oe-local-files/new-local', cwd=tempdir) 1476 runCmd('git add new-local', cwd=tempdir)
1464 runCmd('git commit -m "Add new local file"', cwd=tempdir) 1477 runCmd('git commit -m "Add new local file"', cwd=tempdir)
1465 runCmd('echo "Gar" > new-file', cwd=tempdir) 1478 runCmd('echo "Gar" > new-file', cwd=tempdir)
1466 runCmd('git add new-file', cwd=tempdir) 1479 runCmd('git add new-file', cwd=tempdir)
@@ -1469,7 +1482,7 @@ class DevtoolUpdateTests(DevtoolBase):
1469 os.path.dirname(recipefile)) 1482 os.path.dirname(recipefile))
1470 # Checkout unmodified file to working copy -> devtool should still pick 1483 # Checkout unmodified file to working copy -> devtool should still pick
1471 # the modified version from HEAD 1484 # the modified version from HEAD
1472 runCmd('git checkout HEAD^ -- oe-local-files/file1', cwd=tempdir) 1485 runCmd('git checkout HEAD^ -- file1', cwd=tempdir)
1473 runCmd('devtool update-recipe %s' % testrecipe) 1486 runCmd('devtool update-recipe %s' % testrecipe)
1474 expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)), 1487 expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
1475 (' M', '.*/file1$'), 1488 (' M', '.*/file1$'),
@@ -1544,7 +1557,7 @@ class DevtoolUpdateTests(DevtoolBase):
1544 # (don't bother with cleaning the recipe on teardown, we won't be building it) 1557 # (don't bother with cleaning the recipe on teardown, we won't be building it)
1545 result = runCmd('devtool modify %s' % testrecipe) 1558 result = runCmd('devtool modify %s' % testrecipe)
1546 # Modify one file 1559 # Modify one file
1547 runCmd('echo "Another line" >> file2', cwd=os.path.join(self.workspacedir, 'sources', testrecipe, 'oe-local-files')) 1560 runCmd('echo "Another line" >> file2', cwd=os.path.join(self.workspacedir, 'sources', testrecipe))
1548 self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile))) 1561 self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
1549 result = runCmd('devtool update-recipe %s' % testrecipe) 1562 result = runCmd('devtool update-recipe %s' % testrecipe)
1550 expected_status = [(' M', '.*/%s/file2$' % testrecipe)] 1563 expected_status = [(' M', '.*/%s/file2$' % testrecipe)]
@@ -1773,6 +1786,8 @@ class DevtoolExtractTests(DevtoolBase):
1773 # Definitions 1786 # Definitions
1774 testrecipe = 'mdadm' 1787 testrecipe = 'mdadm'
1775 testfile = '/sbin/mdadm' 1788 testfile = '/sbin/mdadm'
1789 if "usrmerge" in get_bb_var('DISTRO_FEATURES'):
1790 testfile = '/usr/sbin/mdadm'
1776 testimage = 'oe-selftest-image' 1791 testimage = 'oe-selftest-image'
1777 testcommand = '/sbin/mdadm --help' 1792 testcommand = '/sbin/mdadm --help'
1778 # Build an image to run 1793 # Build an image to run
@@ -2002,6 +2017,52 @@ class DevtoolUpgradeTests(DevtoolBase):
2002 newlines = f.readlines() 2017 newlines = f.readlines()
2003 self.assertEqual(desiredlines, newlines) 2018 self.assertEqual(desiredlines, newlines)
2004 2019
2020 def test_devtool_upgrade_recipe_update_extra_tasks(self):
2021 # Check preconditions
2022 self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
2023 self.track_for_cleanup(self.workspacedir)
2024 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
2025 recipe = 'python3-guessing-game'
2026 version = '0.2.0'
2027 commit = '40cf004c2772ffa20ea803fa3be1528a75be3e98'
2028 oldrecipefile = get_bb_var('FILE', recipe)
2029 oldcratesincfile = os.path.join(os.path.dirname(oldrecipefile), os.path.basename(oldrecipefile).strip('_git.bb') + '-crates.inc')
2030 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
2031 self.track_for_cleanup(tempdir)
2032 # Check that recipe is not already under devtool control
2033 result = runCmd('devtool status')
2034 self.assertNotIn(recipe, result.output)
2035 # Check upgrade
2036 result = runCmd('devtool upgrade %s %s --version %s --srcrev %s' % (recipe, tempdir, version, commit))
2037 # Check if srctree at least is populated
2038 self.assertTrue(len(os.listdir(tempdir)) > 0, 'srctree (%s) should be populated with new (%s) source code' % (tempdir, commit))
2039 # Check new recipe file and new -crates.inc files are present
2040 newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, os.path.basename(oldrecipefile))
2041 newcratesincfile = os.path.join(self.workspacedir, 'recipes', recipe, os.path.basename(oldcratesincfile))
2042 self.assertExists(newrecipefile, 'Recipe file should exist after upgrade')
2043 self.assertExists(newcratesincfile, 'Recipe crates.inc file should exist after upgrade')
2044 # Check devtool status and make sure recipe is present
2045 result = runCmd('devtool status')
2046 self.assertIn(recipe, result.output)
2047 self.assertIn(tempdir, result.output)
2048 # Check recipe got changed as expected
2049 with open(oldrecipefile + '.upgraded', 'r') as f:
2050 desiredlines = f.readlines()
2051 with open(newrecipefile, 'r') as f:
2052 newlines = f.readlines()
2053 self.assertEqual(desiredlines, newlines)
2054 # Check crates.inc got changed as expected
2055 with open(oldcratesincfile + '.upgraded', 'r') as f:
2056 desiredlines = f.readlines()
2057 with open(newcratesincfile, 'r') as f:
2058 newlines = f.readlines()
2059 self.assertEqual(desiredlines, newlines)
2060 # Check devtool reset recipe
2061 result = runCmd('devtool reset %s -n' % recipe)
2062 result = runCmd('devtool status')
2063 self.assertNotIn(recipe, result.output)
2064 self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting')
2065
2005 def test_devtool_layer_plugins(self): 2066 def test_devtool_layer_plugins(self):
2006 """Test that devtool can use plugins from other layers. 2067 """Test that devtool can use plugins from other layers.
2007 2068
diff --git a/meta/lib/oeqa/selftest/cases/layerappend.py b/meta/lib/oeqa/selftest/cases/layerappend.py
index 379ed589ad..64b17117cc 100644
--- a/meta/lib/oeqa/selftest/cases/layerappend.py
+++ b/meta/lib/oeqa/selftest/cases/layerappend.py
@@ -37,7 +37,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
37SRC_URI:append = " file://appendtest.txt" 37SRC_URI:append = " file://appendtest.txt"
38 38
39sysroot_stage_all:append() { 39sysroot_stage_all:append() {
40 install -m 644 ${WORKDIR}/appendtest.txt ${SYSROOT_DESTDIR}/ 40 install -m 644 ${UNPACKDIR}/appendtest.txt ${SYSROOT_DESTDIR}/
41} 41}
42 42
43""" 43"""
diff --git a/meta/lib/oeqa/selftest/cases/minidebuginfo.py b/meta/lib/oeqa/selftest/cases/minidebuginfo.py
index 2919f07939..a8923460f9 100644
--- a/meta/lib/oeqa/selftest/cases/minidebuginfo.py
+++ b/meta/lib/oeqa/selftest/cases/minidebuginfo.py
@@ -8,6 +8,7 @@ import subprocess
8import tempfile 8import tempfile
9import shutil 9import shutil
10 10
11from oeqa.core.decorator import OETestTag
11from oeqa.selftest.case import OESelftestTestCase 12from oeqa.selftest.case import OESelftestTestCase
12from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runCmd 13from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runCmd
13 14
@@ -42,3 +43,18 @@ IMAGE_FSTYPES = "tar.bz2"
42 native_sysroot = native_sysroot, target_sys = target_sys) 43 native_sysroot = native_sysroot, target_sys = target_sys)
43 self.assertIn(".gnu_debugdata", r.output) 44 self.assertIn(".gnu_debugdata", r.output)
44 45
46 @OETestTag("runqemu")
47 def test_minidebuginfo_qemu(self):
48 """
49 Test minidebuginfo inside a qemu.
50 This runs test_systemd_coredump_minidebuginfo and other minidebuginfo runtime tests which may be added in the future.
51 """
52
53 self.write_config("""
54DISTRO_FEATURES:append = " minidebuginfo"
55INIT_MANAGER = "systemd"
56IMAGE_CLASSES += "testimage"
57TEST_SUITES = "ping ssh systemd"
58 """)
59 bitbake('core-image-minimal')
60 bitbake('-c testimage core-image-minimal')
diff --git a/meta/lib/oeqa/selftest/cases/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py
index f69efccfee..fcfe54af74 100644
--- a/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -175,7 +175,7 @@ class OEListPackageconfigTests(OESelftestTestCase):
175 def test_packageconfig_flags_option_all(self): 175 def test_packageconfig_flags_option_all(self):
176 results = runCmd('%s/contrib/list-packageconfig-flags.py -a' % self.scripts_dir) 176 results = runCmd('%s/contrib/list-packageconfig-flags.py -a' % self.scripts_dir)
177 expected_endlines = [] 177 expected_endlines = []
178 expected_endlines.append("pinentry-1.2.1") 178 expected_endlines.append("pinentry-1.3.0")
179 expected_endlines.append("PACKAGECONFIG ncurses") 179 expected_endlines.append("PACKAGECONFIG ncurses")
180 expected_endlines.append("PACKAGECONFIG[qt] --enable-pinentry-qt, --disable-pinentry-qt, qtbase-native qtbase") 180 expected_endlines.append("PACKAGECONFIG[qt] --enable-pinentry-qt, --disable-pinentry-qt, qtbase-native qtbase")
181 expected_endlines.append("PACKAGECONFIG[gtk2] --enable-pinentry-gtk2, --disable-pinentry-gtk2, gtk+ glib-2.0") 181 expected_endlines.append("PACKAGECONFIG[gtk2] --enable-pinentry-gtk2, --disable-pinentry-gtk2, gtk+ glib-2.0")
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py
index aebea42502..42202b7831 100644
--- a/meta/lib/oeqa/selftest/cases/recipetool.py
+++ b/meta/lib/oeqa/selftest/cases/recipetool.py
@@ -120,9 +120,15 @@ class RecipetoolAppendTests(RecipetoolBase):
120 self._try_recipetool_appendfile_fail('/dev/console', self.testfile, ['ERROR: /dev/console cannot be handled by this tool']) 120 self._try_recipetool_appendfile_fail('/dev/console', self.testfile, ['ERROR: /dev/console cannot be handled by this tool'])
121 121
122 def test_recipetool_appendfile_alternatives(self): 122 def test_recipetool_appendfile_alternatives(self):
123 lspath = '/bin/ls'
124 dirname = "base_bindir"
125 if "usrmerge" in get_bb_var('DISTRO_FEATURES'):
126 lspath = '/usr/bin/ls'
127 dirname = "bindir"
128
123 # Now try with a file we know should be an alternative 129 # Now try with a file we know should be an alternative
124 # (this is very much a fake example, but one we know is reliably an alternative) 130 # (this is very much a fake example, but one we know is reliably an alternative)
125 self._try_recipetool_appendfile_fail('/bin/ls', self.testfile, ['ERROR: File /bin/ls is an alternative possibly provided by the following recipes:', 'coreutils', 'busybox']) 131 self._try_recipetool_appendfile_fail(lspath, self.testfile, ['ERROR: File %s is an alternative possibly provided by the following recipes:' % lspath, 'coreutils', 'busybox'])
126 # Need a test file - should be executable 132 # Need a test file - should be executable
127 testfile2 = os.path.join(self.corebase, 'oe-init-build-env') 133 testfile2 = os.path.join(self.corebase, 'oe-init-build-env')
128 testfile2name = os.path.basename(testfile2) 134 testfile2name = os.path.basename(testfile2)
@@ -131,12 +137,12 @@ class RecipetoolAppendTests(RecipetoolBase):
131 'SRC_URI += "file://%s"\n' % testfile2name, 137 'SRC_URI += "file://%s"\n' % testfile2name,
132 '\n', 138 '\n',
133 'do_install:append() {\n', 139 'do_install:append() {\n',
134 ' install -d ${D}${base_bindir}\n', 140 ' install -d ${D}${%s}\n' % dirname,
135 ' install -m 0755 ${WORKDIR}/%s ${D}${base_bindir}/ls\n' % testfile2name, 141 ' install -m 0755 ${UNPACKDIR}/%s ${D}${%s}/ls\n' % (testfile2name, dirname),
136 '}\n'] 142 '}\n']
137 self._try_recipetool_appendfile('coreutils', '/bin/ls', testfile2, '-r coreutils', expectedlines, [testfile2name]) 143 self._try_recipetool_appendfile('coreutils', lspath, testfile2, '-r coreutils', expectedlines, [testfile2name])
138 # Now try bbappending the same file again, contents should not change 144 # Now try bbappending the same file again, contents should not change
139 bbappendfile, _ = self._try_recipetool_appendfile('coreutils', '/bin/ls', self.testfile, '-r coreutils', expectedlines, [testfile2name]) 145 bbappendfile, _ = self._try_recipetool_appendfile('coreutils', lspath, self.testfile, '-r coreutils', expectedlines, [testfile2name])
140 # But file should have 146 # But file should have
141 copiedfile = os.path.join(os.path.dirname(bbappendfile), 'coreutils', testfile2name) 147 copiedfile = os.path.join(os.path.dirname(bbappendfile), 'coreutils', testfile2name)
142 result = runCmd('diff -q %s %s' % (testfile2, copiedfile), ignore_status=True) 148 result = runCmd('diff -q %s %s' % (testfile2, copiedfile), ignore_status=True)
@@ -158,7 +164,7 @@ class RecipetoolAppendTests(RecipetoolBase):
158 '\n', 164 '\n',
159 'do_install:append() {\n', 165 'do_install:append() {\n',
160 ' install -d ${D}${datadir}\n', 166 ' install -d ${D}${datadir}\n',
161 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', 167 ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/something\n',
162 '}\n'] 168 '}\n']
163 self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase', expectedlines, ['testfile']) 169 self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase', expectedlines, ['testfile'])
164 # Try adding another file, this time where the source file is executable 170 # Try adding another file, this time where the source file is executable
@@ -173,8 +179,8 @@ class RecipetoolAppendTests(RecipetoolBase):
173 '\n', 179 '\n',
174 'do_install:append() {\n', 180 'do_install:append() {\n',
175 ' install -d ${D}${datadir}\n', 181 ' install -d ${D}${datadir}\n',
176 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', 182 ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/something\n',
177 ' install -m 0755 ${WORKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name, 183 ' install -m 0755 ${UNPACKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name,
178 '}\n'] 184 '}\n']
179 self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name]) 185 self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name])
180 186
@@ -186,7 +192,7 @@ class RecipetoolAppendTests(RecipetoolBase):
186 '\n', 192 '\n',
187 'do_install:append() {\n', 193 'do_install:append() {\n',
188 ' install -d ${D}${bindir}\n', 194 ' install -d ${D}${bindir}\n',
189 ' install -m 0755 ${WORKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n', 195 ' install -m 0755 ${UNPACKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n',
190 '}\n'] 196 '}\n']
191 _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile']) 197 _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile'])
192 self.assertNotIn('WARNING: ', output) 198 self.assertNotIn('WARNING: ', output)
@@ -201,7 +207,7 @@ class RecipetoolAppendTests(RecipetoolBase):
201 '\n', 207 '\n',
202 'do_install:append:mymachine() {\n', 208 'do_install:append:mymachine() {\n',
203 ' install -d ${D}${datadir}\n', 209 ' install -d ${D}${datadir}\n',
204 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', 210 ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/something\n',
205 '}\n'] 211 '}\n']
206 _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile']) 212 _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile'])
207 self.assertNotIn('WARNING: ', output) 213 self.assertNotIn('WARNING: ', output)
@@ -235,7 +241,7 @@ class RecipetoolAppendTests(RecipetoolBase):
235 '\n', 241 '\n',
236 'do_install:append() {\n', 242 'do_install:append() {\n',
237 ' install -d ${D}${datadir}\n', 243 ' install -d ${D}${datadir}\n',
238 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n', 244 ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n',
239 '}\n'] 245 '}\n']
240 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile']) 246 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile'])
241 self.assertNotIn('WARNING: ', output) 247 self.assertNotIn('WARNING: ', output)
@@ -262,7 +268,7 @@ class RecipetoolAppendTests(RecipetoolBase):
262 '\n', 268 '\n',
263 'do_install:append() {\n', 269 'do_install:append() {\n',
264 ' install -d ${D}${sysconfdir}\n', 270 ' install -d ${D}${sysconfdir}\n',
265 ' install -m 0644 ${WORKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n', 271 ' install -m 0644 ${UNPACKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n',
266 '}\n'] 272 '}\n']
267 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/etc/selftest-replaceme-patched', self.testfile, '', expectedlines, ['testfile']) 273 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/etc/selftest-replaceme-patched', self.testfile, '', expectedlines, ['testfile'])
268 for line in output.splitlines(): 274 for line in output.splitlines():
@@ -280,7 +286,7 @@ class RecipetoolAppendTests(RecipetoolBase):
280 '\n', 286 '\n',
281 'do_install:append() {\n', 287 'do_install:append() {\n',
282 ' install -d ${D}${datadir}\n', 288 ' install -d ${D}${datadir}\n',
283 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n', 289 ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n',
284 '}\n'] 290 '}\n']
285 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile']) 291 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile'])
286 self.assertNotIn('WARNING: ', output) 292 self.assertNotIn('WARNING: ', output)
@@ -303,7 +309,7 @@ class RecipetoolAppendTests(RecipetoolBase):
303 '\n', 309 '\n',
304 'do_install:append() {\n', 310 'do_install:append() {\n',
305 ' install -d ${D}${datadir}\n', 311 ' install -d ${D}${datadir}\n',
306 ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n', 312 ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n',
307 '}\n'] 313 '}\n']
308 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile']) 314 _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile'])
309 315
diff --git a/meta/lib/oeqa/selftest/cases/recipeutils.py b/meta/lib/oeqa/selftest/cases/recipeutils.py
index 2cb4445f81..9949737172 100644
--- a/meta/lib/oeqa/selftest/cases/recipeutils.py
+++ b/meta/lib/oeqa/selftest/cases/recipeutils.py
@@ -72,7 +72,7 @@ class RecipeUtilsTests(OESelftestTestCase):
72 expected_patch = """ 72 expected_patch = """
73--- a/recipes-test/recipeutils/recipeutils-test_1.2.bb 73--- a/recipes-test/recipeutils/recipeutils-test_1.2.bb
74+++ b/recipes-test/recipeutils/recipeutils-test_1.2.bb 74+++ b/recipes-test/recipeutils/recipeutils-test_1.2.bb
75@@ -8,6 +8,4 @@ 75@@ -11,6 +11,4 @@
76 76
77 BBCLASSEXTEND = "native nativesdk" 77 BBCLASSEXTEND = "native nativesdk"
78 78
@@ -97,7 +97,7 @@ class RecipeUtilsTests(OESelftestTestCase):
97 expected_patch = """ 97 expected_patch = """
98--- a/recipes-test/recipeutils/recipeutils-test_1.2.bb 98--- a/recipes-test/recipeutils/recipeutils-test_1.2.bb
99+++ b/recipes-test/recipeutils/recipeutils-test_1.2.bb 99+++ b/recipes-test/recipeutils/recipeutils-test_1.2.bb
100@@ -8,6 +8,3 @@ 100@@ -11,6 +11,3 @@
101 101
102 BBCLASSEXTEND = "native nativesdk" 102 BBCLASSEXTEND = "native nativesdk"
103 103
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index 80e830136f..97a9c3da90 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -16,6 +16,8 @@ import os
16import datetime 16import datetime
17 17
18exclude_packages = [ 18exclude_packages = [
19 'rust-rustdoc',
20 'rust-dbg'
19 ] 21 ]
20 22
21def is_excluded(package): 23def is_excluded(package):
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 12000aac16..13aa5f16c9 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -273,7 +273,7 @@ TEST_RUNQEMUPARAMS += " slirp"
273 import subprocess, os 273 import subprocess, os
274 274
275 distro = oe.lsb.distro_identifier() 275 distro = oe.lsb.distro_identifier()
276 if distro and (distro in ['debian-9', 'debian-10', 'centos-7', 'centos-8', 'ubuntu-16.04', 'ubuntu-18.04'] or 276 if distro and (distro in ['debian-9', 'debian-10', 'centos-7', 'centos-8', 'centos-9', 'ubuntu-16.04', 'ubuntu-18.04'] or
277 distro.startswith('almalinux') or distro.startswith('rocky')): 277 distro.startswith('almalinux') or distro.startswith('rocky')):
278 self.skipTest('virgl headless cannot be tested with %s' %(distro)) 278 self.skipTest('virgl headless cannot be tested with %s' %(distro))
279 279
diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
index ad14189c6d..4ccbe9867b 100644
--- a/meta/lib/oeqa/selftest/cases/rust.py
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -210,9 +210,8 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
210 tmpdir = get_bb_var("TMPDIR", "rust") 210 tmpdir = get_bb_var("TMPDIR", "rust")
211 211
212 # Set path for target-poky-linux-gcc, RUST_TARGET_PATH and hosttools. 212 # Set path for target-poky-linux-gcc, RUST_TARGET_PATH and hosttools.
213 cmd = " export PATH=%s/recipe-sysroot-native/usr/bin:$PATH;" % rustlibpath 213 cmd = "export TARGET_VENDOR=\"-poky\";"
214 cmd = cmd + " export TARGET_VENDOR=\"-poky\";" 214 cmd = cmd + " export PATH=%s/recipe-sysroot-native/usr/bin/python3-native:%s/recipe-sysroot-native/usr/bin:%s/recipe-sysroot-native/usr/bin/%s:%s/hosttools:$PATH;" % (rustlibpath, rustlibpath, rustlibpath, tcpath, tmpdir)
215 cmd = cmd + " export PATH=%s/recipe-sysroot-native/usr/bin/%s:%s/hosttools:$PATH;" % (rustlibpath, tcpath, tmpdir)
216 cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath 215 cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath
217 # Trigger testing. 216 # Trigger testing.
218 cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip 217 cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip
diff --git a/meta/lib/oeqa/selftest/cases/spdx.py b/meta/lib/oeqa/selftest/cases/spdx.py
index 05fc4e390b..7685a81e7f 100644
--- a/meta/lib/oeqa/selftest/cases/spdx.py
+++ b/meta/lib/oeqa/selftest/cases/spdx.py
@@ -25,10 +25,11 @@ INHERIT += "create-spdx"
25 25
26 deploy_dir = get_bb_var("DEPLOY_DIR") 26 deploy_dir = get_bb_var("DEPLOY_DIR")
27 machine_var = get_bb_var("MACHINE") 27 machine_var = get_bb_var("MACHINE")
28 spdx_version = get_bb_var("SPDX_VERSION")
28 # qemux86-64 creates the directory qemux86_64 29 # qemux86-64 creates the directory qemux86_64
29 machine_dir = machine_var.replace("-", "_") 30 machine_dir = machine_var.replace("-", "_")
30 31
31 full_file_path = os.path.join(deploy_dir, "spdx", machine_dir, high_level_dir, spdx_file) 32 full_file_path = os.path.join(deploy_dir, "spdx", spdx_version, machine_dir, high_level_dir, spdx_file)
32 33
33 try: 34 try:
34 os.remove(full_file_path) 35 os.remove(full_file_path)
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py
index 86d6cd7464..94ad6e38b6 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -917,15 +917,25 @@ INHERIT += "base-do-configure-modified"
917""", 917""",
918expected_sametmp_output, expected_difftmp_output) 918expected_sametmp_output, expected_difftmp_output)
919 919
920@OETestTag("yocto-mirrors") 920class SStateCheckObjectPresence(SStateBase):
921class SStateMirrors(SStateBase): 921 def check_bb_output(self, output, targets, exceptions, check_cdn):
922 def check_bb_output(self, output, exceptions, check_cdn):
923 def is_exception(object, exceptions): 922 def is_exception(object, exceptions):
924 for e in exceptions: 923 for e in exceptions:
925 if re.search(e, object): 924 if re.search(e, object):
926 return True 925 return True
927 return False 926 return False
928 927
928 # sstate is checked for existence of these, but they never get written out to begin with
929 exceptions += ["{}.*image_qa".format(t) for t in targets.split()]
930 exceptions += ["{}.*deploy_source_date_epoch".format(t) for t in targets.split()]
931 exceptions += ["{}.*image_complete".format(t) for t in targets.split()]
932 exceptions += ["linux-yocto.*shared_workdir"]
933 # these get influnced by IMAGE_FSTYPES tweaks in yocto-autobuilder-helper's config.json (on x86-64)
934 # additionally, they depend on noexec (thus, absent stamps) package, install, etc. image tasks,
935 # which makes tracing other changes difficult
936 exceptions += ["{}.*create_spdx".format(t) for t in targets.split()]
937 exceptions += ["{}.*create_runtime_spdx".format(t) for t in targets.split()]
938
929 output_l = output.splitlines() 939 output_l = output.splitlines()
930 for l in output_l: 940 for l in output_l:
931 if l.startswith("Sstate summary"): 941 if l.startswith("Sstate summary"):
@@ -960,18 +970,9 @@ class SStateMirrors(SStateBase):
960 self.assertEqual(len(failed_urls), missing_objects, "Amount of reported missing objects does not match failed URLs: {}\nFailed URLs:\n{}\nFetcher diagnostics:\n{}".format(missing_objects, "\n".join(failed_urls), "\n".join(failed_urls_extrainfo))) 970 self.assertEqual(len(failed_urls), missing_objects, "Amount of reported missing objects does not match failed URLs: {}\nFailed URLs:\n{}\nFetcher diagnostics:\n{}".format(missing_objects, "\n".join(failed_urls), "\n".join(failed_urls_extrainfo)))
961 self.assertEqual(len(failed_urls), 0, "Missing objects in the cache:\n{}\nFetcher diagnostics:\n{}".format("\n".join(failed_urls), "\n".join(failed_urls_extrainfo))) 971 self.assertEqual(len(failed_urls), 0, "Missing objects in the cache:\n{}\nFetcher diagnostics:\n{}".format("\n".join(failed_urls), "\n".join(failed_urls_extrainfo)))
962 972
973@OETestTag("yocto-mirrors")
974class SStateMirrors(SStateCheckObjectPresence):
963 def run_test(self, machine, targets, exceptions, check_cdn = True, ignore_errors = False): 975 def run_test(self, machine, targets, exceptions, check_cdn = True, ignore_errors = False):
964 # sstate is checked for existence of these, but they never get written out to begin with
965 exceptions += ["{}.*image_qa".format(t) for t in targets.split()]
966 exceptions += ["{}.*deploy_source_date_epoch".format(t) for t in targets.split()]
967 exceptions += ["{}.*image_complete".format(t) for t in targets.split()]
968 exceptions += ["linux-yocto.*shared_workdir"]
969 # these get influnced by IMAGE_FSTYPES tweaks in yocto-autobuilder-helper's config.json (on x86-64)
970 # additionally, they depend on noexec (thus, absent stamps) package, install, etc. image tasks,
971 # which makes tracing other changes difficult
972 exceptions += ["{}.*create_spdx".format(t) for t in targets.split()]
973 exceptions += ["{}.*create_runtime_spdx".format(t) for t in targets.split()]
974
975 if check_cdn: 976 if check_cdn:
976 self.config_sstate(True) 977 self.config_sstate(True)
977 self.append_config(""" 978 self.append_config("""
@@ -987,7 +988,7 @@ MACHINE = "{}"
987 bitbake("-S none {}".format(targets)) 988 bitbake("-S none {}".format(targets))
988 if ignore_errors: 989 if ignore_errors:
989 return 990 return
990 self.check_bb_output(result.output, exceptions, check_cdn) 991 self.check_bb_output(result.output, targets, exceptions, check_cdn)
991 992
992 def test_cdn_mirror_qemux86_64(self): 993 def test_cdn_mirror_qemux86_64(self):
993 exceptions = [] 994 exceptions = []