test_edk2.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import os
  2. import infra.basetest
  3. class TestEdk2(infra.basetest.BRTest):
  4. config = \
  5. """
  6. BR2_aarch64=y
  7. BR2_neoverse_n1=y
  8. BR2_TOOLCHAIN_EXTERNAL=y
  9. BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
  10. BR2_TARGET_ROOTFS_EXT2=y
  11. BR2_TARGET_ROOTFS_EXT2_4=y
  12. # BR2_TARGET_ROOTFS_TAR is not set
  13. BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/aarch64-sbsa/assemble-flash-images support/scripts/genimage.sh"
  14. BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/qemu/aarch64-sbsa/genimage.cfg"
  15. BR2_LINUX_KERNEL=y
  16. BR2_LINUX_KERNEL_CUSTOM_VERSION=y
  17. BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.58"
  18. BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
  19. BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="support/testing/tests/boot/test_edk2/linux.config"
  20. BR2_TARGET_EDK2=y
  21. BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA=y
  22. BR2_TARGET_GRUB2=y
  23. BR2_TARGET_GRUB2_ARM64_EFI=y
  24. BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
  25. BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
  26. BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.11"
  27. BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu_sbsa"
  28. BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
  29. BR2_PACKAGE_HOST_GENIMAGE=y
  30. BR2_PACKAGE_HOST_DOSFSTOOLS=y
  31. BR2_PACKAGE_HOST_MTOOLS=y
  32. BR2_PACKAGE_HOST_QEMU=y
  33. BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
  34. """
  35. def __init__(self, names):
  36. """Setup common test variables."""
  37. super(TestEdk2, self).__init__(names)
  38. """All EDK2 releases <= edk2-stable202408 can't be fetched from git
  39. anymore due to a missing git submodule as reported by [1].
  40. Usually Buildroot fall-back using https://sources.buildroot.net
  41. thanks to BR2_BACKUP_SITE where a backup of the generated archive
  42. is available. But the BRConfigTest remove BR2_BACKUP_SITE default
  43. value while generating the .config used by TestEdk2.
  44. Replace the BR2_BACKUP_SITE override from BRConfigTest in order
  45. to continue testing EDK2 package using the usual backup site.
  46. To be removed with the next EDK2 version bump using this commit
  47. [2].
  48. [1] https://github.com/tianocore/edk2/issues/6398
  49. [2] https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701
  50. """
  51. self.config = self.config.replace('BR2_BACKUP_SITE=""\n', '')
  52. def test_run(self):
  53. hda = os.path.join(self.builddir, "images", "disk.img")
  54. flash0 = os.path.join(self.builddir, "images", "SBSA_FLASH0.fd")
  55. flash1 = os.path.join(self.builddir, "images", "SBSA_FLASH1.fd")
  56. self.emulator.boot(arch="aarch64",
  57. options=["-M", "sbsa-ref",
  58. "-cpu", "neoverse-n1",
  59. "-m", "512M",
  60. "-pflash", flash0,
  61. "-pflash", flash1,
  62. "-hda", hda])
  63. self.emulator.login()