diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-25 02:27:38 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-25 02:27:38 -0400 |
| commit | 08844e730f9acd0874f596bb9906f1f264824eba (patch) | |
| tree | 0e2191da3f8689f09e5c7b6e11b595b4c2e1a5e2 /scripts/testing/tests/test_boot.py | |
| parent | f50fc1def85c1dbbb0ec781be4071b7ec9285785 (diff) | |
| download | archsetup-08844e730f9acd0874f596bb9906f1f264824eba.tar.gz archsetup-08844e730f9acd0874f596bb9906f1f264824eba.zip | |
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.
Diffstat (limited to 'scripts/testing/tests/test_boot.py')
| -rw-r--r-- | scripts/testing/tests/test_boot.py | 12 |
1 files changed, 8 insertions, 4 deletions
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): |
