diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/buildoptions.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/buildoptions.py | 51 |
1 files changed, 6 insertions, 45 deletions
diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py b/meta/lib/oeqa/selftest/cases/buildoptions.py index 31dafaa9c5..767e19bd88 100644 --- a/meta/lib/oeqa/selftest/cases/buildoptions.py +++ b/meta/lib/oeqa/selftest/cases/buildoptions.py | |||
@@ -10,7 +10,6 @@ import glob as g | |||
10 | import shutil | 10 | import shutil |
11 | import tempfile | 11 | import tempfile |
12 | from oeqa.selftest.case import OESelftestTestCase | 12 | from oeqa.selftest.case import OESelftestTestCase |
13 | from oeqa.selftest.cases.buildhistory import BuildhistoryBase | ||
14 | from oeqa.core.decorator.data import skipIfMachine | 13 | from oeqa.core.decorator.data import skipIfMachine |
15 | from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars | 14 | from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars |
16 | import oeqa.utils.ftools as ftools | 15 | import oeqa.utils.ftools as ftools |
@@ -84,7 +83,7 @@ class SanityOptionsTest(OESelftestTestCase): | |||
84 | 83 | ||
85 | self.write_config("INHERIT:remove = \"report-error\"") | 84 | self.write_config("INHERIT:remove = \"report-error\"") |
86 | if "packages-list" not in get_bb_var("ERROR_QA"): | 85 | if "packages-list" not in get_bb_var("ERROR_QA"): |
87 | self.append_config("ERROR_QA:append = \" packages-list\"") | 86 | self.append_config("ERROR_QA:append:pn-xcursor-transparent-theme = \" packages-list\"") |
88 | 87 | ||
89 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') | 88 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') |
90 | self.add_command_to_tearDown('bitbake -c clean xcursor-transparent-theme') | 89 | self.add_command_to_tearDown('bitbake -c clean xcursor-transparent-theme') |
@@ -94,8 +93,8 @@ class SanityOptionsTest(OESelftestTestCase): | |||
94 | self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) | 93 | self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) |
95 | 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)) |
96 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') | 95 | self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') |
97 | self.append_config('ERROR_QA:remove = "packages-list"') | 96 | self.append_config('ERROR_QA:remove:pn-xcursor-transparent-theme = "packages-list"') |
98 | self.append_config('WARN_QA:append = " packages-list"') | 97 | self.append_config('WARN_QA:append:pn-xcursor-transparent-theme = " packages-list"') |
99 | res = bitbake("xcursor-transparent-theme -f -c package") | 98 | res = bitbake("xcursor-transparent-theme -f -c package") |
100 | self.delete_recipeinc('xcursor-transparent-theme') | 99 | self.delete_recipeinc('xcursor-transparent-theme') |
101 | line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.") | 100 | line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.") |
@@ -139,43 +138,6 @@ class SanityOptionsTest(OESelftestTestCase): | |||
139 | 138 | ||
140 | self.assertNotIn(err, ret.output) | 139 | self.assertNotIn(err, ret.output) |
141 | 140 | ||
142 | |||
143 | class BuildhistoryTests(BuildhistoryBase): | ||
144 | |||
145 | def test_buildhistory_basic(self): | ||
146 | self.run_buildhistory_operation('xcursor-transparent-theme') | ||
147 | self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR')), "buildhistory dir was not created.") | ||
148 | |||
149 | def test_buildhistory_buildtime_pr_backwards(self): | ||
150 | target = 'xcursor-transparent-theme' | ||
151 | error = "ERROR:.*QA Issue: Package version for package %s went backwards which would break package feeds \(from .*-r1.* to .*-r0.*\)" % target | ||
152 | self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True) | ||
153 | self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error) | ||
154 | |||
155 | def test_fileinfo(self): | ||
156 | self.config_buildhistory() | ||
157 | bitbake('hicolor-icon-theme') | ||
158 | history_dir = get_bb_var('BUILDHISTORY_DIR_PACKAGE', 'hicolor-icon-theme') | ||
159 | self.assertTrue(os.path.isdir(history_dir), 'buildhistory dir was not created.') | ||
160 | |||
161 | def load_bh(f): | ||
162 | d = {} | ||
163 | for line in open(f): | ||
164 | split = [s.strip() for s in line.split('=', 1)] | ||
165 | if len(split) > 1: | ||
166 | d[split[0]] = split[1] | ||
167 | return d | ||
168 | |||
169 | data = load_bh(os.path.join(history_dir, 'hicolor-icon-theme', 'latest')) | ||
170 | self.assertIn('FILELIST', data) | ||
171 | self.assertEqual(data['FILELIST'], '/usr/share/icons/hicolor/index.theme') | ||
172 | self.assertGreater(int(data['PKGSIZE']), 0) | ||
173 | |||
174 | data = load_bh(os.path.join(history_dir, 'hicolor-icon-theme-dev', 'latest')) | ||
175 | if 'FILELIST' in data: | ||
176 | self.assertEqual(data['FILELIST'], '') | ||
177 | self.assertEqual(int(data['PKGSIZE']), 0) | ||
178 | |||
179 | class ArchiverTest(OESelftestTestCase): | 141 | class ArchiverTest(OESelftestTestCase): |
180 | def test_arch_work_dir_and_export_source(self): | 142 | def test_arch_work_dir_and_export_source(self): |
181 | """ | 143 | """ |
@@ -229,11 +191,10 @@ PREMIRRORS = "\\ | |||
229 | https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \\n" | 191 | https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \\n" |
230 | """) | 192 | """) |
231 | 193 | ||
232 | bitbake("world --runall fetch") | 194 | bitbake("world --runall fetch --continue") |
233 | 195 | ||
234 | 196 | ||
235 | class Poisoning(OESelftestTestCase): | 197 | class Poisoning(OESelftestTestCase): |
236 | def test_poisoning(self): | 198 | def test_poisoning(self): |
237 | res = bitbake("poison", ignore_status=True) | 199 | # The poison recipe fails if the poisoning didn't work |
238 | self.assertNotEqual(res.status, 0) | 200 | bitbake("poison") |
239 | self.assertTrue("is unsafe for cross-compilation" in res.output) | ||