diff options
author | Ola x Nilsson <olani@axis.com> | 2024-05-17 10:54:10 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-28 09:38:23 +0100 |
commit | 02f6d0793a96329655c29d8f2e9fa5a8b5a000f1 (patch) | |
tree | 13490468672426a8b976033130f6bf1aef7c3629 /meta/lib | |
parent | 4a433869054277c75aa719f475f006c41e85d6fb (diff) | |
download | poky-02f6d0793a96329655c29d8f2e9fa5a8b5a000f1.tar.gz |
oeqa/selftest/devtool: add test for modifying recipes using go.bbclass
go.bbclass uses a special do_unpack function that causes the git root
to be different from S. Verify that it unpacks as expected.
[ YOCTO #15483 ]
(From OE-Core rev: fab0c737b95b8d0c0bbf58336bc308776c956406)
Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index c8bf7d9e44..1cafb922ea 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -753,6 +753,25 @@ class DevtoolModifyTests(DevtoolBase): | |||
753 | result = runCmd('devtool status') | 753 | result = runCmd('devtool status') |
754 | self.assertNotIn('mdadm', result.output) | 754 | self.assertNotIn('mdadm', result.output) |
755 | 755 | ||
756 | def test_devtool_modify_go(self): | ||
757 | import oe.path | ||
758 | from tempfile import TemporaryDirectory | ||
759 | with TemporaryDirectory(prefix='devtoolqa') as tempdir: | ||
760 | self.track_for_cleanup(self.workspacedir) | ||
761 | self.add_command_to_tearDown('bitbake -c clean go-helloworld') | ||
762 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
763 | result = runCmd('devtool modify go-helloworld -x %s' % tempdir) | ||
764 | self.assertExists( | ||
765 | oe.path.join(tempdir, 'src', 'golang.org', 'x', 'example', 'go.mod'), | ||
766 | 'Extracted source could not be found' | ||
767 | ) | ||
768 | self.assertExists( | ||
769 | oe.path.join(self.workspacedir, 'conf', 'layer.conf'), | ||
770 | 'Workspace directory not created' | ||
771 | ) | ||
772 | matches = glob.glob(oe.path.join(self.workspacedir, 'appends', 'go-helloworld_*.bbappend')) | ||
773 | self.assertTrue(matches, 'bbappend not created %s' % result.output) | ||
774 | |||
756 | def test_devtool_buildclean(self): | 775 | def test_devtool_buildclean(self): |
757 | def assertFile(path, *paths): | 776 | def assertFile(path, *paths): |
758 | f = os.path.join(path, *paths) | 777 | f = os.path.join(path, *paths) |