summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2024-01-22 13:29:26 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-26 16:06:29 +0000
commit5ae14523a72d854c41c234969a9221b078719a21 (patch)
tree892522962b02eddf104fc54097f11a24b4e221d6 /meta/lib/oeqa/selftest/cases
parentf697dc7bafb8e360cbd63417ed16d484d4dbc7db (diff)
downloadpoky-5ae14523a72d854c41c234969a9221b078719a21.tar.gz
oeqa/selftest: add test case to cover 'devtool modify -n' for a git recipe
Add a test case to ensure the following error does not happen again for 'devtool modify -n'. Traceback (most recent call last): File "/buildarea2/chenqi/poky/scripts/devtool", line 349, in <module> ret = main() File "/buildarea2/chenqi/poky/scripts/devtool", line 336, in main ret = args.func(args, config, basepath, workspace) File "/buildarea2/chenqi/poky/scripts/lib/devtool/standard.py", line 924, in modify if not initial_revs["."]: KeyError: '.' (From OE-Core rev: 2c2ba5f9497462a190b849a69d8440149f80582a) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 6ed51d7a45..15249b70fd 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -917,6 +917,28 @@ class DevtoolModifyTests(DevtoolBase):
917 # Try building 917 # Try building
918 bitbake(testrecipe) 918 bitbake(testrecipe)
919 919
920 def test_devtool_modify_git_no_extract(self):
921 # Check preconditions
922 testrecipe = 'psplash'
923 src_uri = get_bb_var('SRC_URI', testrecipe)
924 self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
925 # Clean up anything in the workdir/sysroot/sstate cache
926 bitbake('%s -c cleansstate' % testrecipe)
927 # Try modifying a recipe
928 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
929 self.track_for_cleanup(tempdir)
930 self.track_for_cleanup(self.workspacedir)
931 self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
932 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
933 result = runCmd('git clone https://git.yoctoproject.org/psplash %s && devtool modify -n %s %s' % (tempdir, testrecipe, tempdir))
934 self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. devtool output: %s' % result.output)
935 matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'psplash_*.bbappend'))
936 self.assertTrue(matches, 'bbappend not created')
937 # Test devtool status
938 result = runCmd('devtool status')
939 self.assertIn(testrecipe, result.output)
940 self.assertIn(tempdir, result.output)
941
920 def test_devtool_modify_git_crates_subpath(self): 942 def test_devtool_modify_git_crates_subpath(self):
921 # This tests two things in devtool context: 943 # This tests two things in devtool context:
922 # - that we support local git dependencies for cargo based recipe 944 # - that we support local git dependencies for cargo based recipe