Skip to content

Commit

Permalink
tests: try dracut on Debian too
Browse files Browse the repository at this point in the history
It isn't default there, but it is available, so test it too.

QubesOS/qubes-issues#8649
  • Loading branch information
marmarek committed Nov 29, 2024
1 parent 039b7d3 commit 5b7e57b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions qubes/tests/integ/grub.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
class GrubBase(object):
virt_mode = None
kernel = None
force_dracut = False

def setUp(self):
super(GrubBase, self).setUp()
Expand All @@ -44,9 +45,14 @@ def setUp(self):
self.skipTest(
"Template {} not supported by this test".format(self.template)
)
if "dracut" in self.id() and not self.template.startswith("debian-"):
self.skipTest("dracut already tested in default test for Fedora")

def install_packages(self, vm):
if self.template.startswith("fedora-"):
assert (
not self.force_dracut
), "Fedora uses dracut by default already"
cmd_install1 = (
"dnf clean expire-cache && "
"dnf install -y qubes-kernel-vm-support grub2-tools"
Expand All @@ -59,6 +65,9 @@ def install_packages(self, vm):
"qubes-kernel-vm-support grub2-common"
)
cmd_install2 = "apt-get install -y linux-image-amd64"
if self.force_dracut:
cmd_install1 += " dracut"
cmd_install2 += " && dracut -f"
cmd_update_grub = "mkdir -p /boot/grub && update-grub2"
else:
assert False, "Unsupported template?!"
Expand Down Expand Up @@ -177,6 +186,14 @@ def test_010_template_based_vm(self):

self.assertXenScrubPagesEnabled(self.test_template)

def test_001_standalone_vm_dracut(self):
self.force_dracut = True
self.test_000_standalone_vm()

def test_011_template_based_vm_dracut(self):
self.force_dracut = True
self.test_010_template_based_vm()


@unittest.skipUnless(
os.path.exists("/var/lib/qubes/vm-kernels/pvgrub2"),
Expand Down

0 comments on commit 5b7e57b

Please sign in to comment.