diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/buildoptions.py')
-rw-r--r-- | meta/lib/oeqa/selftest/buildoptions.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index 6167fb29e2..602d95f9bd 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py | |||
@@ -74,6 +74,10 @@ class DiskMonTest(oeSelfTest): | |||
74 | 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) | 74 | 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) |
75 | 75 | ||
76 | class SanityOptionsTest(oeSelfTest): | 76 | class SanityOptionsTest(oeSelfTest): |
77 | def getline(self, res, line): | ||
78 | for l in res.output.split('\n'): | ||
79 | if line in l: | ||
80 | return l | ||
77 | 81 | ||
78 | @testcase(927) | 82 | @testcase(927) |
79 | def test_options_warnqa_errorqa_switch(self): | 83 | def test_options_warnqa_errorqa_switch(self): |
@@ -85,7 +89,8 @@ class SanityOptionsTest(oeSelfTest): | |||
85 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') | 89 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') |
86 | res = bitbake("xcursor-transparent-theme", ignore_status=True) | 90 | res = bitbake("xcursor-transparent-theme", ignore_status=True) |
87 | self.delete_recipeinc('xcursor-transparent-theme') | 91 | self.delete_recipeinc('xcursor-transparent-theme') |
88 | 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) | 92 | line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.") |
93 | self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) | ||
89 | self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) | 94 | self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) |
90 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') | 95 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') |
91 | self.append_config('ERROR_QA_remove = "packages-list"') | 96 | self.append_config('ERROR_QA_remove = "packages-list"') |
@@ -93,15 +98,18 @@ class SanityOptionsTest(oeSelfTest): | |||
93 | bitbake("xcursor-transparent-theme -ccleansstate") | 98 | bitbake("xcursor-transparent-theme -ccleansstate") |
94 | res = bitbake("xcursor-transparent-theme") | 99 | res = bitbake("xcursor-transparent-theme") |
95 | self.delete_recipeinc('xcursor-transparent-theme') | 100 | self.delete_recipeinc('xcursor-transparent-theme') |
96 | self.assertTrue("WARNING: QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors." in res.output, msg=res.output) | 101 | line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.") |
102 | self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) | ||
97 | 103 | ||
98 | @testcase(278) | 104 | @testcase(278) |
99 | def test_sanity_userspace_dependency(self): | 105 | def test_sanity_userspace_dependency(self): |
100 | self.write_config('WARN_QA_append = " unsafe-references-in-binaries unsafe-references-in-scripts"') | 106 | self.write_config('WARN_QA_append = " unsafe-references-in-binaries unsafe-references-in-scripts"') |
101 | bitbake("-ccleansstate gzip nfs-utils") | 107 | bitbake("-ccleansstate gzip nfs-utils") |
102 | res = bitbake("gzip nfs-utils") | 108 | res = bitbake("gzip nfs-utils") |
103 | self.assertTrue("WARNING: QA Issue: gzip" in res.output, "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output) | 109 | line = self.getline(res, "QA Issue: gzip") |
104 | 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) | 110 | self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output) |
111 | line = self.getline(res, "QA Issue: nfs-utils") | ||
112 | self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output) | ||
105 | 113 | ||
106 | class BuildhistoryTests(BuildhistoryBase): | 114 | class BuildhistoryTests(BuildhistoryBase): |
107 | 115 | ||
@@ -114,7 +122,7 @@ class BuildhistoryTests(BuildhistoryBase): | |||
114 | def test_buildhistory_buildtime_pr_backwards(self): | 122 | def test_buildhistory_buildtime_pr_backwards(self): |
115 | self.add_command_to_tearDown('cleanup-workdir') | 123 | self.add_command_to_tearDown('cleanup-workdir') |
116 | target = 'xcursor-transparent-theme' | 124 | target = 'xcursor-transparent-theme' |
117 | error = "ERROR: QA Issue: Package version for package %s went backwards which would break package feeds from (.*-r1 to .*-r0)" % target | 125 | error = "ERROR:.*QA Issue: Package version for package %s went backwards which would break package feeds from (.*-r1.* to .*-r0.*)" % target |
118 | self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True) | 126 | self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True) |
119 | self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error) | 127 | self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error) |
120 | 128 | ||