diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-08 16:56:32 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-09 16:31:55 +0100 |
commit | c7592b01478def091b6787412390c61e7ce0a0cd (patch) | |
tree | 3c2f26480c6e16fae0ad65b032e3dc0fccfca71b /meta/lib/oeqa/selftest/cases/bbtests.py | |
parent | c0dc72bad92e2e4dc0aedb48b969709f821baf73 (diff) | |
download | poky-c7592b01478def091b6787412390c61e7ce0a0cd.tar.gz |
oeqa: Drop OETestID
These IDs refer to testopia which we're no longer using. We would now use the test
names to definitively reference tests and the IDs can be dropped, along with their
supporting code.
(From OE-Core rev: 8e2d0575e4e7036b5f60e632f377a8ab2b96ead8)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/bbtests.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/bbtests.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py index c503e4eedd..1b83741974 100644 --- a/meta/lib/oeqa/selftest/cases/bbtests.py +++ b/meta/lib/oeqa/selftest/cases/bbtests.py | |||
@@ -5,7 +5,6 @@ import oeqa.utils.ftools as ftools | |||
5 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars | 5 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars |
6 | 6 | ||
7 | from oeqa.selftest.case import OESelftestTestCase | 7 | from oeqa.selftest.case import OESelftestTestCase |
8 | from oeqa.core.decorator.oeid import OETestID | ||
9 | 8 | ||
10 | class BitbakeTests(OESelftestTestCase): | 9 | class BitbakeTests(OESelftestTestCase): |
11 | 10 | ||
@@ -14,13 +13,11 @@ class BitbakeTests(OESelftestTestCase): | |||
14 | if line in l: | 13 | if line in l: |
15 | return l | 14 | return l |
16 | 15 | ||
17 | @OETestID(789) | ||
18 | # Test bitbake can run from the <builddir>/conf directory | 16 | # Test bitbake can run from the <builddir>/conf directory |
19 | def test_run_bitbake_from_dir_1(self): | 17 | def test_run_bitbake_from_dir_1(self): |
20 | os.chdir(os.path.join(self.builddir, 'conf')) | 18 | os.chdir(os.path.join(self.builddir, 'conf')) |
21 | self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir") | 19 | self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir") |
22 | 20 | ||
23 | @OETestID(790) | ||
24 | # Test bitbake can run from the <builddir>'s parent directory | 21 | # Test bitbake can run from the <builddir>'s parent directory |
25 | def test_run_bitbake_from_dir_2(self): | 22 | def test_run_bitbake_from_dir_2(self): |
26 | my_env = os.environ.copy() | 23 | my_env = os.environ.copy() |
@@ -36,7 +33,6 @@ class BitbakeTests(OESelftestTestCase): | |||
36 | self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from /tmp/") | 33 | self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from /tmp/") |
37 | 34 | ||
38 | 35 | ||
39 | @OETestID(806) | ||
40 | def test_event_handler(self): | 36 | def test_event_handler(self): |
41 | self.write_config("INHERIT += \"test_events\"") | 37 | self.write_config("INHERIT += \"test_events\"") |
42 | result = bitbake('m4-native') | 38 | result = bitbake('m4-native') |
@@ -46,7 +42,6 @@ class BitbakeTests(OESelftestTestCase): | |||
46 | self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output) | 42 | self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output) |
47 | self.assertFalse('Test for bb.event.InvalidEvent' in result.output, msg = "\"Test for bb.event.InvalidEvent\" message found during bitbake process. bitbake output: %s" % result.output) | 43 | self.assertFalse('Test for bb.event.InvalidEvent' in result.output, msg = "\"Test for bb.event.InvalidEvent\" message found during bitbake process. bitbake output: %s" % result.output) |
48 | 44 | ||
49 | @OETestID(103) | ||
50 | def test_local_sstate(self): | 45 | def test_local_sstate(self): |
51 | bitbake('m4-native') | 46 | bitbake('m4-native') |
52 | bitbake('m4-native -cclean') | 47 | bitbake('m4-native -cclean') |
@@ -54,17 +49,14 @@ class BitbakeTests(OESelftestTestCase): | |||
54 | find_setscene = re.search("m4-native.*do_.*_setscene", result.output) | 49 | find_setscene = re.search("m4-native.*do_.*_setscene", result.output) |
55 | self.assertTrue(find_setscene, msg = "No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output ) | 50 | self.assertTrue(find_setscene, msg = "No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output ) |
56 | 51 | ||
57 | @OETestID(105) | ||
58 | def test_bitbake_invalid_recipe(self): | 52 | def test_bitbake_invalid_recipe(self): |
59 | result = bitbake('-b asdf', ignore_status=True) | 53 | result = bitbake('-b asdf', ignore_status=True) |
60 | self.assertTrue("ERROR: Unable to find any recipe file matching 'asdf'" in result.output, msg = "Though asdf recipe doesn't exist, bitbake didn't output any err. message. bitbake output: %s" % result.output) | 54 | self.assertTrue("ERROR: Unable to find any recipe file matching 'asdf'" in result.output, msg = "Though asdf recipe doesn't exist, bitbake didn't output any err. message. bitbake output: %s" % result.output) |
61 | 55 | ||
62 | @OETestID(107) | ||
63 | def test_bitbake_invalid_target(self): | 56 | def test_bitbake_invalid_target(self): |
64 | result = bitbake('asdf', ignore_status=True) | 57 | result = bitbake('asdf', ignore_status=True) |
65 | self.assertTrue("ERROR: Nothing PROVIDES 'asdf'" in result.output, msg = "Though no 'asdf' target exists, bitbake didn't output any err. message. bitbake output: %s" % result.output) | 58 | self.assertTrue("ERROR: Nothing PROVIDES 'asdf'" in result.output, msg = "Though no 'asdf' target exists, bitbake didn't output any err. message. bitbake output: %s" % result.output) |
66 | 59 | ||
67 | @OETestID(106) | ||
68 | def test_warnings_errors(self): | 60 | def test_warnings_errors(self): |
69 | result = bitbake('-b asdf', ignore_status=True) | 61 | result = bitbake('-b asdf', ignore_status=True) |
70 | find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages* shown", result.output) | 62 | find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages* shown", result.output) |
@@ -72,7 +64,6 @@ class BitbakeTests(OESelftestTestCase): | |||
72 | self.assertTrue(find_warnings, msg="Did not find the mumber of warnings at the end of the build:\n" + result.output) | 64 | self.assertTrue(find_warnings, msg="Did not find the mumber of warnings at the end of the build:\n" + result.output) |
73 | self.assertTrue(find_errors, msg="Did not find the mumber of errors at the end of the build:\n" + result.output) | 65 | self.assertTrue(find_errors, msg="Did not find the mumber of errors at the end of the build:\n" + result.output) |
74 | 66 | ||
75 | @OETestID(108) | ||
76 | def test_invalid_patch(self): | 67 | def test_invalid_patch(self): |
77 | # This patch should fail to apply. | 68 | # This patch should fail to apply. |
78 | self.write_recipeinc('man-db', 'FILESEXTRAPATHS_prepend := "${THISDIR}/files:"\nSRC_URI += "file://0001-Test-patch-here.patch"') | 69 | self.write_recipeinc('man-db', 'FILESEXTRAPATHS_prepend := "${THISDIR}/files:"\nSRC_URI += "file://0001-Test-patch-here.patch"') |
@@ -83,7 +74,6 @@ class BitbakeTests(OESelftestTestCase): | |||
83 | line = self.getline(result, "Function failed: patch_do_patch") | 74 | line = self.getline(result, "Function failed: patch_do_patch") |
84 | self.assertTrue(line and line.startswith("ERROR:"), msg = "Incorrectly formed patch application didn't fail. bitbake output: %s" % result.output) | 75 | self.assertTrue(line and line.startswith("ERROR:"), msg = "Incorrectly formed patch application didn't fail. bitbake output: %s" % result.output) |
85 | 76 | ||
86 | @OETestID(1354) | ||
87 | def test_force_task_1(self): | 77 | def test_force_task_1(self): |
88 | # test 1 from bug 5875 | 78 | # test 1 from bug 5875 |
89 | test_recipe = 'zlib' | 79 | test_recipe = 'zlib' |
@@ -108,7 +98,6 @@ class BitbakeTests(OESelftestTestCase): | |||
108 | ret = bitbake(test_recipe) | 98 | ret = bitbake(test_recipe) |
109 | self.assertIn('task do_package_write_rpm:', ret.output, 'Task do_package_write_rpm did not re-executed.') | 99 | self.assertIn('task do_package_write_rpm:', ret.output, 'Task do_package_write_rpm did not re-executed.') |
110 | 100 | ||
111 | @OETestID(163) | ||
112 | def test_force_task_2(self): | 101 | def test_force_task_2(self): |
113 | # test 2 from bug 5875 | 102 | # test 2 from bug 5875 |
114 | test_recipe = 'zlib' | 103 | test_recipe = 'zlib' |
@@ -121,7 +110,6 @@ class BitbakeTests(OESelftestTestCase): | |||
121 | for task in look_for_tasks: | 110 | for task in look_for_tasks: |
122 | self.assertIn(task, result.output, msg="Couldn't find %s task.") | 111 | self.assertIn(task, result.output, msg="Couldn't find %s task.") |
123 | 112 | ||
124 | @OETestID(167) | ||
125 | def test_bitbake_g(self): | 113 | def test_bitbake_g(self): |
126 | result = bitbake('-g core-image-minimal') | 114 | result = bitbake('-g core-image-minimal') |
127 | for f in ['pn-buildlist', 'recipe-depends.dot', 'task-depends.dot']: | 115 | for f in ['pn-buildlist', 'recipe-depends.dot', 'task-depends.dot']: |
@@ -129,7 +117,6 @@ class BitbakeTests(OESelftestTestCase): | |||
129 | self.assertTrue('Task dependencies saved to \'task-depends.dot\'' in result.output, msg = "No task dependency \"task-depends.dot\" file was generated for the given task target. bitbake output: %s" % result.output) | 117 | self.assertTrue('Task dependencies saved to \'task-depends.dot\'' in result.output, msg = "No task dependency \"task-depends.dot\" file was generated for the given task target. bitbake output: %s" % result.output) |
130 | self.assertTrue('busybox' in ftools.read_file(os.path.join(self.builddir, 'task-depends.dot')), msg = "No \"busybox\" dependency found in task-depends.dot file.") | 118 | self.assertTrue('busybox' in ftools.read_file(os.path.join(self.builddir, 'task-depends.dot')), msg = "No \"busybox\" dependency found in task-depends.dot file.") |
131 | 119 | ||
132 | @OETestID(899) | ||
133 | def test_image_manifest(self): | 120 | def test_image_manifest(self): |
134 | bitbake('core-image-minimal') | 121 | bitbake('core-image-minimal') |
135 | bb_vars = get_bb_vars(["DEPLOY_DIR_IMAGE", "IMAGE_LINK_NAME"], "core-image-minimal") | 122 | bb_vars = get_bb_vars(["DEPLOY_DIR_IMAGE", "IMAGE_LINK_NAME"], "core-image-minimal") |
@@ -138,7 +125,6 @@ class BitbakeTests(OESelftestTestCase): | |||
138 | manifest = os.path.join(deploydir, imagename + ".manifest") | 125 | manifest = os.path.join(deploydir, imagename + ".manifest") |
139 | self.assertTrue(os.path.islink(manifest), msg="No manifest file created for image. It should have been created in %s" % manifest) | 126 | self.assertTrue(os.path.islink(manifest), msg="No manifest file created for image. It should have been created in %s" % manifest) |
140 | 127 | ||
141 | @OETestID(168) | ||
142 | def test_invalid_recipe_src_uri(self): | 128 | def test_invalid_recipe_src_uri(self): |
143 | data = 'SRC_URI = "file://invalid"' | 129 | data = 'SRC_URI = "file://invalid"' |
144 | self.write_recipeinc('man-db', data) | 130 | self.write_recipeinc('man-db', data) |
@@ -159,7 +145,6 @@ doesn't exist, yet no error message encountered. bitbake output: %s" % result.ou | |||
159 | self.assertTrue(line and line.startswith("ERROR:"), msg = "\"invalid\" file \ | 145 | self.assertTrue(line and line.startswith("ERROR:"), msg = "\"invalid\" file \ |
160 | doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output) | 146 | doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output) |
161 | 147 | ||
162 | @OETestID(171) | ||
163 | def test_rename_downloaded_file(self): | 148 | def test_rename_downloaded_file(self): |
164 | # TODO unique dldir instead of using cleanall | 149 | # TODO unique dldir instead of using cleanall |
165 | # TODO: need to set sstatedir? | 150 | # TODO: need to set sstatedir? |
@@ -177,29 +162,24 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" | |||
177 | self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % dl_dir) | 162 | self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % dl_dir) |
178 | self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % dl_dir) | 163 | self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % dl_dir) |
179 | 164 | ||
180 | @OETestID(1028) | ||
181 | def test_environment(self): | 165 | def test_environment(self): |
182 | self.write_config("TEST_ENV=\"localconf\"") | 166 | self.write_config("TEST_ENV=\"localconf\"") |
183 | result = runCmd('bitbake -e | grep TEST_ENV=') | 167 | result = runCmd('bitbake -e | grep TEST_ENV=') |
184 | self.assertTrue('localconf' in result.output, msg = "bitbake didn't report any value for TEST_ENV variable. To test, run 'bitbake -e | grep TEST_ENV='") | 168 | self.assertTrue('localconf' in result.output, msg = "bitbake didn't report any value for TEST_ENV variable. To test, run 'bitbake -e | grep TEST_ENV='") |
185 | 169 | ||
186 | @OETestID(1029) | ||
187 | def test_dry_run(self): | 170 | def test_dry_run(self): |
188 | result = runCmd('bitbake -n m4-native') | 171 | result = runCmd('bitbake -n m4-native') |
189 | self.assertEqual(0, result.status, "bitbake dry run didn't run as expected. %s" % result.output) | 172 | self.assertEqual(0, result.status, "bitbake dry run didn't run as expected. %s" % result.output) |
190 | 173 | ||
191 | @OETestID(1030) | ||
192 | def test_just_parse(self): | 174 | def test_just_parse(self): |
193 | result = runCmd('bitbake -p') | 175 | result = runCmd('bitbake -p') |
194 | self.assertEqual(0, result.status, "errors encountered when parsing recipes. %s" % result.output) | 176 | self.assertEqual(0, result.status, "errors encountered when parsing recipes. %s" % result.output) |
195 | 177 | ||
196 | @OETestID(1031) | ||
197 | def test_version(self): | 178 | def test_version(self): |
198 | result = runCmd('bitbake -s | grep wget') | 179 | result = runCmd('bitbake -s | grep wget') |
199 | find = re.search(r"wget *:([0-9a-zA-Z\.\-]+)", result.output) | 180 | find = re.search(r"wget *:([0-9a-zA-Z\.\-]+)", result.output) |
200 | self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output) | 181 | self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output) |
201 | 182 | ||
202 | @OETestID(1032) | ||
203 | def test_prefile(self): | 183 | def test_prefile(self): |
204 | preconf = os.path.join(self.builddir, 'conf/prefile.conf') | 184 | preconf = os.path.join(self.builddir, 'conf/prefile.conf') |
205 | self.track_for_cleanup(preconf) | 185 | self.track_for_cleanup(preconf) |
@@ -210,7 +190,6 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" | |||
210 | result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') | 190 | result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') |
211 | self.assertTrue('localconf' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration.") | 191 | self.assertTrue('localconf' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration.") |
212 | 192 | ||
213 | @OETestID(1033) | ||
214 | def test_postfile(self): | 193 | def test_postfile(self): |
215 | postconf = os.path.join(self.builddir, 'conf/postfile.conf') | 194 | postconf = os.path.join(self.builddir, 'conf/postfile.conf') |
216 | self.track_for_cleanup(postconf) | 195 | self.track_for_cleanup(postconf) |
@@ -219,12 +198,10 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" | |||
219 | result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=') | 198 | result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=') |
220 | self.assertTrue('postfile' in result.output, "Postconfigure file \"postfile.conf\"was not taken into consideration.") | 199 | self.assertTrue('postfile' in result.output, "Postconfigure file \"postfile.conf\"was not taken into consideration.") |
221 | 200 | ||
222 | @OETestID(1034) | ||
223 | def test_checkuri(self): | 201 | def test_checkuri(self): |
224 | result = runCmd('bitbake -c checkuri m4') | 202 | result = runCmd('bitbake -c checkuri m4') |
225 | self.assertEqual(0, result.status, msg = "\"checkuri\" task was not executed. bitbake output: %s" % result.output) | 203 | self.assertEqual(0, result.status, msg = "\"checkuri\" task was not executed. bitbake output: %s" % result.output) |
226 | 204 | ||
227 | @OETestID(1035) | ||
228 | def test_continue(self): | 205 | def test_continue(self): |
229 | self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\" | 206 | self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\" |
230 | SSTATE_DIR = \"${TOPDIR}/download-selftest\" | 207 | SSTATE_DIR = \"${TOPDIR}/download-selftest\" |
@@ -239,7 +216,6 @@ INHERIT_remove = \"report-error\" | |||
239 | continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1)) | 216 | continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1)) |
240 | self.assertLess(errorpos,continuepos, msg = "bitbake didn't pass do_fail_task. bitbake output: %s" % result.output) | 217 | self.assertLess(errorpos,continuepos, msg = "bitbake didn't pass do_fail_task. bitbake output: %s" % result.output) |
241 | 218 | ||
242 | @OETestID(1119) | ||
243 | def test_non_gplv3(self): | 219 | def test_non_gplv3(self): |
244 | self.write_config('INCOMPATIBLE_LICENSE = "GPLv3"') | 220 | self.write_config('INCOMPATIBLE_LICENSE = "GPLv3"') |
245 | result = bitbake('selftest-ed', ignore_status=True) | 221 | result = bitbake('selftest-ed', ignore_status=True) |
@@ -248,7 +224,6 @@ INHERIT_remove = \"report-error\" | |||
248 | self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv3'))) | 224 | self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv3'))) |
249 | self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv2'))) | 225 | self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv2'))) |
250 | 226 | ||
251 | @OETestID(1422) | ||
252 | def test_setscene_only(self): | 227 | def test_setscene_only(self): |
253 | """ Bitbake option to restore from sstate only within a build (i.e. execute no real tasks, only setscene)""" | 228 | """ Bitbake option to restore from sstate only within a build (i.e. execute no real tasks, only setscene)""" |
254 | test_recipe = 'ed' | 229 | test_recipe = 'ed' |
@@ -263,7 +238,6 @@ INHERIT_remove = \"report-error\" | |||
263 | self.assertIn('_setscene', task, 'A task different from _setscene ran: %s.\n' | 238 | self.assertIn('_setscene', task, 'A task different from _setscene ran: %s.\n' |
264 | 'Executed tasks were: %s' % (task, str(tasks))) | 239 | 'Executed tasks were: %s' % (task, str(tasks))) |
265 | 240 | ||
266 | @OETestID(1425) | ||
267 | def test_bbappend_order(self): | 241 | def test_bbappend_order(self): |
268 | """ Bitbake should bbappend to recipe in a predictable order """ | 242 | """ Bitbake should bbappend to recipe in a predictable order """ |
269 | test_recipe = 'ed' | 243 | test_recipe = 'ed' |