aboutsummaryrefslogtreecommitdiff
path: root/scripts/testing/tests/conftest.py
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-25 02:27:38 -0400
committerCraig Jennings <c@cjennings.net>2026-06-25 02:27:38 -0400
commit08844e730f9acd0874f596bb9906f1f264824eba (patch)
tree0e2191da3f8689f09e5c7b6e11b595b4c2e1a5e2 /scripts/testing/tests/conftest.py
parentf50fc1def85c1dbbb0ec781be4071b7ec9285785 (diff)
downloadarchsetup-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/conftest.py')
-rw-r--r--scripts/testing/tests/conftest.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/testing/tests/conftest.py b/scripts/testing/tests/conftest.py
index c805de9..680c967 100644
--- a/scripts/testing/tests/conftest.py
+++ b/scripts/testing/tests/conftest.py
@@ -77,35 +77,35 @@ def home(target_user):
return "/home/%s" % target_user
-@pytest.fixture(scope="session")
+@pytest.fixture(scope="module")
def zfs_root(host):
"""True when the VM's root filesystem is ZFS (gates ZFS-specific checks)."""
return host.run("findmnt -n -o FSTYPE /").stdout.strip() == "zfs"
-@pytest.fixture(scope="session")
+@pytest.fixture(scope="module")
def has_nvme(host):
"""True when the VM exposes an NVMe device."""
return host.run("ls /dev/nvme0n1 2>/dev/null").rc == 0
-@pytest.fixture(scope="session")
+@pytest.fixture(scope="module")
def hyprland_installed(host):
return host.package("hyprland").is_installed
-@pytest.fixture(scope="session")
+@pytest.fixture(scope="module")
def dwm_installed(host):
return host.file("/usr/local/bin/dwm").exists
-@pytest.fixture(scope="session")
+@pytest.fixture(scope="module")
def compositor_running(host):
"""A graphical session is live (gates socket/portal checks that need one)."""
return host.run("pgrep -x Hyprland").rc == 0
-@pytest.fixture(scope="session")
+@pytest.fixture(scope="module")
def on_slirp(host):
"""QEMU user-mode networking (10.0.2.x) — no multicast, so mDNS can't work."""
return "10.0.2." in host.run("ip -4 addr show").stdout