summaryrefslogtreecommitdiffstats
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:09:25 +0100
commit4d77270c2d5c06bcd7701c0ed351697a25f95e86 (patch)
tree5e5d0634e8032b496336a6156efa81462d860874
parenta7f23c6bd254a3f4f6507c26688a0bc0c4c13e08 (diff)
downloadpoky-4d77270c2d5c06bcd7701c0ed351697a25f95e86.tar.gz
oeqa/devtool: add useful failure messages for some test cases
(From OE-Core rev: b6a66026ef547eb34c6019d2ac7da90b90741dad) Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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):
95 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 95 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
96 self.track_for_cleanup(tempdir) 96 self.track_for_cleanup(tempdir)
97 result = runCmd('devtool create-workspace %s' % tempdir) 97 result = runCmd('devtool create-workspace %s' % tempdir)
98 self.assertTrue(os.path.isfile(os.path.join(tempdir, 'conf', 'layer.conf'))) 98 self.assertTrue(os.path.isfile(os.path.join(tempdir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output)
99 result = runCmd('bitbake-layers show-layers') 99 result = runCmd('bitbake-layers show-layers')
100 self.assertIn(tempdir, result.output) 100 self.assertIn(tempdir, result.output)
101 # Try creating a workspace layer with the default path 101 # Try creating a workspace layer with the default path
102 self.track_for_cleanup(workspacedir) 102 self.track_for_cleanup(workspacedir)
103 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') 103 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
104 result = runCmd('devtool create-workspace') 104 result = runCmd('devtool create-workspace')
105 self.assertTrue(os.path.isfile(os.path.join(workspacedir, 'conf', 'layer.conf'))) 105 self.assertTrue(os.path.isfile(os.path.join(workspacedir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output)
106 result = runCmd('bitbake-layers show-layers') 106 result = runCmd('bitbake-layers show-layers')
107 self.assertNotIn(tempdir, result.output) 107 self.assertNotIn(tempdir, result.output)
108 self.assertIn(workspacedir, result.output) 108 self.assertIn(workspacedir, result.output)
@@ -170,9 +170,10 @@ class DevtoolTests(DevtoolBase):
170 bitbake('libftdi -c cleansstate') 170 bitbake('libftdi -c cleansstate')
171 # Test devtool build 171 # Test devtool build
172 result = runCmd('devtool build libftdi') 172 result = runCmd('devtool build libftdi')
173 self.add_command_to_tearDown('bitbake -c cleansstate libftdi')
173 staging_libdir = get_bb_var('STAGING_LIBDIR', 'libftdi') 174 staging_libdir = get_bb_var('STAGING_LIBDIR', 'libftdi')
174 self.assertTrue(staging_libdir, 'Could not query STAGING_LIBDIR variable') 175 self.assertTrue(staging_libdir, 'Could not query STAGING_LIBDIR variable')
175 self.assertTrue(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), 'libftdi binary not found in STAGING_LIBDIR') 176 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)
176 # Test devtool reset 177 # Test devtool reset
177 stampprefix = get_bb_var('STAMP', 'libftdi') 178 stampprefix = get_bb_var('STAMP', 'libftdi')
178 result = runCmd('devtool reset libftdi') 179 result = runCmd('devtool reset libftdi')
@@ -200,7 +201,7 @@ class DevtoolTests(DevtoolBase):
200 self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe) 201 self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe)
201 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') 202 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
202 result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url)) 203 result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url))
203 self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') 204 self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created. %s' % result.output)
204 self.assertTrue(os.path.isfile(os.path.join(srcdir, 'setup.py')), 'Unable to find setup.py in source directory') 205 self.assertTrue(os.path.isfile(os.path.join(srcdir, 'setup.py')), 'Unable to find setup.py in source directory')
205 # Test devtool status 206 # Test devtool status
206 result = runCmd('devtool status') 207 result = runCmd('devtool status')
@@ -247,7 +248,7 @@ class DevtoolTests(DevtoolBase):
247 self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe) 248 self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe)
248 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') 249 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
249 result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url)) 250 result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url))
250 self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') 251 self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created: %s' % result.output)
251 self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure.ac in source directory') 252 self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure.ac in source directory')
252 # Test devtool status 253 # Test devtool status
253 result = runCmd('devtool status') 254 result = runCmd('devtool status')
@@ -300,7 +301,7 @@ class DevtoolTests(DevtoolBase):
300 self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found') 301 self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
301 self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') 302 self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
302 matches = glob.glob(os.path.join(workspacedir, 'appends', 'mdadm_*.bbappend')) 303 matches = glob.glob(os.path.join(workspacedir, 'appends', 'mdadm_*.bbappend'))
303 self.assertTrue(matches, 'bbappend not created') 304 self.assertTrue(matches, 'bbappend not created %s' % result.output)
304 # Test devtool status 305 # Test devtool status
305 result = runCmd('devtool status') 306 result = runCmd('devtool status')
306 self.assertIn('mdadm', result.output) 307 self.assertIn('mdadm', result.output)
@@ -324,7 +325,7 @@ class DevtoolTests(DevtoolBase):
324 with open(os.path.join(pkgd, mandir, 'man8', 'mdadm.8'), 'r') as f: 325 with open(os.path.join(pkgd, mandir, 'man8', 'mdadm.8'), 'r') as f:
325 for line in f: 326 for line in f:
326 if line.startswith('.TH'): 327 if line.startswith('.TH'):
327 self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified') 328 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'))
328 # Test devtool reset 329 # Test devtool reset
329 stampprefix = get_bb_var('STAMP', 'mdadm') 330 stampprefix = get_bb_var('STAMP', 'mdadm')
330 result = runCmd('devtool reset mdadm') 331 result = runCmd('devtool reset mdadm')
@@ -359,12 +360,12 @@ class DevtoolTests(DevtoolBase):
359 bitbake('%s -e' % testrecipe) 360 bitbake('%s -e' % testrecipe)
360 # devtool extract should fail 361 # devtool extract should fail
361 result = runCmd('devtool extract %s %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True) 362 result = runCmd('devtool extract %s %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True)
362 self.assertNotEqual(result.status, 0, 'devtool extract on %s should have failed' % testrecipe) 363 self.assertNotEqual(result.status, 0, 'devtool extract on %s should have failed. devtool output: %s' % (testrecipe, result.output))
363 self.assertNotIn('Fetching ', result.output, 'devtool extract on %s should have errored out before trying to fetch' % testrecipe) 364 self.assertNotIn('Fetching ', result.output, 'devtool extract on %s should have errored out before trying to fetch' % testrecipe)
364 self.assertIn('ERROR: ', result.output, 'devtool extract on %s should have given an ERROR' % testrecipe) 365 self.assertIn('ERROR: ', result.output, 'devtool extract on %s should have given an ERROR' % testrecipe)
365 # devtool modify should fail 366 # devtool modify should fail
366 result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True) 367 result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True)
367 self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed' % testrecipe) 368 self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' % (testrecipe, result.output))
368 self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe) 369 self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe)
369 370
370 @testcase(1165) 371 @testcase(1165)
@@ -386,7 +387,7 @@ class DevtoolTests(DevtoolBase):
386 result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) 387 result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
387 self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found') 388 self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found')
388 self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found') 389 self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
389 self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created') 390 self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created. devtool output: %s' % result.output)
390 matches = glob.glob(os.path.join(workspacedir, 'appends', 'mkelfimage_*.bbappend')) 391 matches = glob.glob(os.path.join(workspacedir, 'appends', 'mkelfimage_*.bbappend'))
391 self.assertTrue(matches, 'bbappend not created') 392 self.assertTrue(matches, 'bbappend not created')
392 # Test devtool status 393 # Test devtool status