diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/sstatetests.py')
-rw-r--r-- | meta/lib/oeqa/selftest/sstatetests.py | 92 |
1 files changed, 37 insertions, 55 deletions
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py index 783d3d07b9..5814815fe3 100644 --- a/meta/lib/oeqa/selftest/sstatetests.py +++ b/meta/lib/oeqa/selftest/sstatetests.py | |||
@@ -41,13 +41,11 @@ class SStateTests(SStateBase): | |||
41 | 41 | ||
42 | @testcase(975) | 42 | @testcase(975) |
43 | def test_sstate_creation_distro_specific_pass(self): | 43 | def test_sstate_creation_distro_specific_pass(self): |
44 | targetarch = get_bb_var('TUNE_ARCH') | 44 | self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True) |
45 | self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True) | ||
46 | 45 | ||
47 | @testcase(1374) | 46 | @testcase(1374) |
48 | def test_sstate_creation_distro_specific_fail(self): | 47 | def test_sstate_creation_distro_specific_fail(self): |
49 | targetarch = get_bb_var('TUNE_ARCH') | 48 | self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False) |
50 | self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False) | ||
51 | 49 | ||
52 | @testcase(976) | 50 | @testcase(976) |
53 | def test_sstate_creation_distro_nonspecific_pass(self): | 51 | def test_sstate_creation_distro_nonspecific_pass(self): |
@@ -80,8 +78,7 @@ class SStateTests(SStateBase): | |||
80 | 78 | ||
81 | @testcase(977) | 79 | @testcase(977) |
82 | def test_cleansstate_task_distro_specific_nonspecific(self): | 80 | def test_cleansstate_task_distro_specific_nonspecific(self): |
83 | targetarch = get_bb_var('TUNE_ARCH') | 81 | targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native'] |
84 | targets = ['binutils-cross-'+ targetarch, 'binutils-native'] | ||
85 | # glibc-initial is intended only for the glibc C library | 82 | # glibc-initial is intended only for the glibc C library |
86 | if self.tclibc == 'glibc': | 83 | if self.tclibc == 'glibc': |
87 | targets.append('glibc-initial') | 84 | targets.append('glibc-initial') |
@@ -95,8 +92,7 @@ class SStateTests(SStateBase): | |||
95 | 92 | ||
96 | @testcase(1377) | 93 | @testcase(1377) |
97 | def test_cleansstate_task_distro_specific(self): | 94 | def test_cleansstate_task_distro_specific(self): |
98 | targetarch = get_bb_var('TUNE_ARCH') | 95 | targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native'] |
99 | targets = ['binutils-cross-'+ targetarch, 'binutils-native'] | ||
100 | # glibc-initial is intended only for the glibc C library | 96 | # glibc-initial is intended only for the glibc C library |
101 | if self.tclibc == 'glibc': | 97 | if self.tclibc == 'glibc': |
102 | targets.append('glibc-initial') | 98 | targets.append('glibc-initial') |
@@ -137,13 +133,11 @@ class SStateTests(SStateBase): | |||
137 | 133 | ||
138 | @testcase(175) | 134 | @testcase(175) |
139 | def test_rebuild_distro_specific_sstate_cross_native_targets(self): | 135 | def test_rebuild_distro_specific_sstate_cross_native_targets(self): |
140 | targetarch = get_bb_var('TUNE_ARCH') | 136 | self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch, 'binutils-native'], temp_sstate_location=True) |
141 | self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch, 'binutils-native'], temp_sstate_location=True) | ||
142 | 137 | ||
143 | @testcase(1372) | 138 | @testcase(1372) |
144 | def test_rebuild_distro_specific_sstate_cross_target(self): | 139 | def test_rebuild_distro_specific_sstate_cross_target(self): |
145 | targetarch = get_bb_var('TUNE_ARCH') | 140 | self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch], temp_sstate_location=True) |
146 | self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch], temp_sstate_location=True) | ||
147 | 141 | ||
148 | @testcase(1373) | 142 | @testcase(1373) |
149 | def test_rebuild_distro_specific_sstate_native_target(self): | 143 | def test_rebuild_distro_specific_sstate_native_target(self): |
@@ -158,10 +152,9 @@ class SStateTests(SStateBase): | |||
158 | self.assertTrue(len(global_config) == len(target_config), msg='Lists global_config and target_config should have the same number of elements') | 152 | self.assertTrue(len(global_config) == len(target_config), msg='Lists global_config and target_config should have the same number of elements') |
159 | self.config_sstate(temp_sstate_location=True, add_local_mirrors=[self.sstate_path]) | 153 | self.config_sstate(temp_sstate_location=True, add_local_mirrors=[self.sstate_path]) |
160 | 154 | ||
161 | # If buildhistory is enabled, we need to disable version-going-backwards QA checks for this test. It may report errors otherwise. | 155 | # If buildhistory is enabled, we need to disable version-going-backwards |
162 | if ('buildhistory' in get_bb_var('USER_CLASSES')) or ('buildhistory' in get_bb_var('INHERIT')): | 156 | # QA checks for this test. It may report errors otherwise. |
163 | remove_errors_config = 'ERROR_QA_remove = "version-going-backwards"' | 157 | self.append_config('ERROR_QA_remove = "version-going-backwards"') |
164 | self.append_config(remove_errors_config) | ||
165 | 158 | ||
166 | # For not this only checks if random sstate tasks are handled correctly as a group. | 159 | # For not this only checks if random sstate tasks are handled correctly as a group. |
167 | # In the future we should add control over what tasks we check for. | 160 | # In the future we should add control over what tasks we check for. |
@@ -242,8 +235,6 @@ class SStateTests(SStateBase): | |||
242 | manually and check using bitbake -S. | 235 | manually and check using bitbake -S. |
243 | """ | 236 | """ |
244 | 237 | ||
245 | topdir = get_bb_var('TOPDIR') | ||
246 | targetvendor = get_bb_var('TARGET_VENDOR') | ||
247 | self.write_config(""" | 238 | self.write_config(""" |
248 | MACHINE = "qemux86" | 239 | MACHINE = "qemux86" |
249 | TMPDIR = "${TOPDIR}/tmp-sstatesamehash" | 240 | TMPDIR = "${TOPDIR}/tmp-sstatesamehash" |
@@ -252,7 +243,7 @@ BUILD_OS = "linux" | |||
252 | SDKMACHINE = "x86_64" | 243 | SDKMACHINE = "x86_64" |
253 | PACKAGE_CLASSES = "package_rpm package_ipk package_deb" | 244 | PACKAGE_CLASSES = "package_rpm package_ipk package_deb" |
254 | """) | 245 | """) |
255 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash") | 246 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash") |
256 | bitbake("core-image-sato -S none") | 247 | bitbake("core-image-sato -S none") |
257 | self.write_config(""" | 248 | self.write_config(""" |
258 | MACHINE = "qemux86" | 249 | MACHINE = "qemux86" |
@@ -262,7 +253,7 @@ BUILD_OS = "linux" | |||
262 | SDKMACHINE = "i686" | 253 | SDKMACHINE = "i686" |
263 | PACKAGE_CLASSES = "package_rpm package_ipk package_deb" | 254 | PACKAGE_CLASSES = "package_rpm package_ipk package_deb" |
264 | """) | 255 | """) |
265 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") | 256 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2") |
266 | bitbake("core-image-sato -S none") | 257 | bitbake("core-image-sato -S none") |
267 | 258 | ||
268 | def get_files(d): | 259 | def get_files(d): |
@@ -275,9 +266,9 @@ PACKAGE_CLASSES = "package_rpm package_ipk package_deb" | |||
275 | continue | 266 | continue |
276 | f.extend(os.path.join(root, name) for name in files) | 267 | f.extend(os.path.join(root, name) for name in files) |
277 | return f | 268 | return f |
278 | files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/") | 269 | files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/") |
279 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") | 270 | files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/") |
280 | files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash").replace("i686-linux", "x86_64-linux").replace("i686" + targetvendor + "-linux", "x86_64" + targetvendor + "-linux", ) for x in files2] | 271 | files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash").replace("i686-linux", "x86_64-linux").replace("i686" + self.target_vendor + "-linux", "x86_64" + self.target_vendor + "-linux", ) for x in files2] |
281 | self.maxDiff = None | 272 | self.maxDiff = None |
282 | self.assertCountEqual(files1, files2) | 273 | self.assertCountEqual(files1, files2) |
283 | 274 | ||
@@ -290,18 +281,17 @@ PACKAGE_CLASSES = "package_rpm package_ipk package_deb" | |||
290 | builds, override the variables manually and check using bitbake -S. | 281 | builds, override the variables manually and check using bitbake -S. |
291 | """ | 282 | """ |
292 | 283 | ||
293 | topdir = get_bb_var('TOPDIR') | ||
294 | self.write_config(""" | 284 | self.write_config(""" |
295 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" | 285 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" |
296 | NATIVELSBSTRING = \"DistroA\" | 286 | NATIVELSBSTRING = \"DistroA\" |
297 | """) | 287 | """) |
298 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash") | 288 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash") |
299 | bitbake("core-image-sato -S none") | 289 | bitbake("core-image-sato -S none") |
300 | self.write_config(""" | 290 | self.write_config(""" |
301 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" | 291 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" |
302 | NATIVELSBSTRING = \"DistroB\" | 292 | NATIVELSBSTRING = \"DistroB\" |
303 | """) | 293 | """) |
304 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") | 294 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2") |
305 | bitbake("core-image-sato -S none") | 295 | bitbake("core-image-sato -S none") |
306 | 296 | ||
307 | def get_files(d): | 297 | def get_files(d): |
@@ -309,8 +299,8 @@ NATIVELSBSTRING = \"DistroB\" | |||
309 | for root, dirs, files in os.walk(d): | 299 | for root, dirs, files in os.walk(d): |
310 | f.extend(os.path.join(root, name) for name in files) | 300 | f.extend(os.path.join(root, name) for name in files) |
311 | return f | 301 | return f |
312 | files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/") | 302 | files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/") |
313 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") | 303 | files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/") |
314 | files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] | 304 | files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] |
315 | self.maxDiff = None | 305 | self.maxDiff = None |
316 | self.assertCountEqual(files1, files2) | 306 | self.assertCountEqual(files1, files2) |
@@ -359,14 +349,11 @@ MULTILIBS = \"\" | |||
359 | 349 | ||
360 | def sstate_allarch_samesigs(self, configA, configB): | 350 | def sstate_allarch_samesigs(self, configA, configB): |
361 | 351 | ||
362 | topdir = get_bb_var('TOPDIR') | ||
363 | targetos = get_bb_var('TARGET_OS') | ||
364 | targetvendor = get_bb_var('TARGET_VENDOR') | ||
365 | self.write_config(configA) | 352 | self.write_config(configA) |
366 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash") | 353 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash") |
367 | bitbake("world meta-toolchain -S none") | 354 | bitbake("world meta-toolchain -S none") |
368 | self.write_config(configB) | 355 | self.write_config(configB) |
369 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") | 356 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2") |
370 | bitbake("world meta-toolchain -S none") | 357 | bitbake("world meta-toolchain -S none") |
371 | 358 | ||
372 | def get_files(d): | 359 | def get_files(d): |
@@ -380,15 +367,15 @@ MULTILIBS = \"\" | |||
380 | (_, task, _, shash) = name.rsplit(".", 3) | 367 | (_, task, _, shash) = name.rsplit(".", 3) |
381 | f[os.path.join(os.path.basename(root), task)] = shash | 368 | f[os.path.join(os.path.basename(root), task)] = shash |
382 | return f | 369 | return f |
383 | files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/all" + targetvendor + "-" + targetos) | 370 | files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/all" + self.target_vendor + "-" + self.target_os) |
384 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/all" + targetvendor + "-" + targetos) | 371 | files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/all" + self.target_vendor + "-" + self.target_os) |
385 | self.maxDiff = None | 372 | self.maxDiff = None |
386 | self.assertEqual(files1, files2) | 373 | self.assertEqual(files1, files2) |
387 | 374 | ||
388 | nativesdkdir = os.path.basename(glob.glob(topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0]) | 375 | nativesdkdir = os.path.basename(glob.glob(self.topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0]) |
389 | 376 | ||
390 | files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir) | 377 | files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir) |
391 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir) | 378 | files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir) |
392 | self.maxDiff = None | 379 | self.maxDiff = None |
393 | self.assertEqual(files1, files2) | 380 | self.assertEqual(files1, files2) |
394 | 381 | ||
@@ -400,9 +387,6 @@ MULTILIBS = \"\" | |||
400 | qemux86copy machine to test this. Also include multilibs in the test. | 387 | qemux86copy machine to test this. Also include multilibs in the test. |
401 | """ | 388 | """ |
402 | 389 | ||
403 | topdir = get_bb_var('TOPDIR') | ||
404 | targetos = get_bb_var('TARGET_OS') | ||
405 | targetvendor = get_bb_var('TARGET_VENDOR') | ||
406 | self.write_config(""" | 390 | self.write_config(""" |
407 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" | 391 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" |
408 | MACHINE = \"qemux86\" | 392 | MACHINE = \"qemux86\" |
@@ -410,7 +394,7 @@ require conf/multilib.conf | |||
410 | MULTILIBS = "multilib:lib32" | 394 | MULTILIBS = "multilib:lib32" |
411 | DEFAULTTUNE_virtclass-multilib-lib32 = "x86" | 395 | DEFAULTTUNE_virtclass-multilib-lib32 = "x86" |
412 | """) | 396 | """) |
413 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash") | 397 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash") |
414 | bitbake("world meta-toolchain -S none") | 398 | bitbake("world meta-toolchain -S none") |
415 | self.write_config(""" | 399 | self.write_config(""" |
416 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" | 400 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" |
@@ -419,7 +403,7 @@ require conf/multilib.conf | |||
419 | MULTILIBS = "multilib:lib32" | 403 | MULTILIBS = "multilib:lib32" |
420 | DEFAULTTUNE_virtclass-multilib-lib32 = "x86" | 404 | DEFAULTTUNE_virtclass-multilib-lib32 = "x86" |
421 | """) | 405 | """) |
422 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") | 406 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2") |
423 | bitbake("world meta-toolchain -S none") | 407 | bitbake("world meta-toolchain -S none") |
424 | 408 | ||
425 | def get_files(d): | 409 | def get_files(d): |
@@ -433,8 +417,8 @@ DEFAULTTUNE_virtclass-multilib-lib32 = "x86" | |||
433 | if "do_build" not in name and "do_populate_sdk" not in name: | 417 | if "do_build" not in name and "do_populate_sdk" not in name: |
434 | f.append(os.path.join(root, name)) | 418 | f.append(os.path.join(root, name)) |
435 | return f | 419 | return f |
436 | files1 = get_files(topdir + "/tmp-sstatesamehash/stamps") | 420 | files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps") |
437 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps") | 421 | files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps") |
438 | files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] | 422 | files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] |
439 | self.maxDiff = None | 423 | self.maxDiff = None |
440 | self.assertCountEqual(files1, files2) | 424 | self.assertCountEqual(files1, files2) |
@@ -446,8 +430,6 @@ DEFAULTTUNE_virtclass-multilib-lib32 = "x86" | |||
446 | classes inherits should be the same. | 430 | classes inherits should be the same. |
447 | """ | 431 | """ |
448 | 432 | ||
449 | topdir = get_bb_var('TOPDIR') | ||
450 | targetvendor = get_bb_var('TARGET_VENDOR') | ||
451 | self.write_config(""" | 433 | self.write_config(""" |
452 | TMPDIR = "${TOPDIR}/tmp-sstatesamehash" | 434 | TMPDIR = "${TOPDIR}/tmp-sstatesamehash" |
453 | BB_NUMBER_THREADS = "1" | 435 | BB_NUMBER_THREADS = "1" |
@@ -458,8 +440,8 @@ DATE = "20161111" | |||
458 | INHERIT_remove = "buildstats-summary buildhistory uninative" | 440 | INHERIT_remove = "buildstats-summary buildhistory uninative" |
459 | http_proxy = "" | 441 | http_proxy = "" |
460 | """) | 442 | """) |
461 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash") | 443 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash") |
462 | self.track_for_cleanup(topdir + "/download1") | 444 | self.track_for_cleanup(self.topdir + "/download1") |
463 | bitbake("world meta-toolchain -S none") | 445 | bitbake("world meta-toolchain -S none") |
464 | self.write_config(""" | 446 | self.write_config(""" |
465 | TMPDIR = "${TOPDIR}/tmp-sstatesamehash2" | 447 | TMPDIR = "${TOPDIR}/tmp-sstatesamehash2" |
@@ -473,8 +455,8 @@ INHERIT_remove = "uninative" | |||
473 | INHERIT += "buildstats-summary buildhistory" | 455 | INHERIT += "buildstats-summary buildhistory" |
474 | http_proxy = "http://example.com/" | 456 | http_proxy = "http://example.com/" |
475 | """) | 457 | """) |
476 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") | 458 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2") |
477 | self.track_for_cleanup(topdir + "/download2") | 459 | self.track_for_cleanup(self.topdir + "/download2") |
478 | bitbake("world meta-toolchain -S none") | 460 | bitbake("world meta-toolchain -S none") |
479 | 461 | ||
480 | def get_files(d): | 462 | def get_files(d): |
@@ -486,8 +468,8 @@ http_proxy = "http://example.com/" | |||
486 | base = os.sep.join(root.rsplit(os.sep, 2)[-2:] + [name]) | 468 | base = os.sep.join(root.rsplit(os.sep, 2)[-2:] + [name]) |
487 | f[base] = shash | 469 | f[base] = shash |
488 | return f | 470 | return f |
489 | files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/") | 471 | files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/") |
490 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") | 472 | files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/") |
491 | # Remove items that are identical in both sets | 473 | # Remove items that are identical in both sets |
492 | for k,v in files1.items() & files2.items(): | 474 | for k,v in files1.items() & files2.items(): |
493 | del files1[k] | 475 | del files1[k] |
@@ -500,8 +482,8 @@ http_proxy = "http://example.com/" | |||
500 | if k in files1 and k in files2: | 482 | if k in files1 and k in files2: |
501 | print("%s differs:" % k) | 483 | print("%s differs:" % k) |
502 | print(subprocess.check_output(("bitbake-diffsigs", | 484 | print(subprocess.check_output(("bitbake-diffsigs", |
503 | topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k], | 485 | self.topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k], |
504 | topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]))) | 486 | self.topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]))) |
505 | elif k in files1 and k not in files2: | 487 | elif k in files1 and k not in files2: |
506 | print("%s in files1" % k) | 488 | print("%s in files1" % k) |
507 | elif k not in files1 and k in files2: | 489 | elif k not in files1 and k in files2: |