Skip to content

Commit 11218d2

Browse files
parzivaleclaude
andcommitted
tests: replace || true tests with real assertions
All 18 tests now fail if the module doesn't install what it claims: - Wayland compositors (hyprland, labwc, niri, sway, mangowc): which <bin> + wayland session desktop file present - openbox: which openbox + xsession desktop file - hyprlock: which hyprlock + /etc/pam.d/hyprlock configured - xinit: which xinit + which startx - xwayland-satellite: which xwayland-satellite + /tmp/.X11-unix created - wireplumber: which wireplumber + /etc/wireplumber conf fragment - zzz/seahorse/nvidia-settings: which <bin> - ifupdown-ng: which ifup + /etc/network/{ifupdown-ng.conf,interfaces} - resolvconf: which resolvconf + /etc/resolvconf.conf - regreet: which regreet (via systemPackages) + greetd running at rl3 - plymouth: grep splash /proc/cmdline (initrd-only module) - gvfs: dbus service file present + GIO_EXTRA_MODULES in pam_env.conf Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 331f094 commit 11218d2

19 files changed

Lines changed: 90 additions & 40 deletions

File tree

modules/programs/hyprland/test.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
machine.start()
1313
machine.wait_for_console_text("entering runlevel 2")
1414
15-
with subtest("hyprland is available"):
16-
machine.succeed("Hyprland --version || true")
15+
with subtest("Hyprland binary is in PATH"):
16+
machine.succeed("which Hyprland")
17+
18+
with subtest("wayland session desktop file is installed"):
19+
machine.succeed("test -f /run/current-system/sw/share/wayland-sessions/hyprland.desktop")
1720
1821
machine.shutdown()
1922
'';

modules/programs/hyprlock/test.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
machine.start()
1313
machine.wait_for_console_text("entering runlevel 2")
1414
15-
with subtest("hyprlock is available"):
16-
machine.succeed("hyprlock --version || true")
15+
with subtest("hyprlock binary is in PATH"):
16+
machine.succeed("which hyprlock")
17+
18+
with subtest("hyprlock PAM service is configured"):
19+
machine.succeed("test -f /etc/pam.d/hyprlock")
1720
1821
machine.shutdown()
1922
'';

modules/programs/ifupdown-ng/test.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@
1212
machine.start()
1313
machine.wait_for_console_text("entering runlevel 2")
1414
15-
with subtest("ifupdown-ng is available"):
16-
machine.succeed("ifup --version 2>&1 || true")
15+
with subtest("ifup binary is in PATH"):
16+
machine.succeed("which ifup")
17+
18+
with subtest("ifupdown-ng.conf is generated"):
19+
machine.succeed("test -f /etc/network/ifupdown-ng.conf")
20+
21+
with subtest("interfaces file is generated"):
22+
machine.succeed("test -f /etc/network/interfaces")
1723
1824
machine.shutdown()
1925
'';

modules/programs/labwc/test.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
machine.start()
1313
machine.wait_for_console_text("entering runlevel 2")
1414
15-
with subtest("labwc is available"):
16-
machine.succeed("labwc --version || true")
15+
with subtest("labwc binary is in PATH"):
16+
machine.succeed("which labwc")
17+
18+
with subtest("wayland session desktop file is installed"):
19+
machine.succeed("test -f /run/current-system/sw/share/wayland-sessions/labwc.desktop")
1720
1821
machine.shutdown()
1922
'';

modules/programs/mangowc/test.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
machine.start()
1313
machine.wait_for_console_text("entering runlevel 2")
1414
15-
with subtest("mangowc is available"):
16-
machine.succeed("mangohud --version || true")
15+
with subtest("mango binary is in PATH"):
16+
machine.succeed("which mango")
17+
18+
with subtest("wayland session desktop file is installed"):
19+
machine.succeed("test -f /run/current-system/sw/share/wayland-sessions/mango.desktop")
1720
1821
machine.shutdown()
1922
'';

modules/programs/niri/test.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
machine.start()
1313
machine.wait_for_console_text("entering runlevel 2")
1414
15-
with subtest("niri is available"):
16-
machine.succeed("niri --version || true")
15+
with subtest("niri binary is in PATH"):
16+
machine.succeed("which niri")
17+
18+
with subtest("wayland session desktop file is installed"):
19+
machine.succeed("test -f /run/current-system/sw/share/wayland-sessions/niri.desktop")
1720
1821
machine.shutdown()
1922
'';

modules/programs/nvidia-settings/test.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
machine.start()
1414
machine.wait_for_console_text("entering runlevel 2")
1515
16-
with subtest("nvidia-settings is available"):
17-
machine.succeed("nvidia-settings --version || true")
16+
with subtest("nvidia-settings binary is in PATH"):
17+
machine.succeed("which nvidia-settings")
1818
1919
machine.shutdown()
2020
'';

modules/programs/openbox/test.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
machine.start()
1313
machine.wait_for_console_text("entering runlevel 2")
1414
15-
with subtest("openbox is available"):
16-
machine.succeed("openbox --version || true")
15+
with subtest("openbox binary is in PATH"):
16+
machine.succeed("which openbox")
17+
18+
with subtest("xsession desktop file is installed"):
19+
machine.succeed("test -f /run/current-system/sw/share/xsessions/openbox.desktop")
1720
1821
machine.shutdown()
1922
'';

modules/programs/openresolv/test.nix

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
with subtest("resolvconf.conf is installed"):
2121
machine.succeed("test -f /etc/resolvconf.conf")
2222
23-
with subtest("resolvconf lists interfaces without error"):
24-
machine.succeed("resolvconf -l 2>&1; true")
25-
2623
machine.shutdown()
2724
'';
2825
};

modules/programs/plymouth/test.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{ ... }:
22
{
33
config.testing.tests.plymouth.plymouth = {
4+
# Plymouth is an initrd-only splash screen module — the binary and config
5+
# live in the initrd, not the running system. The only runtime effect is
6+
# the "splash" kernel parameter being present on the cmdline.
47
nodes.machine =
58
{ ... }:
69
{
@@ -12,8 +15,8 @@
1215
machine.start()
1316
machine.wait_for_console_text("entering runlevel 2")
1417
15-
with subtest("plymouth binary is available"):
16-
machine.succeed("plymouth --version || true")
18+
with subtest("splash kernel parameter is set"):
19+
machine.succeed("grep -q splash /proc/cmdline")
1720
1821
machine.shutdown()
1922
'';

0 commit comments

Comments
 (0)