summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOla x Nilsson <olani@axis.com>2024-06-12 04:39:08 +0200
committerSteve Sakoman <steve@sakoman.com>2024-06-19 08:34:58 -0700
commit5ff13f1b01ad9f53489d21e46cc3cdb4acac5db3 (patch)
tree850c367efa8df8ae7e15841722f51dd9cf311ee3
parent10e6cc830c75a2fd30f7b0efef84cdf614198cfa (diff)
downloadpoky-5ff13f1b01ad9f53489d21e46cc3cdb4acac5db3.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: 71adf7c18215faf73454be79d7b51f2a0c338c0f) 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> (cherry picked from commit fab0c737b95b8d0c0bbf58336bc308776c956406) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py19
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 51949e3c93..cc4cbec5ae 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -749,6 +749,25 @@ class DevtoolModifyTests(DevtoolBase):
749 result = runCmd('devtool status') 749 result = runCmd('devtool status')
750 self.assertNotIn('mdadm', result.output) 750 self.assertNotIn('mdadm', result.output)
751 751
752 def test_devtool_modify_go(self):
753 import oe.path
754 from tempfile import TemporaryDirectory
755 with TemporaryDirectory(prefix='devtoolqa') as tempdir:
756 self.track_for_cleanup(self.workspacedir)
757 self.add_command_to_tearDown('bitbake -c clean go-helloworld')
758 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
759 result = runCmd('devtool modify go-helloworld -x %s' % tempdir)
760 self.assertExists(
761 oe.path.join(tempdir, 'src', 'golang.org', 'x', 'example', 'go.mod'),
762 'Extracted source could not be found'
763 )
764 self.assertExists(
765 oe.path.join(self.workspacedir, 'conf', 'layer.conf'),
766 'Workspace directory not created'
767 )
768 matches = glob.glob(oe.path.join(self.workspacedir, 'appends', 'go-helloworld_*.bbappend'))
769 self.assertTrue(matches, 'bbappend not created %s' % result.output)
770
752 def test_devtool_buildclean(self): 771 def test_devtool_buildclean(self):
753 def assertFile(path, *paths): 772 def assertFile(path, *paths):
754 f = os.path.join(path, *paths) 773 f = os.path.join(path, *paths)