aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/devtool.py
diff options
context:
space:
mode:
authorCostin Constantin <costin.c.constantin@intel.com>2015-07-15 16:04:50 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-16 15:08:46 +0100
commitb6a66026ef547eb34c6019d2ac7da90b90741dad (patch)
treeef2c9a5fad23fe1bbe76bb17c71067642759174c /meta/lib/oeqa/selftest/devtool.py
parent27149fb98fd9d5bba4e07d256a6a0b4921cf00a9 (diff)
downloadopenembedded-core-contrib-b6a66026ef547eb34c6019d2ac7da90b90741dad.tar.gz
oeqa/devtool: add useful failure messages for some test cases
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/selftest/devtool.py')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index ab412b6168..21cd7f5291 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -95,14 +95,14 @@ class DevtoolTests(DevtoolBase):
tempdir = tempfile.mkdtemp(prefix='devtoolqa')
self.track_for_cleanup(tempdir)
result = runCmd('devtool create-workspace %s' % tempdir)
- self.assertTrue(os.path.isfile(os.path.join(tempdir, 'conf', 'layer.conf')))
+ self.assertTrue(os.path.isfile(os.path.join(tempdir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output)
result = runCmd('bitbake-layers show-layers')
self.assertIn(tempdir, result.output)
# Try creating a workspace layer with the default path
self.track_for_cleanup(workspacedir)
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
result = runCmd('devtool create-workspace')
- self.assertTrue(os.path.isfile(os.path.join(workspacedir, 'conf', 'layer.conf')))
+ self.assertTrue(os.path.isfile(os.path.join(workspacedir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output)
result = runCmd('bitbake-layers show-layers')
self.assertNotIn(tempdir, result.output)
self.assertIn(workspacedir, result.output)
@@ -170,9 +170,10 @@ class DevtoolTests(DevtoolBase):
bitbake('libftdi -c cleansstate')
# Test devtool build
result = runCmd('devtool build libftdi')
+ self.add_command_to_tearDown('bitbake -c cleansstate libftdi')
staging_libdir = get_bb_var('STAGING_LIBDIR', 'libftdi')
self.assertTrue(staging_libdir, 'Could not query STAGING_LIBDIR variable')
- self.assertTrue(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), 'libftdi binary not found in STAGING_LIBDIR')
+ self.assertTrue(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), "libftdi binary not found in STAGING_LIBDIR. Output of devtool build libftdi %s" % result.output)
# Test devtool reset
stampprefix = get_bb_var('STAMP', 'libftdi')
result = runCmd('devtool reset libftdi')
@@ -200,7 +201,7 @@ class DevtoolTests(DevtoolBase):
self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe)
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url))
- self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+ self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created. %s' % result.output)
self.assertTrue(os.path.isfile(os.path.join(srcdir, 'setup.py')), 'Unable to find setup.py in source directory')
# Test devtool status
result = runCmd('devtool status')
@@ -247,7 +248,7 @@ class DevtoolTests(DevtoolBase):
self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe)
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url))
- self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+ self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created: %s' % result.output)
self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure.ac in source directory')
# Test devtool status
result = runCmd('devtool status')
@@ -300,7 +301,7 @@ class DevtoolTests(DevtoolBase):
self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not 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', 'mdadm_*.bbappend'))
- self.assertTrue(matches, 'bbappend not created')
+ self.assertTrue(matches, 'bbappend not created %s' % result.output)
# Test devtool status
result = runCmd('devtool status')
self.assertIn('mdadm', result.output)
@@ -324,7 +325,7 @@ class DevtoolTests(DevtoolBase):
with open(os.path.join(pkgd, mandir, 'man8', 'mdadm.8'), 'r') as f:
for line in f:
if line.startswith('.TH'):
- self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified')
+ self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified. man searched file path: %s' % os.path.join(pkgd, mandir, 'man8', 'mdadm.8'))
# Test devtool reset
stampprefix = get_bb_var('STAMP', 'mdadm')
result = runCmd('devtool reset mdadm')
@@ -359,12 +360,12 @@ class DevtoolTests(DevtoolBase):
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.assertNotEqual(result.status, 0, 'devtool extract on %s should have failed. devtool output: %s' % (testrecipe, result.output))
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.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' % (testrecipe, result.output))
self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe)
@testcase(1165)
@@ -386,7 +387,7 @@ class DevtoolTests(DevtoolBase):
result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found')
self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
- self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+ self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created. devtool output: %s' % result.output)
matches = glob.glob(os.path.join(workspacedir, 'appends', 'mkelfimage_*.bbappend'))
self.assertTrue(matches, 'bbappend not created')
# Test devtool status