diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-03-05 10:51:20 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-20 11:03:11 +0000 |
commit | 4be9bf637583b341a89af1b9924752abc7d49c94 (patch) | |
tree | 6cee8f7d5c7741ee82ceddd0dc72f22369fc72eb /meta/lib/oeqa/selftest | |
parent | c20e10543e268ebb43074a3f8d6e7ed991e54ec8 (diff) | |
download | openembedded-core-4be9bf637583b341a89af1b9924752abc7d49c94.tar.gz openembedded-core-4be9bf637583b341a89af1b9924752abc7d49c94.tar.bz2 openembedded-core-4be9bf637583b341a89af1b9924752abc7d49c94.zip |
devtool: modify/extract: prevent usage with incompatible recipes
Consolidate code for checking compatible recipes and consider meta and
packagegroup recipes as well as package-index and gcc-source to be
incompatible.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 24 |
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): matches = glob.glob(stampprefix + '*') self.assertFalse(matches, 'Stamp files exist for recipe mdadm that should have been cleaned') + def test_devtool_modify_invalid(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') + # Try modifying some recipes + 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') + + testrecipes = 'perf gcc-source kernel-devsrc package-index core-image-minimal meta-toolchain packagegroup-core-sdk meta-ide-support'.split() + for testrecipe in testrecipes: + # Check it's a valid recipe + bitbake('%s -e' % testrecipe) + # devtool extract should fail + result = runCmd('devtool extract %s %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True) + self.assertNotEqual(result.status, 0, 'devtool extract on %s should have failed' % testrecipe) + self.assertNotIn('Fetching ', result.output, 'devtool extract on %s should have errored out before trying to fetch' % testrecipe) + self.assertIn('ERROR: ', result.output, 'devtool extract on %s should have given an ERROR' % testrecipe) + # devtool modify should fail + result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True) + self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed' % testrecipe) + self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe) + def test_devtool_modify_git(self): # Check preconditions workspacedir = os.path.join(self.builddir, 'workspace') |