diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/bbtests.py | 31 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 5 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/recipetool.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/reproducible.py | 10 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/runtime_test.py | 7 |
5 files changed, 48 insertions, 7 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py index b932d5276b..4187cb840a 100644 --- a/meta/lib/oeqa/selftest/cases/bbtests.py +++ b/meta/lib/oeqa/selftest/cases/bbtests.py | |||
@@ -163,7 +163,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" | |||
163 | """) | 163 | """) |
164 | self.track_for_cleanup(os.path.join(self.builddir, "download-selftest")) | 164 | self.track_for_cleanup(os.path.join(self.builddir, "download-selftest")) |
165 | 165 | ||
166 | data = 'SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz;downloadfilename=test-aspell.tar.gz"' | 166 | data = 'SRC_URI = "https://downloads.yoctoproject.org/mirror/sources/aspell-${PV}.tar.gz;downloadfilename=test-aspell.tar.gz"' |
167 | self.write_recipeinc('aspell', data) | 167 | self.write_recipeinc('aspell', data) |
168 | result = bitbake('-f -c fetch aspell', ignore_status=True) | 168 | result = bitbake('-f -c fetch aspell', ignore_status=True) |
169 | self.delete_recipeinc('aspell') | 169 | self.delete_recipeinc('aspell') |
@@ -300,3 +300,32 @@ INHERIT_remove = \"report-error\" | |||
300 | 300 | ||
301 | test_recipe_summary_after = get_bb_var('SUMMARY', test_recipe) | 301 | test_recipe_summary_after = get_bb_var('SUMMARY', test_recipe) |
302 | self.assertEqual(expected_recipe_summary, test_recipe_summary_after) | 302 | self.assertEqual(expected_recipe_summary, test_recipe_summary_after) |
303 | |||
304 | def test_git_patchtool(self): | ||
305 | """ PATCHTOOL=git should work with non-git sources like tarballs | ||
306 | test recipe for the test must NOT containt git:// repository in SRC_URI | ||
307 | """ | ||
308 | test_recipe = "man-db" | ||
309 | self.write_recipeinc(test_recipe, 'PATCHTOOL=\"git\"') | ||
310 | src = get_bb_var("SRC_URI",test_recipe) | ||
311 | gitscm = re.search("git://", src) | ||
312 | self.assertFalse(gitscm, "test_git_patchtool pre-condition failed: {} test recipe contains git repo!".format(test_recipe)) | ||
313 | result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False) | ||
314 | fatal = re.search("fatal: not a git repository (or any of the parent directories)", result.output) | ||
315 | self.assertFalse(fatal, "Failed to patch using PATCHTOOL=\"git\"") | ||
316 | self.delete_recipeinc(test_recipe) | ||
317 | bitbake('-cclean {}'.format(test_recipe)) | ||
318 | |||
319 | def test_git_patchtool2(self): | ||
320 | """ Test if PATCHTOOL=git works with git repo and doesn't reinitialize it | ||
321 | """ | ||
322 | test_recipe = "gitrepotest" | ||
323 | src = get_bb_var("SRC_URI",test_recipe) | ||
324 | gitscm = re.search("git://", src) | ||
325 | self.assertTrue(gitscm, "test_git_patchtool pre-condition failed: {} test recipe doesn't contains git repo!".format(test_recipe)) | ||
326 | result = bitbake('{} -c patch'.format(test_recipe), ignore_status=False) | ||
327 | srcdir = get_bb_var('S', test_recipe) | ||
328 | result = runCmd("git log", cwd = srcdir) | ||
329 | self.assertFalse("bitbake_patching_started" in result.output, msg = "Repository has been reinitialized. {}".format(srcdir)) | ||
330 | self.delete_recipeinc(test_recipe) | ||
331 | bitbake('-cclean {}'.format(test_recipe)) | ||
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 66e326253e..7ac1fcfbeb 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -442,6 +442,7 @@ class DevtoolAddTests(DevtoolBase): | |||
442 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | 442 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') |
443 | self.track_for_cleanup(tempdir) | 443 | self.track_for_cleanup(tempdir) |
444 | url = 'gitsm://git.yoctoproject.org/mraa' | 444 | url = 'gitsm://git.yoctoproject.org/mraa' |
445 | url_branch = '%s;branch=master' % url | ||
445 | checkrev = 'ae127b19a50aa54255e4330ccfdd9a5d058e581d' | 446 | checkrev = 'ae127b19a50aa54255e4330ccfdd9a5d058e581d' |
446 | testrecipe = 'mraa' | 447 | testrecipe = 'mraa' |
447 | srcdir = os.path.join(tempdir, testrecipe) | 448 | srcdir = os.path.join(tempdir, testrecipe) |
@@ -462,7 +463,7 @@ class DevtoolAddTests(DevtoolBase): | |||
462 | checkvars = {} | 463 | checkvars = {} |
463 | checkvars['S'] = '${WORKDIR}/git' | 464 | checkvars['S'] = '${WORKDIR}/git' |
464 | checkvars['PV'] = '1.0+git${SRCPV}' | 465 | checkvars['PV'] = '1.0+git${SRCPV}' |
465 | checkvars['SRC_URI'] = url | 466 | checkvars['SRC_URI'] = url_branch |
466 | checkvars['SRCREV'] = '${AUTOREV}' | 467 | checkvars['SRCREV'] = '${AUTOREV}' |
467 | self._test_recipe_contents(recipefile, checkvars, []) | 468 | self._test_recipe_contents(recipefile, checkvars, []) |
468 | # Try with revision and version specified | 469 | # Try with revision and version specified |
@@ -481,7 +482,7 @@ class DevtoolAddTests(DevtoolBase): | |||
481 | checkvars = {} | 482 | checkvars = {} |
482 | checkvars['S'] = '${WORKDIR}/git' | 483 | checkvars['S'] = '${WORKDIR}/git' |
483 | checkvars['PV'] = '1.5+git${SRCPV}' | 484 | checkvars['PV'] = '1.5+git${SRCPV}' |
484 | checkvars['SRC_URI'] = url | 485 | checkvars['SRC_URI'] = url_branch |
485 | checkvars['SRCREV'] = checkrev | 486 | checkvars['SRCREV'] = checkrev |
486 | self._test_recipe_contents(recipefile, checkvars, []) | 487 | self._test_recipe_contents(recipefile, checkvars, []) |
487 | 488 | ||
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 3621492998..4f283cdc03 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py | |||
@@ -375,7 +375,7 @@ class RecipetoolTests(RecipetoolBase): | |||
375 | temprecipe = os.path.join(self.tempdir, 'recipe') | 375 | temprecipe = os.path.join(self.tempdir, 'recipe') |
376 | os.makedirs(temprecipe) | 376 | os.makedirs(temprecipe) |
377 | pv = '1.7.3.0' | 377 | pv = '1.7.3.0' |
378 | srcuri = 'http://www.dest-unreach.org/socat/download/socat-%s.tar.bz2' % pv | 378 | srcuri = 'http://www.dest-unreach.org/socat/download/Archive/socat-%s.tar.bz2' % pv |
379 | result = runCmd('recipetool create %s -o %s' % (srcuri, temprecipe)) | 379 | result = runCmd('recipetool create %s -o %s' % (srcuri, temprecipe)) |
380 | dirlist = os.listdir(temprecipe) | 380 | dirlist = os.listdir(temprecipe) |
381 | if len(dirlist) > 1: | 381 | if len(dirlist) > 1: |
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py index a62757399b..546dc91120 100644 --- a/meta/lib/oeqa/selftest/cases/reproducible.py +++ b/meta/lib/oeqa/selftest/cases/reproducible.py | |||
@@ -114,8 +114,9 @@ def compare_file(reference, test, diffutils_sysroot): | |||
114 | result.status = SAME | 114 | result.status = SAME |
115 | return result | 115 | return result |
116 | 116 | ||
117 | def run_diffoscope(a_dir, b_dir, html_dir, **kwargs): | 117 | def run_diffoscope(a_dir, b_dir, html_dir, max_report_size=0, **kwargs): |
118 | return runCmd(['diffoscope', '--no-default-limits', '--exclude-directory-metadata', 'yes', '--html-dir', html_dir, a_dir, b_dir], | 118 | return runCmd(['diffoscope', '--no-default-limits', '--max-report-size', str(max_report_size), |
119 | '--exclude-directory-metadata', 'yes', '--html-dir', html_dir, a_dir, b_dir], | ||
119 | **kwargs) | 120 | **kwargs) |
120 | 121 | ||
121 | class DiffoscopeTests(OESelftestTestCase): | 122 | class DiffoscopeTests(OESelftestTestCase): |
@@ -145,6 +146,9 @@ class ReproducibleTests(OESelftestTestCase): | |||
145 | 146 | ||
146 | package_classes = ['deb', 'ipk', 'rpm'] | 147 | package_classes = ['deb', 'ipk', 'rpm'] |
147 | 148 | ||
149 | # Maximum report size, in bytes | ||
150 | max_report_size = 250 * 1024 * 1024 | ||
151 | |||
148 | # targets are the things we want to test the reproducibility of | 152 | # targets are the things we want to test the reproducibility of |
149 | targets = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline', 'core-image-weston', 'world'] | 153 | targets = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline', 'core-image-weston', 'world'] |
150 | # sstate targets are things to pull from sstate to potentially cut build/debugging time | 154 | # sstate targets are things to pull from sstate to potentially cut build/debugging time |
@@ -321,7 +325,7 @@ class ReproducibleTests(OESelftestTestCase): | |||
321 | # Copy jquery to improve the diffoscope output usability | 325 | # Copy jquery to improve the diffoscope output usability |
322 | self.copy_file(os.path.join(jquery_sysroot, 'usr/share/javascript/jquery/jquery.min.js'), os.path.join(package_html_dir, 'jquery.js')) | 326 | self.copy_file(os.path.join(jquery_sysroot, 'usr/share/javascript/jquery/jquery.min.js'), os.path.join(package_html_dir, 'jquery.js')) |
323 | 327 | ||
324 | run_diffoscope('reproducibleA', 'reproducibleB', package_html_dir, | 328 | run_diffoscope('reproducibleA', 'reproducibleB', package_html_dir, max_report_size=self.max_report_size, |
325 | native_sysroot=diffoscope_sysroot, ignore_status=True, cwd=package_dir) | 329 | native_sysroot=diffoscope_sysroot, ignore_status=True, cwd=package_dir) |
326 | 330 | ||
327 | if fails: | 331 | if fails: |
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index b20c5b427b..f9649339e5 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py | |||
@@ -185,6 +185,10 @@ class TestImage(OESelftestTestCase): | |||
185 | self.skipTest('virgl isn\'t working with Debian 9') | 185 | self.skipTest('virgl isn\'t working with Debian 9') |
186 | if distro and distro == 'centos-7': | 186 | if distro and distro == 'centos-7': |
187 | self.skipTest('virgl isn\'t working with Centos 7') | 187 | self.skipTest('virgl isn\'t working with Centos 7') |
188 | if distro and distro == 'centos-8': | ||
189 | self.skipTest('virgl isn\'t working with Centos 8') | ||
190 | if distro and distro == 'fedora-34': | ||
191 | self.skipTest('virgl isn\'t working with Fedora 34') | ||
188 | if distro and distro == 'opensuseleap-15.0': | 192 | if distro and distro == 'opensuseleap-15.0': |
189 | self.skipTest('virgl isn\'t working with Opensuse 15.0') | 193 | self.skipTest('virgl isn\'t working with Opensuse 15.0') |
190 | 194 | ||
@@ -228,6 +232,9 @@ class TestImage(OESelftestTestCase): | |||
228 | dripath = subprocess.check_output("pkg-config --variable=dridriverdir dri", shell=True) | 232 | dripath = subprocess.check_output("pkg-config --variable=dridriverdir dri", shell=True) |
229 | except subprocess.CalledProcessError as e: | 233 | except subprocess.CalledProcessError as e: |
230 | self.skipTest("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.") | 234 | self.skipTest("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.") |
235 | distro = oe.lsb.distro_identifier() | ||
236 | if distro and distro == 'fedora-34': | ||
237 | self.skipTest('virgl isn\'t working with Fedora 34') | ||
231 | qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native') | 238 | qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native') |
232 | features = 'INHERIT += "testimage"\n' | 239 | features = 'INHERIT += "testimage"\n' |
233 | if 'opengl' not in qemu_distrofeatures: | 240 | if 'opengl' not in qemu_distrofeatures: |