From eb379c38383f3f46e7c19ca5d1f4980182ff7ce2 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 25 Jun 2026 19:52:46 -0400 Subject: test(archsetup): branch boot/backup checks on the ZFS boot path The Testinfra boot and backup checks asserted btrfs behavior unconditionally, so they failed on a ZFS root once the ZFS VM path started running them. ZFS boots via ZFSBootMenu, not GRUB. archsetup skips the systemd-hook switch and the mkinitcpio rebuild on ZFS, and on a ZFS+virtio VM it never edits mkinitcpio.conf at all. Branch each check on the existing zfs_root/has_nvme fixtures: assert the ZFSBootMenu EFI binary on ZFS (GRUB on btrfs), gate the mkinitcpio.conf backup on archsetup actually editing the file, and check the console font in /etc/vconsole.conf on ZFS (the initramfs on non-ZFS). Surfaced by the first full ZFS VM run, which completed archsetup cleanly (exit 0). These were the only 3 failures. --- scripts/testing/tests/test_boot.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'scripts/testing/tests/test_boot.py') diff --git a/scripts/testing/tests/test_boot.py b/scripts/testing/tests/test_boot.py index fdbe7cb..78b4404 100644 --- a/scripts/testing/tests/test_boot.py +++ b/scripts/testing/tests/test_boot.py @@ -10,8 +10,15 @@ import pytest @pytest.mark.attribution("archsetup") -def test_grub_config_exists(host): - assert host.file("/boot/grub/grub.cfg").exists +def test_bootloader_installed(host, zfs_root): + # A ZFS root boots via ZFSBootMenu (archangel installs the EFI binary under + # /efi/EFI/ZBM), so there is no GRUB; a non-ZFS root uses GRUB. + if zfs_root: + assert host.file("/efi/EFI/ZBM/zfsbootmenu.efi").exists, \ + "ZFS root must have the ZFSBootMenu EFI binary" + else: + assert host.file("/boot/grub/grub.cfg").exists, \ + "non-ZFS root must have a GRUB config" @pytest.mark.attribution("archsetup") @@ -27,7 +34,16 @@ def test_mkinitcpio_hooks(host, zfs_root): @pytest.mark.attribution("archsetup") -def test_console_font_in_initramfs(host): +def test_console_font_configured(host, zfs_root): + # archsetup sets FONT=ter-132n in /etc/vconsole.conf on every run. + assert host.file("/etc/vconsole.conf").contains("^FONT=ter-132n"), \ + "archsetup should set FONT=ter-132n in /etc/vconsole.conf" + # On non-ZFS it also rebuilds the initramfs (mkinitcpio -P) so the font is + # baked in for early boot. On ZFS that rebuild is skipped (the busybox ZFS + # hook is incompatible with the systemd-hook switch), so the font applies at + # the vconsole layer once userspace starts, not inside the initramfs. + if zfs_root: + return # Pick the main initramfs (this fleet runs linux-lts, so the name is # initramfs-linux-lts.img, not initramfs-linux.img); skip the fallback image. img = host.run( -- cgit v1.2.3