From 8509a01fb158867cb794de18085b4b2daa4ebb7b Mon Sep 17 00:00:00 2001 From: Katerina Koukiou Date: Wed, 13 Nov 2024 09:23:46 +0100 Subject: [PATCH] tests: add UEFI boot tests for dual booting with ubuntu --- test/check-existing-system | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/test/check-existing-system b/test/check-existing-system index 05bb15bd5..11d6f2bee 100755 --- a/test/check-existing-system +++ b/test/check-existing-system @@ -44,7 +44,7 @@ class TestExistingSystemFedora(VirtInstallMachineCase): r.check_deleted_system("Fedora Linux") -class TestFedoraPlansUseFreeSpace(VirtInstallMachineCase): +class _TestFedoraPlansUseFreeSpace(VirtInstallMachineCase): """ Test Fedora plans: https://fedoraproject.org/wiki/Test_Results:Current_Installation_Test @@ -67,6 +67,15 @@ class TestFedoraPlansUseFreeSpace(VirtInstallMachineCase): with b.wait_timeout(300): p.wait_done() + # TODO: understand who is responsible for creating Ubuntu the entry in the grub menu + # FIXME: This should be removed from the test + if self.efi: + # Add efibootmgr entry for the second OS + distro_name = self.disk_image.split("-")[0] + m.execute(f"efibootmgr -c -d /dev/vda -p 15 -L {distro_name} -l '/EFI/{distro_name}/shimx64.efi'") + # Select the Fedora grub entry for first boot + m.execute("efibootmgr -n 0001") + self.handleReboot() def verifyDualBoot(self, root_one_size=None, root_two_size=None): @@ -106,7 +115,11 @@ class TestFedoraPlansUseFreeSpace(VirtInstallMachineCase): self.assertEqual(vda1["size"], str(root_two_size) + "G") vda15 = next(part for part in vda["children"] if part["name"] == "vda15") - self.assertEqual(vda15["mountpoints"], ["/efi", "/boot/efi"]) + # TODO: add explanation why the /efi mountpoint is present when legacy boot is used + if self.efi: + self.assertEqual(vda15["mountpoints"], ["/boot/efi"]) + else: + self.assertEqual(vda15["mountpoints"], ["/efi", "/boot/efi"]) @test_plan("https://fedoraproject.org/wiki/QA:Testcase_partitioning_guided_free_space") def testScenarioUseFreeSpace(self): @@ -153,6 +166,12 @@ class TestFedoraPlansUseFreeSpace(VirtInstallMachineCase): self.install(needs_confirmation=True) self.verifyDualBoot(root_one_size=14.2, root_two_size=4.7) +class TestFedoraPlansUseFreeSpaceBIOS(_TestFedoraPlansUseFreeSpace): + efi = False + +class TestFedoraPlansUseFreeSpaceUEFI(_TestFedoraPlansUseFreeSpace): + efi = True + @nondestructive class TestExistingSystemWindows(VirtInstallMachineCase): disk_size = 20