From 5b7e57b18b357ad53a90ba336c2a2d802d2315b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 25 Nov 2024 15:11:36 +0100 Subject: [PATCH] tests: try dracut on Debian too It isn't default there, but it is available, so test it too. QubesOS/qubes-issues#8649 --- qubes/tests/integ/grub.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/qubes/tests/integ/grub.py b/qubes/tests/integ/grub.py index 9acde4060..d06c8c727 100644 --- a/qubes/tests/integ/grub.py +++ b/qubes/tests/integ/grub.py @@ -32,6 +32,7 @@ class GrubBase(object): virt_mode = None kernel = None + force_dracut = False def setUp(self): super(GrubBase, self).setUp() @@ -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" @@ -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?!" @@ -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"),