diff options
| author | Yeoh Ee Peng <ee.peng.yeoh@intel.com> | 2017-06-14 13:01:12 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-23 11:44:12 +0100 |
| commit | f822525c5830247e4ec8ea6be9aa36a97106cca8 (patch) | |
| tree | eef2a2f4c3c93c72db9fc446da08847a742889f9 | |
| parent | 97f01ae44677094e5e5083e33afaee1db07a2145 (diff) | |
| download | poky-f822525c5830247e4ec8ea6be9aa36a97106cca8.tar.gz | |
selftest/devtool: replace file assertTrue/False with assertExists/NotExists
Current osselftest print confusing assertion message when using
self.assertTrue(os.path.exists(filepath)) to test file path,
example of confusing assertion message:
AssertionError: False is not true
Replce assertTrue/assertFalse with assertExists/assertNotExists to test
file path, this will improve assertion message and simplify coding,
self.assertExists(filepath) will print below
AssertionError: <filepath> does not exist
[YOCTO #11356]
(From OE-Core rev: 08b0702492536d41d3cf2c9c05d1fab36d32a566)
Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.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/cases/devtool.py | 128 |
1 files changed, 63 insertions, 65 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 06ecf40473..e84202ba76 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
| @@ -204,7 +204,7 @@ class DevtoolTests(DevtoolBase): | |||
| 204 | self.add_command_to_tearDown('bitbake -c cleansstate pv') | 204 | self.add_command_to_tearDown('bitbake -c cleansstate pv') |
| 205 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 205 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 206 | result = runCmd('devtool add pv %s' % srcdir) | 206 | result = runCmd('devtool add pv %s' % srcdir) |
| 207 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') | 207 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') |
| 208 | # Test devtool status | 208 | # Test devtool status |
| 209 | result = runCmd('devtool status') | 209 | result = runCmd('devtool status') |
| 210 | self.assertIn('pv', result.output) | 210 | self.assertIn('pv', result.output) |
| @@ -242,7 +242,7 @@ class DevtoolTests(DevtoolBase): | |||
| 242 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 242 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 243 | # Don't specify a name since we should be able to auto-detect it | 243 | # Don't specify a name since we should be able to auto-detect it |
| 244 | result = runCmd('devtool add %s' % srcdir) | 244 | result = runCmd('devtool add %s' % srcdir) |
| 245 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') | 245 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') |
| 246 | # Check the recipe name is correct | 246 | # Check the recipe name is correct |
| 247 | recipefile = get_bb_var('FILE', pn) | 247 | recipefile = get_bb_var('FILE', pn) |
| 248 | self.assertIn('%s_git.bb' % pn, recipefile, 'Recipe file incorrectly named') | 248 | self.assertIn('%s_git.bb' % pn, recipefile, 'Recipe file incorrectly named') |
| @@ -277,7 +277,7 @@ class DevtoolTests(DevtoolBase): | |||
| 277 | self.track_for_cleanup(self.workspacedir) | 277 | self.track_for_cleanup(self.workspacedir) |
| 278 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 278 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 279 | result = runCmd('devtool add libftdi %s -V %s' % (srcdir, version)) | 279 | result = runCmd('devtool add libftdi %s -V %s' % (srcdir, version)) |
| 280 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') | 280 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') |
| 281 | # Test devtool status | 281 | # Test devtool status |
| 282 | result = runCmd('devtool status') | 282 | result = runCmd('devtool status') |
| 283 | self.assertIn('libftdi', result.output) | 283 | self.assertIn('libftdi', result.output) |
| @@ -325,7 +325,7 @@ class DevtoolTests(DevtoolBase): | |||
| 325 | self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe) | 325 | self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe) |
| 326 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 326 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 327 | result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url)) | 327 | result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url)) |
| 328 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created. %s' % result.output) | 328 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. %s' % result.output) |
| 329 | self.assertTrue(os.path.isfile(os.path.join(srcdir, 'setup.py')), 'Unable to find setup.py in source directory') | 329 | self.assertTrue(os.path.isfile(os.path.join(srcdir, 'setup.py')), 'Unable to find setup.py in source directory') |
| 330 | self.assertTrue(os.path.isdir(os.path.join(srcdir, '.git')), 'git repository for external source tree was not created') | 330 | self.assertTrue(os.path.isdir(os.path.join(srcdir, '.git')), 'git repository for external source tree was not created') |
| 331 | # Test devtool status | 331 | # Test devtool status |
| @@ -370,7 +370,7 @@ class DevtoolTests(DevtoolBase): | |||
| 370 | self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe) | 370 | self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe) |
| 371 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 371 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 372 | result = runCmd('devtool add %s %s -a -f %s' % (testrecipe, srcdir, url)) | 372 | result = runCmd('devtool add %s %s -a -f %s' % (testrecipe, srcdir, url)) |
| 373 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created: %s' % result.output) | 373 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created: %s' % result.output) |
| 374 | self.assertTrue(os.path.isfile(os.path.join(srcdir, 'imraa', 'imraa.c')), 'Unable to find imraa/imraa.c in source directory') | 374 | self.assertTrue(os.path.isfile(os.path.join(srcdir, 'imraa', 'imraa.c')), 'Unable to find imraa/imraa.c in source directory') |
| 375 | # Test devtool status | 375 | # Test devtool status |
| 376 | result = runCmd('devtool status') | 376 | result = runCmd('devtool status') |
| @@ -418,7 +418,7 @@ class DevtoolTests(DevtoolBase): | |||
| 418 | self.track_for_cleanup(self.workspacedir) | 418 | self.track_for_cleanup(self.workspacedir) |
| 419 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 419 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 420 | result = runCmd('devtool add %s' % url) | 420 | result = runCmd('devtool add %s' % url) |
| 421 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created. %s' % result.output) | 421 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. %s' % result.output) |
| 422 | self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure')), 'Unable to find configure script in source directory') | 422 | self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure')), 'Unable to find configure script in source directory') |
| 423 | self.assertTrue(os.path.isdir(os.path.join(srcdir, '.git')), 'git repository for external source tree was not created') | 423 | self.assertTrue(os.path.isdir(os.path.join(srcdir, '.git')), 'git repository for external source tree was not created') |
| 424 | # Test devtool status | 424 | # Test devtool status |
| @@ -443,8 +443,8 @@ class DevtoolTests(DevtoolBase): | |||
| 443 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 443 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 444 | self.add_command_to_tearDown('bitbake -c clean mdadm') | 444 | self.add_command_to_tearDown('bitbake -c clean mdadm') |
| 445 | result = runCmd('devtool modify mdadm -x %s' % tempdir) | 445 | result = runCmd('devtool modify mdadm -x %s' % tempdir) |
| 446 | self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found') | 446 | self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found') |
| 447 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') | 447 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') |
| 448 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'mdadm_*.bbappend')) | 448 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'mdadm_*.bbappend')) |
| 449 | self.assertTrue(matches, 'bbappend not created %s' % result.output) | 449 | self.assertTrue(matches, 'bbappend not created %s' % result.output) |
| 450 | 450 | ||
| @@ -494,10 +494,10 @@ class DevtoolTests(DevtoolBase): | |||
| 494 | def test_devtool_buildclean(self): | 494 | def test_devtool_buildclean(self): |
| 495 | def assertFile(path, *paths): | 495 | def assertFile(path, *paths): |
| 496 | f = os.path.join(path, *paths) | 496 | f = os.path.join(path, *paths) |
| 497 | self.assertTrue(os.path.exists(f), "%r does not exist" % f) | 497 | self.assertExists(f) |
| 498 | def assertNoFile(path, *paths): | 498 | def assertNoFile(path, *paths): |
| 499 | f = os.path.join(path, *paths) | 499 | f = os.path.join(path, *paths) |
| 500 | self.assertFalse(os.path.exists(os.path.join(f)), "%r exists" % f) | 500 | self.assertNotExists(f) |
| 501 | 501 | ||
| 502 | # Clean up anything in the workdir/sysroot/sstate cache | 502 | # Clean up anything in the workdir/sysroot/sstate cache |
| 503 | bitbake('mdadm m4 -c cleansstate') | 503 | bitbake('mdadm m4 -c cleansstate') |
| @@ -611,8 +611,8 @@ class DevtoolTests(DevtoolBase): | |||
| 611 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 611 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 612 | self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe) | 612 | self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe) |
| 613 | result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) | 613 | result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) |
| 614 | self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found') | 614 | self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found') |
| 615 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created. devtool output: %s' % result.output) | 615 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. devtool output: %s' % result.output) |
| 616 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'mkelfimage_*.bbappend')) | 616 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'mkelfimage_*.bbappend')) |
| 617 | self.assertTrue(matches, 'bbappend not created') | 617 | self.assertTrue(matches, 'bbappend not created') |
| 618 | # Test devtool status | 618 | # Test devtool status |
| @@ -644,8 +644,8 @@ class DevtoolTests(DevtoolBase): | |||
| 644 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 644 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 645 | self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe) | 645 | self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe) |
| 646 | result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) | 646 | result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) |
| 647 | self.assertTrue(os.path.exists(os.path.join(tempdir, 'configure.ac')), 'Extracted source could not be found') | 647 | self.assertExists(os.path.join(tempdir, 'configure.ac'), 'Extracted source could not be found') |
| 648 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') | 648 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') |
| 649 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe)) | 649 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe)) |
| 650 | self.assertTrue(matches, 'bbappend not created') | 650 | self.assertTrue(matches, 'bbappend not created') |
| 651 | # Test devtool status | 651 | # Test devtool status |
| @@ -665,8 +665,8 @@ class DevtoolTests(DevtoolBase): | |||
| 665 | self.track_for_cleanup(self.workspacedir) | 665 | self.track_for_cleanup(self.workspacedir) |
| 666 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 666 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 667 | result = runCmd('devtool modify %s -x %s' % (virtrecipe, tempdir)) | 667 | result = runCmd('devtool modify %s -x %s' % (virtrecipe, tempdir)) |
| 668 | self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found') | 668 | self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found') |
| 669 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') | 669 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') |
| 670 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % realrecipe)) | 670 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % realrecipe)) |
| 671 | self.assertTrue(matches, 'bbappend not created %s' % result.output) | 671 | self.assertTrue(matches, 'bbappend not created %s' % result.output) |
| 672 | # Test devtool status | 672 | # Test devtool status |
| @@ -817,7 +817,7 @@ class DevtoolTests(DevtoolBase): | |||
| 817 | appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1]) | 817 | appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1]) |
| 818 | bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir) | 818 | bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir) |
| 819 | patchfile = os.path.join(appenddir, testrecipe, '0001-Add-our-custom-version.patch') | 819 | patchfile = os.path.join(appenddir, testrecipe, '0001-Add-our-custom-version.patch') |
| 820 | self.assertTrue(os.path.exists(patchfile), 'Patch file not created') | 820 | self.assertExists(patchfile, 'Patch file not created') |
| 821 | 821 | ||
| 822 | # Check bbappend contents | 822 | # Check bbappend contents |
| 823 | expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', | 823 | expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', |
| @@ -834,7 +834,7 @@ class DevtoolTests(DevtoolBase): | |||
| 834 | # Drop new commit and check patch gets deleted | 834 | # Drop new commit and check patch gets deleted |
| 835 | result = runCmd('git reset HEAD^', cwd=tempsrcdir) | 835 | result = runCmd('git reset HEAD^', cwd=tempsrcdir) |
| 836 | result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir)) | 836 | result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir)) |
| 837 | self.assertFalse(os.path.exists(patchfile), 'Patch file not deleted') | 837 | self.assertNotExists(patchfile, 'Patch file not deleted') |
| 838 | expectedlines2 = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', | 838 | expectedlines2 = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n', |
| 839 | '\n'] | 839 | '\n'] |
| 840 | with open(bbappendfile, 'r') as f: | 840 | with open(bbappendfile, 'r') as f: |
| @@ -845,7 +845,7 @@ class DevtoolTests(DevtoolBase): | |||
| 845 | result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir) | 845 | result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir) |
| 846 | result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir)) | 846 | result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir)) |
| 847 | self.assertIn('WARNING: Specified layer is not currently enabled in bblayers.conf', result.output) | 847 | self.assertIn('WARNING: Specified layer is not currently enabled in bblayers.conf', result.output) |
| 848 | self.assertTrue(os.path.exists(patchfile), 'Patch file not created (with disabled layer)') | 848 | self.assertExists(patchfile, 'Patch file not created (with disabled layer)') |
| 849 | with open(bbappendfile, 'r') as f: | 849 | with open(bbappendfile, 'r') as f: |
| 850 | self.assertEqual(expectedlines, f.readlines()) | 850 | self.assertEqual(expectedlines, f.readlines()) |
| 851 | # Deleting isn't expected to work under these circumstances | 851 | # Deleting isn't expected to work under these circumstances |
| @@ -898,7 +898,7 @@ class DevtoolTests(DevtoolBase): | |||
| 898 | splitpath = os.path.dirname(recipefile).split(os.sep) | 898 | splitpath = os.path.dirname(recipefile).split(os.sep) |
| 899 | appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1]) | 899 | appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1]) |
| 900 | bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir) | 900 | bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir) |
| 901 | self.assertFalse(os.path.exists(os.path.join(appenddir, testrecipe)), 'Patch directory should not be created') | 901 | self.assertNotExists(os.path.join(appenddir, testrecipe), 'Patch directory should not be created') |
| 902 | 902 | ||
| 903 | # Check bbappend contents | 903 | # Check bbappend contents |
| 904 | result = runCmd('git rev-parse HEAD', cwd=tempsrcdir) | 904 | result = runCmd('git rev-parse HEAD', cwd=tempsrcdir) |
| @@ -916,7 +916,7 @@ class DevtoolTests(DevtoolBase): | |||
| 916 | # Drop new commit and check SRCREV changes | 916 | # Drop new commit and check SRCREV changes |
| 917 | result = runCmd('git reset HEAD^', cwd=tempsrcdir) | 917 | result = runCmd('git reset HEAD^', cwd=tempsrcdir) |
| 918 | result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir)) | 918 | result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir)) |
| 919 | self.assertFalse(os.path.exists(os.path.join(appenddir, testrecipe)), 'Patch directory should not be created') | 919 | self.assertNotExists(os.path.join(appenddir, testrecipe), 'Patch directory should not be created') |
| 920 | result = runCmd('git rev-parse HEAD', cwd=tempsrcdir) | 920 | result = runCmd('git rev-parse HEAD', cwd=tempsrcdir) |
| 921 | expectedlines = set(['SRCREV = "%s"\n' % result.output, | 921 | expectedlines = set(['SRCREV = "%s"\n' % result.output, |
| 922 | '\n', | 922 | '\n', |
| @@ -930,7 +930,7 @@ class DevtoolTests(DevtoolBase): | |||
| 930 | result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir) | 930 | result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir) |
| 931 | result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir)) | 931 | result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir)) |
| 932 | self.assertIn('WARNING: Specified layer is not currently enabled in bblayers.conf', result.output) | 932 | self.assertIn('WARNING: Specified layer is not currently enabled in bblayers.conf', result.output) |
| 933 | self.assertFalse(os.path.exists(os.path.join(appenddir, testrecipe)), 'Patch directory should not be created') | 933 | self.assertNotExists(os.path.join(appenddir, testrecipe), 'Patch directory should not be created') |
| 934 | result = runCmd('git rev-parse HEAD', cwd=tempsrcdir) | 934 | result = runCmd('git rev-parse HEAD', cwd=tempsrcdir) |
| 935 | expectedlines = set(['SRCREV = "%s"\n' % result.output, | 935 | expectedlines = set(['SRCREV = "%s"\n' % result.output, |
| 936 | '\n', | 936 | '\n', |
| @@ -1075,7 +1075,7 @@ class DevtoolTests(DevtoolBase): | |||
| 1075 | # (don't bother with cleaning the recipe on teardown, we won't be building it) | 1075 | # (don't bother with cleaning the recipe on teardown, we won't be building it) |
| 1076 | result = runCmd('devtool modify %s' % testrecipe) | 1076 | result = runCmd('devtool modify %s' % testrecipe) |
| 1077 | testfile = os.path.join(self.workspacedir, 'sources', testrecipe, 'testfile') | 1077 | testfile = os.path.join(self.workspacedir, 'sources', testrecipe, 'testfile') |
| 1078 | self.assertTrue(os.path.exists(testfile), 'Extracted source could not be found') | 1078 | self.assertExists(testfile, 'Extracted source could not be found') |
| 1079 | with open(testfile, 'r') as f: | 1079 | with open(testfile, 'r') as f: |
| 1080 | contents = f.read().rstrip() | 1080 | contents = f.read().rstrip() |
| 1081 | self.assertEqual(contents, 'Modified version', 'File has apparently not been overwritten as it should have been') | 1081 | self.assertEqual(contents, 'Modified version', 'File has apparently not been overwritten as it should have been') |
| @@ -1092,9 +1092,9 @@ class DevtoolTests(DevtoolBase): | |||
| 1092 | self.track_for_cleanup(tempdir) | 1092 | self.track_for_cleanup(tempdir) |
| 1093 | self.append_config('PREFERRED_PROVIDER_virtual/make = "remake"') | 1093 | self.append_config('PREFERRED_PROVIDER_virtual/make = "remake"') |
| 1094 | result = runCmd('devtool extract remake %s' % tempdir) | 1094 | result = runCmd('devtool extract remake %s' % tempdir) |
| 1095 | self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found') | 1095 | self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found') |
| 1096 | # devtool extract shouldn't create the workspace | 1096 | # devtool extract shouldn't create the workspace |
| 1097 | self.assertFalse(os.path.exists(self.workspacedir)) | 1097 | self.assertNotExists(self.workspacedir) |
| 1098 | self._check_src_repo(tempdir) | 1098 | self._check_src_repo(tempdir) |
| 1099 | 1099 | ||
| 1100 | @OETestID(1379) | 1100 | @OETestID(1379) |
| @@ -1103,9 +1103,9 @@ class DevtoolTests(DevtoolBase): | |||
| 1103 | # Try devtool extract | 1103 | # Try devtool extract |
| 1104 | self.track_for_cleanup(tempdir) | 1104 | self.track_for_cleanup(tempdir) |
| 1105 | result = runCmd('devtool extract virtual/make %s' % tempdir) | 1105 | result = runCmd('devtool extract virtual/make %s' % tempdir) |
| 1106 | self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found') | 1106 | self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found') |
| 1107 | # devtool extract shouldn't create the workspace | 1107 | # devtool extract shouldn't create the workspace |
| 1108 | self.assertFalse(os.path.exists(self.workspacedir)) | 1108 | self.assertNotExists(self.workspacedir) |
| 1109 | self._check_src_repo(tempdir) | 1109 | self._check_src_repo(tempdir) |
| 1110 | 1110 | ||
| 1111 | @OETestID(1168) | 1111 | @OETestID(1168) |
| @@ -1280,10 +1280,10 @@ class DevtoolTests(DevtoolBase): | |||
| 1280 | # Check if srctree at least is populated | 1280 | # Check if srctree at least is populated |
| 1281 | self.assertTrue(len(os.listdir(tempdir)) > 0, 'srctree (%s) should be populated with new (%s) source code' % (tempdir, version)) | 1281 | self.assertTrue(len(os.listdir(tempdir)) > 0, 'srctree (%s) should be populated with new (%s) source code' % (tempdir, version)) |
| 1282 | # Check new recipe subdirectory is present | 1282 | # Check new recipe subdirectory is present |
| 1283 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe, '%s-%s' % (recipe, version))), 'Recipe folder should exist') | 1283 | self.assertExists(os.path.join(self.workspacedir, 'recipes', recipe, '%s-%s' % (recipe, version)), 'Recipe folder should exist') |
| 1284 | # Check new recipe file is present | 1284 | # Check new recipe file is present |
| 1285 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version)) | 1285 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version)) |
| 1286 | self.assertTrue(os.path.exists(newrecipefile), 'Recipe file should exist after upgrade') | 1286 | self.assertExists(newrecipefile, 'Recipe file should exist after upgrade') |
| 1287 | # Check devtool status and make sure recipe is present | 1287 | # Check devtool status and make sure recipe is present |
| 1288 | result = runCmd('devtool status') | 1288 | result = runCmd('devtool status') |
| 1289 | self.assertIn(recipe, result.output) | 1289 | self.assertIn(recipe, result.output) |
| @@ -1298,7 +1298,7 @@ class DevtoolTests(DevtoolBase): | |||
| 1298 | result = runCmd('devtool reset %s -n' % recipe) | 1298 | result = runCmd('devtool reset %s -n' % recipe) |
| 1299 | result = runCmd('devtool status') | 1299 | result = runCmd('devtool status') |
| 1300 | self.assertNotIn(recipe, result.output) | 1300 | self.assertNotIn(recipe, result.output) |
| 1301 | self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting') | 1301 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting') |
| 1302 | 1302 | ||
| 1303 | @OETestID(1433) | 1303 | @OETestID(1433) |
| 1304 | def test_devtool_upgrade_git(self): | 1304 | def test_devtool_upgrade_git(self): |
| @@ -1320,7 +1320,7 @@ class DevtoolTests(DevtoolBase): | |||
| 1320 | self.assertTrue(len(os.listdir(tempdir)) > 0, 'srctree (%s) should be populated with new (%s) source code' % (tempdir, commit)) | 1320 | self.assertTrue(len(os.listdir(tempdir)) > 0, 'srctree (%s) should be populated with new (%s) source code' % (tempdir, commit)) |
| 1321 | # Check new recipe file is present | 1321 | # Check new recipe file is present |
| 1322 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, os.path.basename(oldrecipefile)) | 1322 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, os.path.basename(oldrecipefile)) |
| 1323 | self.assertTrue(os.path.exists(newrecipefile), 'Recipe file should exist after upgrade') | 1323 | self.assertExists(newrecipefile, 'Recipe file should exist after upgrade') |
| 1324 | # Check devtool status and make sure recipe is present | 1324 | # Check devtool status and make sure recipe is present |
| 1325 | result = runCmd('devtool status') | 1325 | result = runCmd('devtool status') |
| 1326 | self.assertIn(recipe, result.output) | 1326 | self.assertIn(recipe, result.output) |
| @@ -1335,7 +1335,7 @@ class DevtoolTests(DevtoolBase): | |||
| 1335 | result = runCmd('devtool reset %s -n' % recipe) | 1335 | result = runCmd('devtool reset %s -n' % recipe) |
| 1336 | result = runCmd('devtool status') | 1336 | result = runCmd('devtool status') |
| 1337 | self.assertNotIn(recipe, result.output) | 1337 | self.assertNotIn(recipe, result.output) |
| 1338 | self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting') | 1338 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting') |
| 1339 | 1339 | ||
| 1340 | @OETestID(1352) | 1340 | @OETestID(1352) |
| 1341 | def test_devtool_layer_plugins(self): | 1341 | def test_devtool_layer_plugins(self): |
| @@ -1352,7 +1352,7 @@ class DevtoolTests(DevtoolBase): | |||
| 1352 | 1352 | ||
| 1353 | def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths): | 1353 | def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths): |
| 1354 | dstdir = basedstdir | 1354 | dstdir = basedstdir |
| 1355 | self.assertTrue(os.path.exists(dstdir)) | 1355 | self.assertExists(dstdir) |
| 1356 | for p in paths: | 1356 | for p in paths: |
| 1357 | dstdir = os.path.join(dstdir, p) | 1357 | dstdir = os.path.join(dstdir, p) |
| 1358 | if not os.path.exists(dstdir): | 1358 | if not os.path.exists(dstdir): |
| @@ -1427,7 +1427,7 @@ class DevtoolTests(DevtoolBase): | |||
| 1427 | recipedir = os.path.dirname(oldrecipefile) | 1427 | recipedir = os.path.dirname(oldrecipefile) |
| 1428 | olddir = os.path.join(recipedir, recipe + '-' + oldversion) | 1428 | olddir = os.path.join(recipedir, recipe + '-' + oldversion) |
| 1429 | patchfn = '0001-Add-a-note-line-to-the-quick-reference.patch' | 1429 | patchfn = '0001-Add-a-note-line-to-the-quick-reference.patch' |
| 1430 | self.assertTrue(os.path.exists(os.path.join(olddir, patchfn)), 'Original patch file does not exist') | 1430 | self.assertExists(os.path.join(olddir, patchfn), 'Original patch file does not exist') |
| 1431 | return recipe, oldrecipefile, recipedir, olddir, newversion, patchfn | 1431 | return recipe, oldrecipefile, recipedir, olddir, newversion, patchfn |
| 1432 | 1432 | ||
| 1433 | def test_devtool_finish_upgrade_origlayer(self): | 1433 | def test_devtool_finish_upgrade_origlayer(self): |
| @@ -1439,14 +1439,14 @@ class DevtoolTests(DevtoolBase): | |||
| 1439 | result = runCmd('devtool finish %s meta-selftest' % recipe) | 1439 | result = runCmd('devtool finish %s meta-selftest' % recipe) |
| 1440 | result = runCmd('devtool status') | 1440 | result = runCmd('devtool status') |
| 1441 | self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t') | 1441 | self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t') |
| 1442 | self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after finish') | 1442 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after finish') |
| 1443 | self.assertFalse(os.path.exists(oldrecipefile), 'Old recipe file should have been deleted but wasn\'t') | 1443 | self.assertNotExists(oldrecipefile, 'Old recipe file should have been deleted but wasn\'t') |
| 1444 | self.assertFalse(os.path.exists(os.path.join(olddir, patchfn)), 'Old patch file should have been deleted but wasn\'t') | 1444 | self.assertNotExists(os.path.join(olddir, patchfn), 'Old patch file should have been deleted but wasn\'t') |
| 1445 | newrecipefile = os.path.join(recipedir, '%s_%s.bb' % (recipe, newversion)) | 1445 | newrecipefile = os.path.join(recipedir, '%s_%s.bb' % (recipe, newversion)) |
| 1446 | newdir = os.path.join(recipedir, recipe + '-' + newversion) | 1446 | newdir = os.path.join(recipedir, recipe + '-' + newversion) |
| 1447 | self.assertTrue(os.path.exists(newrecipefile), 'New recipe file should have been copied into existing layer but wasn\'t') | 1447 | self.assertExists(newrecipefile, 'New recipe file should have been copied into existing layer but wasn\'t') |
| 1448 | self.assertTrue(os.path.exists(os.path.join(newdir, patchfn)), 'Patch file should have been copied into new directory but wasn\'t') | 1448 | self.assertExists(os.path.join(newdir, patchfn), 'Patch file should have been copied into new directory but wasn\'t') |
| 1449 | self.assertTrue(os.path.exists(os.path.join(newdir, '0002-Add-a-comment-to-the-code.patch')), 'New patch file should have been created but wasn\'t') | 1449 | self.assertExists(os.path.join(newdir, '0002-Add-a-comment-to-the-code.patch'), 'New patch file should have been created but wasn\'t') |
| 1450 | 1450 | ||
| 1451 | def test_devtool_finish_upgrade_otherlayer(self): | 1451 | def test_devtool_finish_upgrade_otherlayer(self): |
| 1452 | recipe, oldrecipefile, recipedir, olddir, newversion, patchfn = self._setup_test_devtool_finish_upgrade() | 1452 | recipe, oldrecipefile, recipedir, olddir, newversion, patchfn = self._setup_test_devtool_finish_upgrade() |
| @@ -1462,13 +1462,13 @@ class DevtoolTests(DevtoolBase): | |||
| 1462 | result = runCmd('devtool finish %s oe-core' % recipe) | 1462 | result = runCmd('devtool finish %s oe-core' % recipe) |
| 1463 | result = runCmd('devtool status') | 1463 | result = runCmd('devtool status') |
| 1464 | self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t') | 1464 | self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t') |
| 1465 | self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after finish') | 1465 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after finish') |
| 1466 | self.assertTrue(os.path.exists(oldrecipefile), 'Old recipe file should not have been deleted') | 1466 | self.assertExists(oldrecipefile, 'Old recipe file should not have been deleted') |
| 1467 | self.assertTrue(os.path.exists(os.path.join(olddir, patchfn)), 'Old patch file should not have been deleted') | 1467 | self.assertExists(os.path.join(olddir, patchfn), 'Old patch file should not have been deleted') |
| 1468 | newdir = os.path.join(newrecipedir, recipe + '-' + newversion) | 1468 | newdir = os.path.join(newrecipedir, recipe + '-' + newversion) |
| 1469 | self.assertTrue(os.path.exists(newrecipefile), 'New recipe file should have been copied into existing layer but wasn\'t') | 1469 | self.assertExists(newrecipefile, 'New recipe file should have been copied into existing layer but wasn\'t') |
| 1470 | self.assertTrue(os.path.exists(os.path.join(newdir, patchfn)), 'Patch file should have been copied into new directory but wasn\'t') | 1470 | self.assertExists(os.path.join(newdir, patchfn), 'Patch file should have been copied into new directory but wasn\'t') |
| 1471 | self.assertTrue(os.path.exists(os.path.join(newdir, '0002-Add-a-comment-to-the-code.patch')), 'New patch file should have been created but wasn\'t') | 1471 | self.assertExists(os.path.join(newdir, '0002-Add-a-comment-to-the-code.patch'), 'New patch file should have been created but wasn\'t') |
| 1472 | 1472 | ||
| 1473 | def _setup_test_devtool_finish_modify(self): | 1473 | def _setup_test_devtool_finish_modify(self): |
| 1474 | # Check preconditions | 1474 | # Check preconditions |
| @@ -1485,7 +1485,7 @@ class DevtoolTests(DevtoolBase): | |||
| 1485 | self.track_for_cleanup(tempdir) | 1485 | self.track_for_cleanup(tempdir) |
| 1486 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 1486 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
| 1487 | result = runCmd('devtool modify %s %s' % (recipe, tempdir)) | 1487 | result = runCmd('devtool modify %s %s' % (recipe, tempdir)) |
| 1488 | self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found') | 1488 | self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found') |
| 1489 | # Test devtool status | 1489 | # Test devtool status |
| 1490 | result = runCmd('devtool status') | 1490 | result = runCmd('devtool status') |
| 1491 | self.assertIn(recipe, result.output) | 1491 | self.assertIn(recipe, result.output) |
| @@ -1512,7 +1512,7 @@ class DevtoolTests(DevtoolBase): | |||
| 1512 | result = runCmd('devtool finish %s meta' % recipe) | 1512 | result = runCmd('devtool finish %s meta' % recipe) |
| 1513 | result = runCmd('devtool status') | 1513 | result = runCmd('devtool status') |
| 1514 | self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t') | 1514 | self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t') |
| 1515 | self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after finish') | 1515 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after finish') |
| 1516 | expected_status = [(' M', '.*/%s$' % os.path.basename(oldrecipefile)), | 1516 | expected_status = [(' M', '.*/%s$' % os.path.basename(oldrecipefile)), |
| 1517 | ('??', '.*/.*-Add-a-comment-to-the-code.patch$')] | 1517 | ('??', '.*/.*-Add-a-comment-to-the-code.patch$')] |
| 1518 | self._check_repo_status(recipedir, expected_status) | 1518 | self._check_repo_status(recipedir, expected_status) |
| @@ -1529,14 +1529,14 @@ class DevtoolTests(DevtoolBase): | |||
| 1529 | result = runCmd('devtool finish %s meta-selftest' % recipe) | 1529 | result = runCmd('devtool finish %s meta-selftest' % recipe) |
| 1530 | result = runCmd('devtool status') | 1530 | result = runCmd('devtool status') |
| 1531 | self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t') | 1531 | self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t') |
| 1532 | self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after finish') | 1532 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after finish') |
| 1533 | result = runCmd('git status --porcelain .', cwd=recipedir) | 1533 | result = runCmd('git status --porcelain .', cwd=recipedir) |
| 1534 | if result.output.strip(): | 1534 | if result.output.strip(): |
| 1535 | self.fail('Recipe directory for %s contains the following unexpected changes after finish:\n%s' % (recipe, result.output.strip())) | 1535 | self.fail('Recipe directory for %s contains the following unexpected changes after finish:\n%s' % (recipe, result.output.strip())) |
| 1536 | recipefn = os.path.splitext(os.path.basename(oldrecipefile))[0] | 1536 | recipefn = os.path.splitext(os.path.basename(oldrecipefile))[0] |
| 1537 | recipefn = recipefn.split('_')[0] + '_%' | 1537 | recipefn = recipefn.split('_')[0] + '_%' |
| 1538 | appendfile = os.path.join(appenddir, recipefn + '.bbappend') | 1538 | appendfile = os.path.join(appenddir, recipefn + '.bbappend') |
| 1539 | self.assertTrue(os.path.exists(appendfile), 'bbappend %s should have been created but wasn\'t' % appendfile) | 1539 | self.assertExists(appendfile, 'bbappend %s should have been created but wasn\'t' % appendfile) |
| 1540 | newdir = os.path.join(appenddir, recipe) | 1540 | newdir = os.path.join(appenddir, recipe) |
| 1541 | files = os.listdir(newdir) | 1541 | files = os.listdir(newdir) |
| 1542 | foundpatch = None | 1542 | foundpatch = None |
| @@ -1563,8 +1563,8 @@ class DevtoolTests(DevtoolBase): | |||
| 1563 | url = 'http://downloads.yoctoproject.org/mirror/sources/i2c-tools-%s.tar.bz2' % recipever | 1563 | url = 'http://downloads.yoctoproject.org/mirror/sources/i2c-tools-%s.tar.bz2' % recipever |
| 1564 | def add_recipe(): | 1564 | def add_recipe(): |
| 1565 | result = runCmd('devtool add %s' % url) | 1565 | result = runCmd('devtool add %s' % url) |
| 1566 | self.assertTrue(os.path.exists(recipefile), 'Expected recipe file not created') | 1566 | self.assertExists(recipefile, 'Expected recipe file not created') |
| 1567 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'sources', recipename)), 'Source directory not created') | 1567 | self.assertExists(os.path.join(self.workspacedir, 'sources', recipename), 'Source directory not created') |
| 1568 | checkvars = {} | 1568 | checkvars = {} |
| 1569 | checkvars['S'] = None | 1569 | checkvars['S'] = None |
| 1570 | checkvars['SRC_URI'] = url.replace(recipever, '${PV}') | 1570 | checkvars['SRC_URI'] = url.replace(recipever, '${PV}') |
| @@ -1575,10 +1575,10 @@ class DevtoolTests(DevtoolBase): | |||
| 1575 | newrecipever = '456' | 1575 | newrecipever = '456' |
| 1576 | newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, newrecipever)) | 1576 | newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, newrecipever)) |
| 1577 | result = runCmd('devtool rename %s %s -V %s' % (recipename, newrecipename, newrecipever)) | 1577 | result = runCmd('devtool rename %s %s -V %s' % (recipename, newrecipename, newrecipever)) |
| 1578 | self.assertTrue(os.path.exists(newrecipefile), 'Recipe file not renamed') | 1578 | self.assertExists(newrecipefile, 'Recipe file not renamed') |
| 1579 | self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipename)), 'Old recipe directory still exists') | 1579 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipename), 'Old recipe directory still exists') |
| 1580 | newsrctree = os.path.join(self.workspacedir, 'sources', newrecipename) | 1580 | newsrctree = os.path.join(self.workspacedir, 'sources', newrecipename) |
| 1581 | self.assertTrue(os.path.exists(newsrctree), 'Source directory not renamed') | 1581 | self.assertExists(newsrctree, 'Source directory not renamed') |
| 1582 | checkvars = {} | 1582 | checkvars = {} |
| 1583 | checkvars['S'] = '${WORKDIR}/%s-%s' % (recipename, recipever) | 1583 | checkvars['S'] = '${WORKDIR}/%s-%s' % (recipename, recipever) |
| 1584 | checkvars['SRC_URI'] = url | 1584 | checkvars['SRC_URI'] = url |
| @@ -1589,9 +1589,9 @@ class DevtoolTests(DevtoolBase): | |||
| 1589 | add_recipe() | 1589 | add_recipe() |
| 1590 | newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, recipever)) | 1590 | newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, recipever)) |
| 1591 | result = runCmd('devtool rename %s %s' % (recipename, newrecipename)) | 1591 | result = runCmd('devtool rename %s %s' % (recipename, newrecipename)) |
| 1592 | self.assertTrue(os.path.exists(newrecipefile), 'Recipe file not renamed') | 1592 | self.assertExists(newrecipefile, 'Recipe file not renamed') |
| 1593 | self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipename)), 'Old recipe directory still exists') | 1593 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipename), 'Old recipe directory still exists') |
| 1594 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'sources', newrecipename)), 'Source directory not renamed') | 1594 | self.assertExists(os.path.join(self.workspacedir, 'sources', newrecipename), 'Source directory not renamed') |
| 1595 | checkvars = {} | 1595 | checkvars = {} |
| 1596 | checkvars['S'] = '${WORKDIR}/%s-${PV}' % recipename | 1596 | checkvars['S'] = '${WORKDIR}/%s-${PV}' % recipename |
| 1597 | checkvars['SRC_URI'] = url.replace(recipever, '${PV}') | 1597 | checkvars['SRC_URI'] = url.replace(recipever, '${PV}') |
| @@ -1602,8 +1602,8 @@ class DevtoolTests(DevtoolBase): | |||
| 1602 | add_recipe() | 1602 | add_recipe() |
| 1603 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipename, '%s_%s.bb' % (recipename, newrecipever)) | 1603 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipename, '%s_%s.bb' % (recipename, newrecipever)) |
| 1604 | result = runCmd('devtool rename %s -V %s' % (recipename, newrecipever)) | 1604 | result = runCmd('devtool rename %s -V %s' % (recipename, newrecipever)) |
| 1605 | self.assertTrue(os.path.exists(newrecipefile), 'Recipe file not renamed') | 1605 | self.assertExists(newrecipefile, 'Recipe file not renamed') |
| 1606 | self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'sources', recipename)), 'Source directory no longer exists') | 1606 | self.assertExists(os.path.join(self.workspacedir, 'sources', recipename), 'Source directory no longer exists') |
| 1607 | checkvars = {} | 1607 | checkvars = {} |
| 1608 | checkvars['S'] = '${WORKDIR}/${BPN}-%s' % recipever | 1608 | checkvars['S'] = '${WORKDIR}/${BPN}-%s' % recipever |
| 1609 | checkvars['SRC_URI'] = url | 1609 | checkvars['SRC_URI'] = url |
| @@ -1648,16 +1648,14 @@ class DevtoolTests(DevtoolBase): | |||
| 1648 | buildir= get_bb_var('TOPDIR') | 1648 | buildir= get_bb_var('TOPDIR') |
| 1649 | #Step 2 | 1649 | #Step 2 |
| 1650 | runCmd('cp %s %s' % (bbconfig, buildir)) | 1650 | runCmd('cp %s %s' % (bbconfig, buildir)) |
| 1651 | self.assertTrue(os.path.exists(os.path.join(buildir, '.config')), | 1651 | self.assertExists(os.path.join(buildir, '.config'), 'Could not copy .config file from kernel') |
| 1652 | 'Could not copy .config file from kernel') | ||
| 1653 | 1652 | ||
| 1654 | tmpconfig = os.path.join(buildir, '.config') | 1653 | tmpconfig = os.path.join(buildir, '.config') |
| 1655 | #Step 3 | 1654 | #Step 3 |
| 1656 | bitbake('%s -c clean' % kernel_provider) | 1655 | bitbake('%s -c clean' % kernel_provider) |
| 1657 | #Step 4.1 | 1656 | #Step 4.1 |
| 1658 | runCmd('devtool modify virtual/kernel -x %s' % tempdir) | 1657 | runCmd('devtool modify virtual/kernel -x %s' % tempdir) |
| 1659 | self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), | 1658 | self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found') |
| 1660 | 'Extracted source could not be found') | ||
| 1661 | #Step 4.2 | 1659 | #Step 4.2 |
| 1662 | configfile = os.path.join(tempdir,'.config') | 1660 | configfile = os.path.join(tempdir,'.config') |
| 1663 | diff = runCmd('diff %s %s' % (tmpconfig, configfile)) | 1661 | diff = runCmd('diff %s %s' % (tmpconfig, configfile)) |
| @@ -1667,7 +1665,7 @@ class DevtoolTests(DevtoolBase): | |||
| 1667 | result = runCmd('devtool build %s' % kernel_provider) | 1665 | result = runCmd('devtool build %s' % kernel_provider) |
| 1668 | self.assertEqual(0,result.status,'Cannot build kernel using `devtool build`') | 1666 | self.assertEqual(0,result.status,'Cannot build kernel using `devtool build`') |
| 1669 | kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT', kernel_provider), 'vmlinux') | 1667 | kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT', kernel_provider), 'vmlinux') |
| 1670 | self.assertTrue(os.path.exists(kernelfile),'Kernel was not build correctly') | 1668 | self.assertExists(kernelfile, 'Kernel was not build correctly') |
| 1671 | 1669 | ||
| 1672 | #Modify the kernel source | 1670 | #Modify the kernel source |
| 1673 | modfile = os.path.join(tempdir,'arch/x86/boot/header.S') | 1671 | modfile = os.path.join(tempdir,'arch/x86/boot/header.S') |
