diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/fitimage.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/fitimage.py | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 5af9ea8afc..dd177e0b04 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py | |||
@@ -342,16 +342,6 @@ UBOOT_FITIMAGE_ENABLE = "1" | |||
342 | UBOOT_LOADADDRESS = "0x80080000" | 342 | UBOOT_LOADADDRESS = "0x80080000" |
343 | UBOOT_ENTRYPOINT = "0x80080000" | 343 | UBOOT_ENTRYPOINT = "0x80080000" |
344 | UBOOT_FIT_DESC = "A model description" | 344 | UBOOT_FIT_DESC = "A model description" |
345 | |||
346 | # Enable creation of Kernel fitImage | ||
347 | KERNEL_IMAGETYPES += " fitImage " | ||
348 | KERNEL_CLASSES = " kernel-fitimage" | ||
349 | UBOOT_SIGN_ENABLE = "1" | ||
350 | FIT_GENERATE_KEYS = "1" | ||
351 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" | ||
352 | UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" | ||
353 | UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" | ||
354 | FIT_SIGN_INDIVIDUAL = "1" | ||
355 | """ | 345 | """ |
356 | self.write_config(config) | 346 | self.write_config(config) |
357 | 347 | ||
@@ -396,89 +386,6 @@ FIT_SIGN_INDIVIDUAL = "1" | |||
396 | "Fields in Image Tree Source File %s did not match, error in finding %s" | 386 | "Fields in Image Tree Source File %s did not match, error in finding %s" |
397 | % (fitimage_its_path, its_field_check[field_index])) | 387 | % (fitimage_its_path, its_field_check[field_index])) |
398 | 388 | ||
399 | def test_uboot_sign_fit_image(self): | ||
400 | """ | ||
401 | Summary: Check if Uboot FIT image and Image Tree Source | ||
402 | (its) are built and the Image Tree Source has the | ||
403 | correct fields, in the scenario where the Kernel | ||
404 | is also creating/signing it's fitImage. | ||
405 | Expected: 1. u-boot-fitImage and u-boot-its can be built | ||
406 | 2. The type, load address, entrypoint address and | ||
407 | default values of U-boot image are correct in the | ||
408 | Image Tree Source. Not all the fields are tested, | ||
409 | only the key fields that wont vary between | ||
410 | different architectures. | ||
411 | Product: oe-core | ||
412 | Author: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com> | ||
413 | based on work by Usama Arif <usama.arif@arm.com> | ||
414 | """ | ||
415 | config = """ | ||
416 | # We need at least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set | ||
417 | MACHINE = "qemuarm" | ||
418 | UBOOT_MACHINE = "am57xx_evm_defconfig" | ||
419 | SPL_BINARY = "MLO" | ||
420 | |||
421 | # Enable creation of the U-Boot fitImage | ||
422 | UBOOT_FITIMAGE_ENABLE = "1" | ||
423 | |||
424 | # (U-boot) fitImage properties | ||
425 | UBOOT_LOADADDRESS = "0x80080000" | ||
426 | UBOOT_ENTRYPOINT = "0x80080000" | ||
427 | UBOOT_FIT_DESC = "A model description" | ||
428 | KERNEL_IMAGETYPES += " fitImage " | ||
429 | KERNEL_CLASSES = " kernel-fitimage " | ||
430 | UBOOT_SIGN_ENABLE = "1" | ||
431 | FIT_GENERATE_KEYS = "1" | ||
432 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" | ||
433 | UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" | ||
434 | UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" | ||
435 | FIT_SIGN_INDIVIDUAL = "1" | ||
436 | UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" | ||
437 | """ | ||
438 | self.write_config(config) | ||
439 | |||
440 | # The U-Boot fitImage is created as part of the U-Boot recipe | ||
441 | bitbake("virtual/bootloader") | ||
442 | |||
443 | deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') | ||
444 | machine = get_bb_var('MACHINE') | ||
445 | fitimage_its_path = os.path.join(deploy_dir_image, | ||
446 | "u-boot-its-%s" % (machine,)) | ||
447 | fitimage_path = os.path.join(deploy_dir_image, | ||
448 | "u-boot-fitImage-%s" % (machine,)) | ||
449 | |||
450 | self.assertExists(fitimage_its_path, "%s image tree source doesn't exist" % (fitimage_its_path)) | ||
451 | self.assertExists(fitimage_path, "%s FIT image doesn't exist" % (fitimage_path)) | ||
452 | |||
453 | # Check that the type, load address, entrypoint address and default | ||
454 | # values for kernel and ramdisk in Image Tree Source are as expected. | ||
455 | # The order of fields in the below array is important. Not all the | ||
456 | # fields are tested, only the key fields that wont vary between | ||
457 | # different architectures. | ||
458 | its_field_check = [ | ||
459 | 'description = "A model description";', | ||
460 | 'type = "standalone";', | ||
461 | 'load = <0x80080000>;', | ||
462 | 'entry = <0x80080000>;', | ||
463 | 'default = "conf";', | ||
464 | 'loadables = "uboot";', | ||
465 | 'fdt = "fdt";' | ||
466 | ] | ||
467 | |||
468 | with open(fitimage_its_path) as its_file: | ||
469 | field_index = 0 | ||
470 | for line in its_file: | ||
471 | if field_index == len(its_field_check): | ||
472 | break | ||
473 | if its_field_check[field_index] in line: | ||
474 | field_index +=1 | ||
475 | |||
476 | if field_index != len(its_field_check): # if its equal, the test passed | ||
477 | self.assertTrue(field_index == len(its_field_check), | ||
478 | "Fields in Image Tree Source File %s did not match, error in finding %s" | ||
479 | % (fitimage_its_path, its_field_check[field_index])) | ||
480 | |||
481 | |||
482 | def test_sign_standalone_uboot_fit_image(self): | 389 | def test_sign_standalone_uboot_fit_image(self): |
483 | """ | 390 | """ |
484 | Summary: Check if U-Boot FIT image and Image Tree Source (its) are | 391 | Summary: Check if U-Boot FIT image and Image Tree Source (its) are |
@@ -505,9 +412,6 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" | |||
505 | MACHINE = "qemuarm" | 412 | MACHINE = "qemuarm" |
506 | UBOOT_MACHINE = "am57xx_evm_defconfig" | 413 | UBOOT_MACHINE = "am57xx_evm_defconfig" |
507 | SPL_BINARY = "MLO" | 414 | SPL_BINARY = "MLO" |
508 | # The kernel-fitimage class is a dependency even if we're only | ||
509 | # creating/signing the U-Boot fitImage | ||
510 | KERNEL_CLASSES = " kernel-fitimage" | ||
511 | # Enable creation and signing of the U-Boot fitImage | 415 | # Enable creation and signing of the U-Boot fitImage |
512 | UBOOT_FITIMAGE_ENABLE = "1" | 416 | UBOOT_FITIMAGE_ENABLE = "1" |
513 | SPL_SIGN_ENABLE = "1" | 417 | SPL_SIGN_ENABLE = "1" |
@@ -663,8 +567,6 @@ SPL_MKIMAGE_SIGN_ARGS = "-c 'a smart cascaded U-Boot comment'" | |||
663 | UBOOT_EXTLINUX = "0" | 567 | UBOOT_EXTLINUX = "0" |
664 | UBOOT_FIT_GENERATE_KEYS = "1" | 568 | UBOOT_FIT_GENERATE_KEYS = "1" |
665 | UBOOT_FIT_HASH_ALG = "sha256" | 569 | UBOOT_FIT_HASH_ALG = "sha256" |
666 | KERNEL_IMAGETYPES += " fitImage " | ||
667 | KERNEL_CLASSES = " kernel-fitimage " | ||
668 | UBOOT_SIGN_ENABLE = "1" | 570 | UBOOT_SIGN_ENABLE = "1" |
669 | FIT_GENERATE_KEYS = "1" | 571 | FIT_GENERATE_KEYS = "1" |
670 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" | 572 | UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" |
@@ -1030,9 +932,6 @@ UBOOT_FIT_ARM_TRUSTED_FIRMWARE_ENTRYPOINT = "0x80280000" | |||
1030 | MACHINE = "qemuarm" | 932 | MACHINE = "qemuarm" |
1031 | UBOOT_MACHINE = "am57xx_evm_defconfig" | 933 | UBOOT_MACHINE = "am57xx_evm_defconfig" |
1032 | SPL_BINARY = "MLO" | 934 | SPL_BINARY = "MLO" |
1033 | # The kernel-fitimage class is a dependency even if we're only | ||
1034 | # creating/signing the U-Boot fitImage | ||
1035 | KERNEL_CLASSES = " kernel-fitimage" | ||
1036 | # Enable creation and signing of the U-Boot fitImage | 935 | # Enable creation and signing of the U-Boot fitImage |
1037 | UBOOT_FITIMAGE_ENABLE = "1" | 936 | UBOOT_FITIMAGE_ENABLE = "1" |
1038 | SPL_SIGN_ENABLE = "1" | 937 | SPL_SIGN_ENABLE = "1" |