Skip to content

Commit 1f94afd

Browse files
committed
tests: add grub tests for archlinux too
Test for QubesOS/qubes-linux-utils#124 Exclude pvgrub2 test, as Arch is also using zstd.
1 parent e7d49e3 commit 1f94afd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

qubes/tests/integ/grub.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def setUp(self):
4141
supported = True
4242
elif self.template.startswith("debian-"):
4343
supported = True
44+
elif self.template.startswith("archlinux"):
45+
supported = True
4446
if not supported:
4547
self.skipTest(
4648
"Template {} not supported by this test".format(self.template)
@@ -76,6 +78,12 @@ def install_packages(self, vm):
7678
cmd_install1 += " dracut"
7779
cmd_install2 += " && dracut -f"
7880
cmd_update_grub = "mkdir -p /boot/grub && update-grub2"
81+
elif self.template.startswith("archlinux"):
82+
cmd_install1 = (
83+
"pacman -S --noconfirm linux grub && grub-install /dev/xvda"
84+
)
85+
cmd_install2 = "pacman -S --noconfirm qubes-vm-kernel-support"
86+
cmd_update_grub = "grub-mkconfig -o /boot/grub/grub.cfg"
7987
else:
8088
assert False, "Unsupported template?!"
8189

@@ -102,6 +110,11 @@ def get_kernel_version(self, vm):
102110
"dpkg-query --showformat='${Package}\\n' --show "
103111
"'linux-image-*-amd64'|sort -V|tail -1|cut -d - -f 3-"
104112
)
113+
elif self.template.startswith("archlinux"):
114+
cmd_get_kernel_version = (
115+
"pacman -Q linux|sort -V|tail -1|cut -d ' ' -f 2"
116+
"|sed 's/\.arch/-arch/'"
117+
)
105118
else:
106119
raise RuntimeError("Unsupported template?!")
107120

@@ -226,6 +239,13 @@ def setUp(self):
226239
"Fedora kernel is compressed with zstd "
227240
"which is not supported by pvgrub2"
228241
)
242+
if "archlinux" in self.template:
243+
# requires a zstd decompression filter in grub
244+
# (see grub_file_filter_id enum in grub sources)
245+
self.skipTest(
246+
"Archlinux kernel is compressed with zstd "
247+
"which is not supported by pvgrub2"
248+
)
229249
super().setUp()
230250

231251

0 commit comments

Comments
 (0)