diff options
| author | Ola x Nilsson <ola.x.nilsson@axis.com> | 2017-01-09 17:44:58 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-16 18:05:13 +0000 |
| commit | e97422f400de0ed4a57c58be756cbaa512169919 (patch) | |
| tree | 6c76f2e972d162e67f47f112aed16b24cd31d3d0 | |
| parent | 8a85d44ced165ada059874d2595ff20170a2af86 (diff) | |
| download | poky-e97422f400de0ed4a57c58be756cbaa512169919.tar.gz | |
oe-selftest: devtool: Add test for externalsrc buildclean
Test both for S == B and S != B.
(From OE-Core rev: 3b46c1ac203717d85a1e2e8da067a69f066b7037)
Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index 2512c6941e..abe60906b8 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py | |||
| @@ -491,6 +491,52 @@ class DevtoolTests(DevtoolBase): | |||
| 491 | self.assertNotIn('mdadm', result.output) | 491 | self.assertNotIn('mdadm', result.output) |
| 492 | self.assertFalse(list_stamps(), 'Stamp files exist for recipe mdadm that should have been cleaned') | 492 | self.assertFalse(list_stamps(), 'Stamp files exist for recipe mdadm that should have been cleaned') |
| 493 | 493 | ||
| 494 | def test_devtool_buildclean(self): | ||
| 495 | def assertFile(path, *paths): | ||
| 496 | f = os.path.join(path, *paths) | ||
| 497 | self.assertTrue(os.path.exists(f), "%r does not exist" % f) | ||
| 498 | def assertNoFile(path, *paths): | ||
| 499 | f = os.path.join(path, *paths) | ||
| 500 | self.assertFalse(os.path.exists(os.path.join(f)), "%r exists" % f) | ||
| 501 | |||
| 502 | # Clean up anything in the workdir/sysroot/sstate cache | ||
| 503 | bitbake('mdadm m4 -c cleansstate') | ||
| 504 | # Try modifying a recipe | ||
| 505 | tempdir_mdadm = tempfile.mkdtemp(prefix='devtoolqa') | ||
| 506 | tempdir_m4 = tempfile.mkdtemp(prefix='devtoolqa') | ||
| 507 | builddir_m4 = tempfile.mkdtemp(prefix='devtoolqa') | ||
| 508 | self.track_for_cleanup(tempdir_mdadm) | ||
| 509 | self.track_for_cleanup(tempdir_m4) | ||
| 510 | #self.track_for_cleanup(builddir_m4) | ||
| 511 | self.track_for_cleanup(self.workspacedir) | ||
| 512 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
| 513 | self.add_command_to_tearDown('bitbake -c clean mdadm m4') | ||
| 514 | self.write_recipeinc('m4', 'EXTERNALSRC_BUILD = "%s"\ndo_clean() {\n\t:\n}\n' % builddir_m4) | ||
| 515 | try: | ||
| 516 | runCmd('devtool modify mdadm -x %s' % tempdir_mdadm) | ||
| 517 | runCmd('devtool modify m4 -x %s' % tempdir_m4) | ||
| 518 | assertNoFile(tempdir_mdadm, 'mdadm') | ||
| 519 | assertNoFile(builddir_m4, 'src/m4') | ||
| 520 | result = bitbake('m4 -e') | ||
| 521 | result = bitbake('mdadm m4 -c compile') | ||
| 522 | self.assertEqual(result.status, 0) | ||
| 523 | assertFile(tempdir_mdadm, 'mdadm') | ||
| 524 | assertFile(builddir_m4, 'src/m4') | ||
| 525 | # Check that buildclean task exists and does call make clean | ||
| 526 | bitbake('mdadm m4 -c buildclean') | ||
| 527 | assertNoFile(tempdir_mdadm, 'mdadm') | ||
| 528 | assertNoFile(builddir_m4, 'src/m4') | ||
| 529 | bitbake('mdadm m4 -c compile') | ||
| 530 | assertFile(tempdir_mdadm, 'mdadm') | ||
| 531 | assertFile(builddir_m4, 'src/m4') | ||
| 532 | bitbake('mdadm m4 -c clean') | ||
| 533 | # Check that buildclean task is run before clean for B == S | ||
| 534 | assertNoFile(tempdir_mdadm, 'mdadm') | ||
| 535 | # Check that buildclean task is not run before clean for B != S | ||
| 536 | assertFile(builddir_m4, 'src/m4') | ||
| 537 | finally: | ||
| 538 | self.delete_recipeinc('m4') | ||
| 539 | |||
| 494 | @testcase(1166) | 540 | @testcase(1166) |
| 495 | def test_devtool_modify_invalid(self): | 541 | def test_devtool_modify_invalid(self): |
| 496 | # Try modifying some recipes | 542 | # Try modifying some recipes |
