diff options
author | Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> | 2021-01-23 16:15:10 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-05 23:37:04 +0000 |
commit | 48097ee02feb8c97cb736b9b6938ce6e0378a27b (patch) | |
tree | c99cfa3d47fb2597116ce502126add26a9104e83 /meta/lib/oeqa | |
parent | 05aaa63c9d8c9e6e821e1454956db5fb98aad3fc (diff) | |
download | poky-48097ee02feb8c97cb736b9b6938ce6e0378a27b.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: d9d8a04c9564b2801a1f613ffb6471de3cabdb03)
Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 044c90d152bfd1b2a23272df39327ba4cd862dff)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-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 ddf46547de..0985434238 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -693,7 +693,44 @@ class DevtoolModifyTests(DevtoolBase): | |||
693 | 693 | ||
694 | self.assertTrue(bbclassextended, 'None of these recipes are BBCLASSEXTENDed to native - need to adjust testrecipes list: %s' % ', '.join(testrecipes)) | 694 | self.assertTrue(bbclassextended, 'None of these recipes are BBCLASSEXTENDed to native - need to adjust testrecipes list: %s' % ', '.join(testrecipes)) |
695 | self.assertTrue(inheritnative, 'None of these recipes do "inherit native" - need to adjust testrecipes list: %s' % ', '.join(testrecipes)) | 695 | self.assertTrue(inheritnative, 'None of these recipes do "inherit native" - need to adjust testrecipes list: %s' % ', '.join(testrecipes)) |
696 | def test_devtool_modify_localfiles_only(self): | ||
697 | # Check preconditions | ||
698 | testrecipe = 'base-files' | ||
699 | src_uri = (get_bb_var('SRC_URI', testrecipe) or '').split() | ||
700 | foundlocalonly = False | ||
701 | correct_symlink = False | ||
702 | for item in src_uri: | ||
703 | if item.startswith('file://'): | ||
704 | if '.patch' not in item: | ||
705 | foundlocalonly = True | ||
706 | else: | ||
707 | foundlocalonly = False | ||
708 | break | ||
709 | self.assertTrue(foundlocalonly, 'This test expects the %s recipe to fetch local files only and it seems that it no longer does' % testrecipe) | ||
710 | # Clean up anything in the workdir/sysroot/sstate cache | ||
711 | bitbake('%s -c cleansstate' % testrecipe) | ||
712 | # Try modifying a recipe | ||
713 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
714 | self.track_for_cleanup(tempdir) | ||
715 | self.track_for_cleanup(self.workspacedir) | ||
716 | self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe) | ||
717 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
718 | result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) | ||
719 | srcfile = os.path.join(tempdir, 'oe-local-files/share/dot.bashrc') | ||
720 | srclink = os.path.join(tempdir, 'share/dot.bashrc') | ||
721 | self.assertExists(srcfile, 'Extracted source could not be found') | ||
722 | if os.path.islink(srclink) and os.path.exists(srclink) and os.path.samefile(srcfile, srclink): | ||
723 | correct_symlink = True | ||
724 | self.assertTrue(correct_symlink, 'Source symlink to oe-local-files is broken') | ||
696 | 725 | ||
726 | matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe)) | ||
727 | self.assertTrue(matches, 'bbappend not created') | ||
728 | # Test devtool status | ||
729 | result = runCmd('devtool status') | ||
730 | self.assertIn(testrecipe, result.output) | ||
731 | self.assertIn(tempdir, result.output) | ||
732 | # Try building | ||
733 | bitbake(testrecipe) | ||
697 | 734 | ||
698 | def test_devtool_modify_git(self): | 735 | def test_devtool_modify_git(self): |
699 | # Check preconditions | 736 | # Check preconditions |