Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: try dracut on Debian too #638

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 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,12 @@ 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 +63,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 +184,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