summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/fitimage.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/fitimage.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/fitimage.py101
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"
342UBOOT_LOADADDRESS = "0x80080000" 342UBOOT_LOADADDRESS = "0x80080000"
343UBOOT_ENTRYPOINT = "0x80080000" 343UBOOT_ENTRYPOINT = "0x80080000"
344UBOOT_FIT_DESC = "A model description" 344UBOOT_FIT_DESC = "A model description"
345
346# Enable creation of Kernel fitImage
347KERNEL_IMAGETYPES += " fitImage "
348KERNEL_CLASSES = " kernel-fitimage"
349UBOOT_SIGN_ENABLE = "1"
350FIT_GENERATE_KEYS = "1"
351UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
352UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest"
353UBOOT_SIGN_KEYNAME = "cfg-oe-selftest"
354FIT_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
417MACHINE = "qemuarm"
418UBOOT_MACHINE = "am57xx_evm_defconfig"
419SPL_BINARY = "MLO"
420
421# Enable creation of the U-Boot fitImage
422UBOOT_FITIMAGE_ENABLE = "1"
423
424# (U-boot) fitImage properties
425UBOOT_LOADADDRESS = "0x80080000"
426UBOOT_ENTRYPOINT = "0x80080000"
427UBOOT_FIT_DESC = "A model description"
428KERNEL_IMAGETYPES += " fitImage "
429KERNEL_CLASSES = " kernel-fitimage "
430UBOOT_SIGN_ENABLE = "1"
431FIT_GENERATE_KEYS = "1"
432UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
433UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest"
434UBOOT_SIGN_KEYNAME = "cfg-oe-selftest"
435FIT_SIGN_INDIVIDUAL = "1"
436UBOOT_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'"
505MACHINE = "qemuarm" 412MACHINE = "qemuarm"
506UBOOT_MACHINE = "am57xx_evm_defconfig" 413UBOOT_MACHINE = "am57xx_evm_defconfig"
507SPL_BINARY = "MLO" 414SPL_BINARY = "MLO"
508# The kernel-fitimage class is a dependency even if we're only
509# creating/signing the U-Boot fitImage
510KERNEL_CLASSES = " kernel-fitimage"
511# Enable creation and signing of the U-Boot fitImage 415# Enable creation and signing of the U-Boot fitImage
512UBOOT_FITIMAGE_ENABLE = "1" 416UBOOT_FITIMAGE_ENABLE = "1"
513SPL_SIGN_ENABLE = "1" 417SPL_SIGN_ENABLE = "1"
@@ -663,8 +567,6 @@ SPL_MKIMAGE_SIGN_ARGS = "-c 'a smart cascaded U-Boot comment'"
663UBOOT_EXTLINUX = "0" 567UBOOT_EXTLINUX = "0"
664UBOOT_FIT_GENERATE_KEYS = "1" 568UBOOT_FIT_GENERATE_KEYS = "1"
665UBOOT_FIT_HASH_ALG = "sha256" 569UBOOT_FIT_HASH_ALG = "sha256"
666KERNEL_IMAGETYPES += " fitImage "
667KERNEL_CLASSES = " kernel-fitimage "
668UBOOT_SIGN_ENABLE = "1" 570UBOOT_SIGN_ENABLE = "1"
669FIT_GENERATE_KEYS = "1" 571FIT_GENERATE_KEYS = "1"
670UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" 572UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
@@ -1030,9 +932,6 @@ UBOOT_FIT_ARM_TRUSTED_FIRMWARE_ENTRYPOINT = "0x80280000"
1030MACHINE = "qemuarm" 932MACHINE = "qemuarm"
1031UBOOT_MACHINE = "am57xx_evm_defconfig" 933UBOOT_MACHINE = "am57xx_evm_defconfig"
1032SPL_BINARY = "MLO" 934SPL_BINARY = "MLO"
1033# The kernel-fitimage class is a dependency even if we're only
1034# creating/signing the U-Boot fitImage
1035KERNEL_CLASSES = " kernel-fitimage"
1036# Enable creation and signing of the U-Boot fitImage 935# Enable creation and signing of the U-Boot fitImage
1037UBOOT_FITIMAGE_ENABLE = "1" 936UBOOT_FITIMAGE_ENABLE = "1"
1038SPL_SIGN_ENABLE = "1" 937SPL_SIGN_ENABLE = "1"