diff options
-rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index 1caf0f098a..869fecf7e6 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py | |||
@@ -284,6 +284,38 @@ class DevtoolTests(oeSelfTest): | |||
284 | # Try building | 284 | # Try building |
285 | bitbake(testrecipe) | 285 | bitbake(testrecipe) |
286 | 286 | ||
287 | def test_devtool_modify_localfiles(self): | ||
288 | # Check preconditions | ||
289 | workspacedir = os.path.join(self.builddir, 'workspace') | ||
290 | self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory') | ||
291 | testrecipe = 'lighttpd' | ||
292 | src_uri = (get_bb_var('SRC_URI', testrecipe) or '').split() | ||
293 | foundlocal = False | ||
294 | for item in src_uri: | ||
295 | if item.startswith('file://') and '.patch' not in item: | ||
296 | foundlocal = True | ||
297 | break | ||
298 | self.assertTrue(foundlocal, 'This test expects the %s recipe to fetch local files and it seems that it no longer does' % testrecipe) | ||
299 | # Clean up anything in the workdir/sysroot/sstate cache | ||
300 | bitbake('%s -c cleansstate' % testrecipe) | ||
301 | # Try modifying a recipe | ||
302 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
303 | self.track_for_cleanup(tempdir) | ||
304 | self.track_for_cleanup(workspacedir) | ||
305 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
306 | self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe) | ||
307 | result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) | ||
308 | self.assertTrue(os.path.exists(os.path.join(tempdir, 'configure.ac')), 'Extracted source could not be found') | ||
309 | self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') | ||
310 | matches = glob.glob(os.path.join(workspacedir, 'appends', '%s_*.bbappend' % testrecipe)) | ||
311 | self.assertTrue(matches, 'bbappend not created') | ||
312 | # Test devtool status | ||
313 | result = runCmd('devtool status') | ||
314 | self.assertIn(testrecipe, result.output) | ||
315 | self.assertIn(tempdir, result.output) | ||
316 | # Try building | ||
317 | bitbake(testrecipe) | ||
318 | |||
287 | def test_devtool_update_recipe(self): | 319 | def test_devtool_update_recipe(self): |
288 | # Check preconditions | 320 | # Check preconditions |
289 | workspacedir = os.path.join(self.builddir, 'workspace') | 321 | workspacedir = os.path.join(self.builddir, 'workspace') |