summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index a8c339a39f..2574e4bbf4 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -227,6 +227,30 @@ class DevtoolTests(oeSelfTest):
227 matches = glob.glob(stampprefix + '*') 227 matches = glob.glob(stampprefix + '*')
228 self.assertFalse(matches, 'Stamp files exist for recipe mdadm that should have been cleaned') 228 self.assertFalse(matches, 'Stamp files exist for recipe mdadm that should have been cleaned')
229 229
230 def test_devtool_modify_invalid(self):
231 # Check preconditions
232 workspacedir = os.path.join(self.builddir, 'workspace')
233 self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
234 # Try modifying some recipes
235 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
236 self.track_for_cleanup(tempdir)
237 self.track_for_cleanup(workspacedir)
238 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
239
240 testrecipes = 'perf gcc-source kernel-devsrc package-index core-image-minimal meta-toolchain packagegroup-core-sdk meta-ide-support'.split()
241 for testrecipe in testrecipes:
242 # Check it's a valid recipe
243 bitbake('%s -e' % testrecipe)
244 # devtool extract should fail
245 result = runCmd('devtool extract %s %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True)
246 self.assertNotEqual(result.status, 0, 'devtool extract on %s should have failed' % testrecipe)
247 self.assertNotIn('Fetching ', result.output, 'devtool extract on %s should have errored out before trying to fetch' % testrecipe)
248 self.assertIn('ERROR: ', result.output, 'devtool extract on %s should have given an ERROR' % testrecipe)
249 # devtool modify should fail
250 result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True)
251 self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed' % testrecipe)
252 self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe)
253
230 def test_devtool_modify_git(self): 254 def test_devtool_modify_git(self):
231 # Check preconditions 255 # Check preconditions
232 workspacedir = os.path.join(self.builddir, 'workspace') 256 workspacedir = os.path.join(self.builddir, 'workspace')