From 47fc9e5509837260310cd7e41335fade29b587b1 Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Wed, 6 Nov 2024 23:38:06 +0100 Subject: [PATCH] support/testing/{test_edk2, test_grub, test_iso9660, test_fwts}: fix edk2 download All EDK2 releases <= edk2-stable202408 can't be fetched from git anymore due to a missing git submodule as reported by [1]. Usually Buildroot fall-back using https://sources.buildroot.net thanks to BR2_BACKUP_SITE where a backup of the generated archive is available. But the BRConfigTest remove BR2_BACKUP_SITE default value while generating the .config used by runtime tests. See [2]. Replace the BR2_BACKUP_SITE override from BRConfigTest in order to continue testing EDK2 package using the usual backup site. This workaround needs to be removed with the next EDK2 version bump using this commit [3]. Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/8258995977 (TestGrubX8664EFI) https://gitlab.com/buildroot.org/buildroot/-/jobs/8258995962 (TestGrubi386EFI) https://gitlab.com/buildroot.org/buildroot/-/jobs/8258995455 (TestFwts) https://gitlab.com/buildroot.org/buildroot/-/jobs/8258995427 (TestIso9660Grub2Hybrid) https://gitlab.com/buildroot.org/buildroot/-/jobs/8258995416 (TestIso9660Grub2EFI) https://gitlab.com/buildroot.org/buildroot/-/jobs/8258992621 (TestEdk2) https://gitlab.com/buildroot.org/buildroot/-/jobs/8258990697 (TestGrubAArch64EFI) [1] https://github.com/tianocore/edk2/issues/6398 [2] https://gitlab.com/buildroot.org/buildroot/-/commit/559bb33ae71dd2358ca2314ccb24b56cc3809fc1 [3] https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 Signed-off-by: Romain Naour [Julien: insert link to [2] in commit log] Signed-off-by: Julien Olivain --- support/testing/tests/boot/test_edk2.py | 22 ++++++++ support/testing/tests/boot/test_grub.py | 66 ++++++++++++++++++++++ support/testing/tests/fs/test_iso9660.py | 44 +++++++++++++++ support/testing/tests/package/test_fwts.py | 22 ++++++++ 4 files changed, 154 insertions(+) diff --git a/support/testing/tests/boot/test_edk2.py b/support/testing/tests/boot/test_edk2.py index e6b7855284..39d7a4dbcc 100644 --- a/support/testing/tests/boot/test_edk2.py +++ b/support/testing/tests/boot/test_edk2.py @@ -35,6 +35,28 @@ class TestEdk2(infra.basetest.BRTest): BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y """ + def __init__(self, names): + """Setup common test variables.""" + super(TestEdk2, self).__init__(names) + """All EDK2 releases <= edk2-stable202408 can't be fetched from git + anymore due to a missing git submodule as reported by [1]. + + Usually Buildroot fall-back using https://sources.buildroot.net + thanks to BR2_BACKUP_SITE where a backup of the generated archive + is available. But the BRConfigTest remove BR2_BACKUP_SITE default + value while generating the .config used by TestEdk2. + + Replace the BR2_BACKUP_SITE override from BRConfigTest in order + to continue testing EDK2 package using the usual backup site. + + To be removed with the next EDK2 version bump using this commit + [2]. + + [1] https://github.com/tianocore/edk2/issues/6398 + [2] https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 + """ + self.config = self.config.replace('BR2_BACKUP_SITE=""\n', '') + def test_run(self): hda = os.path.join(self.builddir, "images", "disk.img") flash0 = os.path.join(self.builddir, "images", "SBSA_FLASH0.fd") diff --git a/support/testing/tests/boot/test_grub.py b/support/testing/tests/boot/test_grub.py index c753a16c34..c6e86f7b71 100644 --- a/support/testing/tests/boot/test_grub.py +++ b/support/testing/tests/boot/test_grub.py @@ -58,6 +58,28 @@ class TestGrubi386EFI(infra.basetest.BRTest): BR2_PACKAGE_HOST_DOSFSTOOLS=y """.format(infra.filepath("tests/boot/test_grub/post-build.sh")) + def __init__(self, names): + """Setup common test variables.""" + super(TestGrubi386EFI, self).__init__(names) + """All EDK2 releases <= edk2-stable202408 can't be fetched from git + anymore due to a missing git submodule as reported by [1]. + + Usually Buildroot fall-back using https://sources.buildroot.net + thanks to BR2_BACKUP_SITE where a backup of the generated archive + is available. But the BRConfigTest remove BR2_BACKUP_SITE default + value while generating the .config used by TestGrubi386EFI. + + Replace the BR2_BACKUP_SITE override from BRConfigTest in order + to continue testing EDK2 package using the usual backup site. + + To be removed with the next EDK2 version bump using this commit + [2]. + + [1] https://github.com/tianocore/edk2/issues/6398 + [2] https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 + """ + self.config = self.config.replace('BR2_BACKUP_SITE=""\n', '') + def test_run(self): hda = os.path.join(self.builddir, "images", "disk.img") bios = os.path.join(self.builddir, "images", "OVMF.fd") @@ -109,6 +131,28 @@ class TestGrubX8664EFI(infra.basetest.BRTest): BR2_PACKAGE_HOST_DOSFSTOOLS=y """.format(infra.filepath("tests/boot/test_grub/post-build.sh")) + def __init__(self, names): + """Setup common test variables.""" + super(TestGrubX8664EFI, self).__init__(names) + """All EDK2 releases <= edk2-stable202408 can't be fetched from git + anymore due to a missing git submodule as reported by [1]. + + Usually Buildroot fall-back using https://sources.buildroot.net + thanks to BR2_BACKUP_SITE where a backup of the generated archive + is available. But the BRConfigTest remove BR2_BACKUP_SITE default + value while generating the .config used by TestGrubX8664EFI. + + Replace the BR2_BACKUP_SITE override from BRConfigTest in order + to continue testing EDK2 package using the usual backup site. + + To be removed with the next EDK2 version bump using this commit + [2]. + + [1] https://github.com/tianocore/edk2/issues/6398 + [2] https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 + """ + self.config = self.config.replace('BR2_BACKUP_SITE=""\n', '') + def test_run(self): hda = os.path.join(self.builddir, "images", "disk.img") bios = os.path.join(self.builddir, "images", "OVMF.fd") @@ -158,6 +202,28 @@ class TestGrubAArch64EFI(infra.basetest.BRTest): """.format(post_image=infra.filepath("tests/boot/test_grub/post-image-aarch64-efi.sh"), linux_fragment=infra.filepath("tests/boot/test_grub/linux-aarch64-efi.config")) + def __init__(self, names): + """Setup common test variables.""" + super(TestGrubAArch64EFI, self).__init__(names) + """All EDK2 releases <= edk2-stable202408 can't be fetched from git + anymore due to a missing git submodule as reported by [1]. + + Usually Buildroot fall-back using https://sources.buildroot.net + thanks to BR2_BACKUP_SITE where a backup of the generated archive + is available. But the BRConfigTest remove BR2_BACKUP_SITE default + value while generating the .config used by TestGrubAArch64EFI. + + Replace the BR2_BACKUP_SITE override from BRConfigTest in order + to continue testing EDK2 package using the usual backup site. + + To be removed with the next EDK2 version bump using this commit + [2]. + + [1] https://github.com/tianocore/edk2/issues/6398 + [2] https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 + """ + self.config = self.config.replace('BR2_BACKUP_SITE=""\n', '') + def test_run(self): hda = os.path.join(self.builddir, "images", "disk.img") bios = os.path.join(self.builddir, "images", "QEMU_EFI.fd") diff --git a/support/testing/tests/fs/test_iso9660.py b/support/testing/tests/fs/test_iso9660.py index 3d08f2e895..6f8ca06de3 100644 --- a/support/testing/tests/fs/test_iso9660.py +++ b/support/testing/tests/fs/test_iso9660.py @@ -135,6 +135,28 @@ class TestIso9660Grub2EFI(infra.basetest.BRTest): """.format(infra.filepath("conf/grub2-efi.cfg"), infra.filepath("conf/grub2.cfg")) + def __init__(self, names): + """Setup common test variables.""" + super(TestIso9660Grub2EFI, self).__init__(names) + """All EDK2 releases <= edk2-stable202408 can't be fetched from git + anymore due to a missing git submodule as reported by [1]. + + Usually Buildroot fall-back using https://sources.buildroot.net + thanks to BR2_BACKUP_SITE where a backup of the generated archive + is available. But the BRConfigTest remove BR2_BACKUP_SITE default + value while generating the .config used by TestIso9660Grub2EFI. + + Replace the BR2_BACKUP_SITE override from BRConfigTest in order + to continue testing EDK2 package using the usual backup site. + + To be removed with the next EDK2 version bump using this commit + [2]. + + [1] https://github.com/tianocore/edk2/issues/6398 + [2] https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 + """ + self.config = self.config.replace('BR2_BACKUP_SITE=""\n', '') + def test_run(self): exit_code = test_mount_internal_external(self.emulator, self.builddir, internal=True, @@ -163,6 +185,28 @@ class TestIso9660Grub2Hybrid(infra.basetest.BRTest): """.format(infra.filepath("conf/grub2-efi.cfg"), infra.filepath("conf/grub2.cfg")) + def __init__(self, names): + """Setup common test variables.""" + super(TestIso9660Grub2Hybrid, self).__init__(names) + """All EDK2 releases <= edk2-stable202408 can't be fetched from git + anymore due to a missing git submodule as reported by [1]. + + Usually Buildroot fall-back using https://sources.buildroot.net + thanks to BR2_BACKUP_SITE where a backup of the generated archive + is available. But the BRConfigTest remove BR2_BACKUP_SITE default + value while generating the .config used by TestIso9660Grub2Hybrid. + + Replace the BR2_BACKUP_SITE override from BRConfigTest in order + to continue testing EDK2 package using the usual backup site. + + To be removed with the next EDK2 version bump using this commit + [2]. + + [1] https://github.com/tianocore/edk2/issues/6398 + [2] https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 + """ + self.config = self.config.replace('BR2_BACKUP_SITE=""\n', '') + def test_run(self): exit_code = test_mount_internal_external(self.emulator, self.builddir, internal=True, diff --git a/support/testing/tests/package/test_fwts.py b/support/testing/tests/package/test_fwts.py index 5b79a17e33..6e2b6f50ba 100644 --- a/support/testing/tests/package/test_fwts.py +++ b/support/testing/tests/package/test_fwts.py @@ -38,6 +38,28 @@ class TestFwts(infra.basetest.BRTest): BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y """ + def __init__(self, names): + """Setup common test variables.""" + super(TestFwts, self).__init__(names) + """All EDK2 releases <= edk2-stable202408 can't be fetched from git + anymore due to a missing git submodule as reported by [1]. + + Usually Buildroot fall-back using https://sources.buildroot.net + thanks to BR2_BACKUP_SITE where a backup of the generated archive + is available. But the BRConfigTest remove BR2_BACKUP_SITE default + value while generating the .config used by TestFwts. + + Replace the BR2_BACKUP_SITE override from BRConfigTest in order + to continue testing EDK2 package using the usual backup site. + + To be removed with the next EDK2 version bump using this commit + [2]. + + [1] https://github.com/tianocore/edk2/issues/6398 + [2] https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 + """ + self.config = self.config.replace('BR2_BACKUP_SITE=""\n', '') + def test_run(self): hda = os.path.join(self.builddir, "images", "disk.img") flash0 = os.path.join(self.builddir, "images", "SBSA_FLASH0.fd")