summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-03-15 11:56:03 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-20 11:27:48 +0000
commit4a8fec9bdd2661a58d3373779706740254048ab1 (patch)
tree2552584fe59089179914e0b3edc272963a6b4b66 /meta
parenta976d63ae5ccf0d27b8dd9a332a9406794c093cc (diff)
downloadpoky-4a8fec9bdd2661a58d3373779706740254048ab1.tar.gz
oe-selftest: add a test for devtool modify on recipes fetching local files
With the change to externalsrc we can now handle these, so add a test to ensure they can be built. (From OE-Core rev: efd46543524db98e4369c1d85a1e1c0e76f12899) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py32
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')