summaryrefslogtreecommitdiffstats
path: root/meta/lib
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/lib
parenta976d63ae5ccf0d27b8dd9a332a9406794c093cc (diff)
downloadast2050-yocto-poky-4a8fec9bdd2661a58d3373779706740254048ab1.zip
ast2050-yocto-poky-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/lib')
-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 1caf0f0..869fecf 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -284,6 +284,38 @@ class DevtoolTests(oeSelfTest):
# Try building
bitbake(testrecipe)
+ def test_devtool_modify_localfiles(self):
+ # Check preconditions
+ workspacedir = os.path.join(self.builddir, 'workspace')
+ self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ testrecipe = 'lighttpd'
+ src_uri = (get_bb_var('SRC_URI', testrecipe) or '').split()
+ foundlocal = False
+ for item in src_uri:
+ if item.startswith('file://') and '.patch' not in item:
+ foundlocal = True
+ break
+ self.assertTrue(foundlocal, 'This test expects the %s recipe to fetch local files and it seems that it no longer does' % testrecipe)
+ # Clean up anything in the workdir/sysroot/sstate cache
+ bitbake('%s -c cleansstate' % testrecipe)
+ # Try modifying a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ self.assertTrue(os.path.exists(os.path.join(tempdir, 'configure.ac')), 'Extracted source could not be found')
+ self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+ matches = glob.glob(os.path.join(workspacedir, 'appends', '%s_*.bbappend' % testrecipe))
+ self.assertTrue(matches, 'bbappend not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(testrecipe, result.output)
+ self.assertIn(tempdir, result.output)
+ # Try building
+ bitbake(testrecipe)
+
def test_devtool_update_recipe(self):
# Check preconditions
workspacedir = os.path.join(self.builddir, 'workspace')
OpenPOWER on IntegriCloud