Skip to content

Commit

Permalink
Merge pull request #512 from KKoukiou/test-efi
Browse files Browse the repository at this point in the history
tests: add UEFI boot tests for dual booting with ubuntu
  • Loading branch information
KKoukiou authored Nov 14, 2024
2 parents d1b161a + 2f3c83f commit 7b2699c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/anacondalib.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def handleReboot(self):
p.reboot()

# The installed machine does not need to skip the nologin check
os.environ["TEST_ALLOW_NOLOGIN"] = "false"
self.addCleanup(lambda: os.environ["TEST_ALLOW_NOLOGIN"] == "true")
del os.environ["TEST_ALLOW_NOLOGIN"]
self.addCleanup(lambda: os.environ.__setitem__("TEST_ALLOW_NOLOGIN", "1"))
self.machine.wait_reboot()

def selectBootMenuEntry(self, entry):
Expand Down
23 changes: 21 additions & 2 deletions test/check-existing-system
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -67,6 +67,15 @@ class TestFedoraPlansUseFreeSpace(VirtInstallMachineCase):
with b.wait_timeout(300):
p.wait_done()

# FIXME: https://bugzilla.redhat.com/show_bug.cgi?id=2325707
# 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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -152,6 +165,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
Expand Down

0 comments on commit 7b2699c

Please sign in to comment.