summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/devtool.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-03-04 12:56:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-20 11:27:44 +0000
commit9adae67e71f16b36a33479aa661ee0fd0180945c (patch)
treee90068fe36b8af559ed82c713cb568f233d79afd /meta/lib/oeqa/selftest/devtool.py
parente3cfb80f1e5df809663ec2cd63171e6fe7f78c04 (diff)
downloadpoky-9adae67e71f16b36a33479aa661ee0fd0180945c.tar.gz
devtool: reset: add ability to reset entire workspace
Add a -a/--all option to allow you to quickly reset all recipes in your workspace. (From OE-Core rev: 0c83788b111a761f6f500b86780cc51aed255402) 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/oeqa/selftest/devtool.py')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 932d6b9ec2..a8c339a39f 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -384,3 +384,32 @@ class DevtoolTests(oeSelfTest):
384 result = runCmd('devtool extract remake %s' % tempdir) 384 result = runCmd('devtool extract remake %s' % tempdir)
385 self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found') 385 self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found')
386 self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found') 386 self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
387
388 def test_devtool_reset_all(self):
389 # Check preconditions
390 workspacedir = os.path.join(self.builddir, 'workspace')
391 self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
392 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
393 self.track_for_cleanup(tempdir)
394 self.track_for_cleanup(workspacedir)
395 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
396 testrecipe1 = 'mdadm'
397 testrecipe2 = 'cronie'
398 result = runCmd('devtool modify -x %s %s' % (testrecipe1, os.path.join(tempdir, testrecipe1)))
399 result = runCmd('devtool modify -x %s %s' % (testrecipe2, os.path.join(tempdir, testrecipe2)))
400 result = runCmd('devtool build %s' % testrecipe1)
401 result = runCmd('devtool build %s' % testrecipe2)
402 stampprefix1 = get_bb_var('STAMP', testrecipe1)
403 self.assertTrue(stampprefix1, 'Unable to get STAMP value for recipe %s' % testrecipe1)
404 stampprefix2 = get_bb_var('STAMP', testrecipe2)
405 self.assertTrue(stampprefix2, 'Unable to get STAMP value for recipe %s' % testrecipe2)
406 result = runCmd('devtool reset -a')
407 self.assertIn(testrecipe1, result.output)
408 self.assertIn(testrecipe2, result.output)
409 result = runCmd('devtool status')
410 self.assertNotIn(testrecipe1, result.output)
411 self.assertNotIn(testrecipe2, result.output)
412 matches1 = glob.glob(stampprefix1 + '*')
413 self.assertFalse(matches1, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe1)
414 matches2 = glob.glob(stampprefix2 + '*')
415 self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2)