diff options
author | Costin Constantin <costin.c.constantin@intel.com> | 2015-07-14 14:31:11 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-16 15:09:25 +0100 |
commit | 74dc0c833f11b071337fe2ea266c13ebd1e87e7e (patch) | |
tree | f4458c44b12dfd536e89a9f140e08f3c5a76eb53 /meta/lib/oeqa/selftest/buildoptions.py | |
parent | eeed010b177946d64ff14b20a2d75d8770a666ee (diff) | |
download | poky-74dc0c833f11b071337fe2ea266c13ebd1e87e7e.tar.gz |
oeqa/buildoptions: add useful failure messages for all test cases
(From OE-Core rev: 4d027bbb067cf508d73c0e23a77bbf430388b13f)
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>
Diffstat (limited to 'meta/lib/oeqa/selftest/buildoptions.py')
-rw-r--r-- | meta/lib/oeqa/selftest/buildoptions.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index 926ffe9993..13ec276459 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py | |||
@@ -44,18 +44,18 @@ class ImageOptionsTests(oeSelfTest): | |||
44 | bitbake("-C rootfs core-image-minimal") | 44 | bitbake("-C rootfs core-image-minimal") |
45 | deploydir_files = os.listdir(deploydir) | 45 | deploydir_files = os.listdir(deploydir) |
46 | remaining_not_expected = [path for path in track_original_files if os.path.basename(path) in deploydir_files] | 46 | remaining_not_expected = [path for path in track_original_files if os.path.basename(path) in deploydir_files] |
47 | self.assertFalse(remaining_not_expected, msg="\nThe following image files ware not removed: %s" % ', '.join(map(str, remaining_not_expected))) | 47 | self.assertFalse(remaining_not_expected, msg="\nThe following image files were not removed: %s" % ', '.join(map(str, remaining_not_expected))) |
48 | 48 | ||
49 | @testcase(286) | 49 | @testcase(286) |
50 | def test_ccache_tool(self): | 50 | def test_ccache_tool(self): |
51 | bitbake("ccache-native") | 51 | bitbake("ccache-native") |
52 | self.assertTrue(os.path.isfile(os.path.join(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native'), "ccache"))) | 52 | self.assertTrue(os.path.isfile(os.path.join(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native'), "ccache")), msg = "No ccache found under %s" % str(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native'))) |
53 | self.write_config('INHERIT += "ccache"') | 53 | self.write_config('INHERIT += "ccache"') |
54 | bitbake("m4 -c cleansstate") | 54 | bitbake("m4 -c cleansstate") |
55 | bitbake("m4 -c compile") | 55 | bitbake("m4 -c compile") |
56 | self.addCleanup(bitbake, 'ccache-native -ccleansstate') | ||
56 | res = runCmd("grep ccache %s" % (os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile")), ignore_status=True) | 57 | res = runCmd("grep ccache %s" % (os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile")), ignore_status=True) |
57 | self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile") | 58 | self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile")) |
58 | bitbake("ccache-native -ccleansstate") | ||
59 | 59 | ||
60 | 60 | ||
61 | class DiskMonTest(oeSelfTest): | 61 | class DiskMonTest(oeSelfTest): |
@@ -64,15 +64,15 @@ class DiskMonTest(oeSelfTest): | |||
64 | def test_stoptask_behavior(self): | 64 | def test_stoptask_behavior(self): |
65 | self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"') | 65 | self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"') |
66 | res = bitbake("m4", ignore_status = True) | 66 | res = bitbake("m4", ignore_status = True) |
67 | self.assertTrue('ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!' in res.output) | 67 | self.assertTrue('ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!' in res.output, msg = "Tasks should have stopped. Disk monitor is set to STOPTASK: %s" % res.output) |
68 | self.assertEqual(res.status, 1) | 68 | self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) |
69 | self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"') | 69 | self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"') |
70 | res = bitbake("m4", ignore_status = True) | 70 | res = bitbake("m4", ignore_status = True) |
71 | self.assertTrue('ERROR: Immediately abort since the disk space monitor action is "ABORT"!' in res.output) | 71 | self.assertTrue('ERROR: Immediately abort since the disk space monitor action is "ABORT"!' in res.output, "Tasks should have been aborted immediatelly. Disk monitor is set to ABORT: %s" % res.output) |
72 | self.assertEqual(res.status, 1) | 72 | self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) |
73 | self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"') | 73 | self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"') |
74 | res = bitbake("m4") | 74 | res = bitbake("m4") |
75 | self.assertTrue('WARNING: The free space' in res.output) | 75 | self.assertTrue('WARNING: The free space' in res.output, msg = "A warning should have been displayed for disk monitor is set to WARN: %s" %res.output) |
76 | 76 | ||
77 | class SanityOptionsTest(oeSelfTest): | 77 | class SanityOptionsTest(oeSelfTest): |
78 | 78 | ||
@@ -87,7 +87,7 @@ class SanityOptionsTest(oeSelfTest): | |||
87 | res = bitbake("xcursor-transparent-theme", ignore_status=True) | 87 | res = bitbake("xcursor-transparent-theme", ignore_status=True) |
88 | self.delete_recipeinc('xcursor-transparent-theme') | 88 | self.delete_recipeinc('xcursor-transparent-theme') |
89 | self.assertTrue("ERROR: QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors." in res.output, msg=res.output) | 89 | self.assertTrue("ERROR: QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors." in res.output, msg=res.output) |
90 | self.assertEqual(res.status, 1) | 90 | self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) |
91 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') | 91 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') |
92 | self.append_config('ERROR_QA_remove = "packages-list"') | 92 | self.append_config('ERROR_QA_remove = "packages-list"') |
93 | self.append_config('WARN_QA_append = " packages-list"') | 93 | self.append_config('WARN_QA_append = " packages-list"') |
@@ -101,15 +101,15 @@ class SanityOptionsTest(oeSelfTest): | |||
101 | self.append_config('WARN_QA_append = " unsafe-references-in-binaries unsafe-references-in-scripts"') | 101 | self.append_config('WARN_QA_append = " unsafe-references-in-binaries unsafe-references-in-scripts"') |
102 | bitbake("-ccleansstate gzip nfs-utils") | 102 | bitbake("-ccleansstate gzip nfs-utils") |
103 | res = bitbake("gzip nfs-utils") | 103 | res = bitbake("gzip nfs-utils") |
104 | self.assertTrue("WARNING: QA Issue: gzip" in res.output) | 104 | self.assertTrue("WARNING: QA Issue: gzip" in res.output, "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output) |
105 | self.assertTrue("WARNING: QA Issue: nfs-utils" in res.output) | 105 | self.assertTrue("WARNING: QA Issue: nfs-utils" in res.output, "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output) |
106 | 106 | ||
107 | class BuildhistoryTests(BuildhistoryBase): | 107 | class BuildhistoryTests(BuildhistoryBase): |
108 | 108 | ||
109 | @testcase(293) | 109 | @testcase(293) |
110 | def test_buildhistory_basic(self): | 110 | def test_buildhistory_basic(self): |
111 | self.run_buildhistory_operation('xcursor-transparent-theme') | 111 | self.run_buildhistory_operation('xcursor-transparent-theme') |
112 | self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR'))) | 112 | self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR')), "buildhistory dir was not created.") |
113 | 113 | ||
114 | @testcase(294) | 114 | @testcase(294) |
115 | def test_buildhistory_buildtime_pr_backwards(self): | 115 | def test_buildhistory_buildtime_pr_backwards(self): |