From 08844e730f9acd0874f596bb9906f1f264824eba Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 25 Jun 2026 02:27:38 -0400 Subject: test(archsetup): fix fixture scope and initramfs path in the sweep VM run #2 exposed two test bugs (archsetup itself passed clean, 53/0/0): - ScopeMismatch errors on 26 tests: the host-dependent fixtures were session-scoped, but Testinfra's host fixture is module-scoped, and a session fixture cannot request a module one. Drop those fixtures to module scope. - test_console_font_in_initramfs hardcoded /boot/initramfs-linux.img; this fleet runs linux-lts, so the image is initramfs-linux-lts.img. Pick the main (non-fallback) initramfs by glob instead. --- scripts/testing/tests/test_boot.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 c8895ae..fdbe7cb 100644 --- a/scripts/testing/tests/test_boot.py +++ b/scripts/testing/tests/test_boot.py @@ -28,10 +28,14 @@ def test_mkinitcpio_hooks(host, zfs_root): @pytest.mark.attribution("archsetup") def test_console_font_in_initramfs(host): - out = host.run( - "lsinitcpio /boot/initramfs-linux.img 2>/dev/null | grep -cE 'consolefont.psf|ter-'" - ) - assert int((out.stdout.strip() or "0")) > 0, "console font not found in initramfs" + # 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( + "ls /boot/initramfs-*.img 2>/dev/null | grep -v fallback | head -1" + ).stdout.strip() + assert img, "no initramfs image found under /boot" + out = host.run("lsinitcpio %s 2>/dev/null | grep -cE 'consolefont.psf|ter-'" % img) + assert int((out.stdout.strip() or "0")) > 0, "console font not found in %s" % img def test_nvme_module_when_nvme_present(host, has_nvme): -- cgit v1.2.3