diff options
author | Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> | 2021-01-23 16:15:10 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-27 10:17:45 +0000 |
commit | 9fa87066bb36ad895ac78b3d40564f83aa7f0d73 (patch) | |
tree | 3c38f8550b435971aa6ad971aba0dbfcdf7ff0ef | |
parent | 065a23550eb845c378a65be5a7fd5f840fe4e448 (diff) | |
download | poky-9fa87066bb36ad895ac78b3d40564f83aa7f0d73.tar.gz |
selftest/devtool: Add modify_localfiles_only test checking symlink path
If recipe uses only file:// fetcher devtool unpacks sources under
oe-local-files/ and adds symlink in source root directory. We need to
verify if the symlink in subdirectory has correct path.
See [YOCTO #13738] for details.
(From OE-Core rev: 044c90d152bfd1b2a23272df39327ba4cd862dff)
Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 4eba23890f..3385546e8e 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -697,7 +697,44 @@ class DevtoolModifyTests(DevtoolBase): | |||
697 | 697 | ||
698 | self.assertTrue(bbclassextended, 'None of these recipes are BBCLASSEXTENDed to native - need to adjust testrecipes list: %s' % ', '.join(testrecipes)) | 698 | self.assertTrue(bbclassextended, 'None of these recipes are BBCLASSEXTENDed to native - need to adjust testrecipes list: %s' % ', '.join(testrecipes)) |
699 | self.assertTrue(inheritnative, 'None of these recipes do "inherit native" - need to adjust testrecipes list: %s' % ', '.join(testrecipes)) | 699 | self.assertTrue(inheritnative, 'None of these recipes do "inherit native" - need to adjust testrecipes list: %s' % ', '.join(testrecipes)) |
700 | def test_devtool_modify_localfiles_only(self): | ||
701 | # Check preconditions | ||
702 | testrecipe = 'base-files' | ||
703 | src_uri = (get_bb_var('SRC_URI', testrecipe) or '').split() | ||
704 | foundlocalonly = False | ||
705 | correct_symlink = False | ||
706 | for item in src_uri: | ||
707 | if item.startswith('file://'): | ||
708 | if '.patch' not in item: | ||
709 | foundlocalonly = True | ||
710 | else: | ||
711 | foundlocalonly = False | ||
712 | break | ||
713 | self.assertTrue(foundlocalonly, 'This test expects the %s recipe to fetch local files only and it seems that it no longer does' % testrecipe) | ||
714 | # Clean up anything in the workdir/sysroot/sstate cache | ||
715 | bitbake('%s -c cleansstate' % testrecipe) | ||
716 | # Try modifying a recipe | ||
717 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
718 | self.track_for_cleanup(tempdir) | ||
719 | self.track_for_cleanup(self.workspacedir) | ||
720 | self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe) | ||
721 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
722 | result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) | ||
723 | srcfile = os.path.join(tempdir, 'oe-local-files/share/dot.bashrc') | ||
724 | srclink = os.path.join(tempdir, 'share/dot.bashrc') | ||
725 | self.assertExists(srcfile, 'Extracted source could not be found') | ||
726 | if os.path.islink(srclink) and os.path.exists(srclink) and os.path.samefile(srcfile, srclink): | ||
727 | correct_symlink = True | ||
728 | self.assertTrue(correct_symlink, 'Source symlink to oe-local-files is broken') | ||
700 | 729 | ||
730 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe)) | ||
731 | self.assertTrue(matches, 'bbappend not created') | ||
732 | # Test devtool status | ||
733 | result = runCmd('devtool status') | ||
734 | self.assertIn(testrecipe, result.output) | ||
735 | self.assertIn(tempdir, result.output) | ||
736 | # Try building | ||
737 | bitbake(testrecipe) | ||
701 | 738 | ||
702 | def test_devtool_modify_git(self): | 739 | def test_devtool_modify_git(self): |
703 | # Check preconditions | 740 | # Check preconditions |