From ced91c43c464d624b3396ae44894022fd33aecaf Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 10 Jun 2026 18:19:28 -0500 Subject: fix(testing): skip environment-impossible checks instead of warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four warnings fired on every headless VM run, training the reader to ignore the warning count: the Hyprland socket and portal queries (no graphical login), the mDNS ping (slirp passes no multicast), and docker-not-responding (enabled but deliberately not started pre-reboot). Each now detects its precondition and logs a skip that counts nowhere; the warn paths stay for the cases that are real (compositor running without a socket, portal running but unqueryable, mDNS failing on real networking, docker active but dead). The lingering warning stays — it needs its own investigation. --- scripts/testing/lib/validation.sh | 43 +++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) (limited to 'scripts/testing') diff --git a/scripts/testing/lib/validation.sh b/scripts/testing/lib/validation.sh index c705419..2734aef 100644 --- a/scripts/testing/lib/validation.sh +++ b/scripts/testing/lib/validation.sh @@ -46,6 +46,14 @@ validation_warn() { ((VALIDATION_WARNINGS++)) || true } +# A check whose precondition can't hold in this environment (headless VM, +# slirp networking, pre-reboot state). Logged for the record, counted nowhere +# — a warning that fires on every run trains readers to ignore warnings. +validation_skip() { + local test_name="$1" + info "SKIP: $test_name" +} + # Attribute an issue to archsetup or base install attribute_issue() { local issue="$1" @@ -499,11 +507,15 @@ validate_hyprland_config() { validate_hyprland_socket() { step "Checking Hyprland IPC socket" - # Note: This only works if Hyprland is running. Skip if no display. + # The socket only exists while the compositor runs. In the headless test + # VM nobody logs in graphically, so a missing socket with no Hyprland + # process is the expected state, not a finding. if ssh_cmd "test -S /tmp/hypr/*/.socket.sock 2>/dev/null"; then validation_pass "Hyprland socket exists" + elif ! ssh_cmd "pgrep -x Hyprland >/dev/null 2>&1"; then + validation_skip "Hyprland not running (headless) — socket check not applicable" else - validation_warn "Hyprland socket not found (Hyprland may not be running)" + validation_warn "Hyprland running but IPC socket not found" fi } @@ -531,6 +543,10 @@ validate_portal_dark_mode() { if [ "$color_scheme" = "1" ]; then validation_pass "Settings portal returns dark mode (color-scheme=1)" + elif [ -z "$color_scheme" ] && ! ssh_cmd "pgrep -f xdg-desktop-portal >/dev/null 2>&1"; then + # No graphical login → no portal service → nothing to query. The + # conf-file checks above already validated what install controls. + validation_skip "Settings portal not running (headless) — query not applicable" elif [ -z "$color_scheme" ]; then validation_warn "Could not query Settings portal (portal may not be running)" else @@ -585,12 +601,18 @@ validate_avahi() { if [ "$status" = "enabled" ]; then validation_pass "avahi-daemon is enabled" - # Full-stack mDNS test: ping hostname.local - local hostname=$(ssh_cmd "hostname") - if ssh_cmd "ping -c 1 -W 2 ${hostname}.local" &>> "$LOGFILE"; then - validation_pass "mDNS working (${hostname}.local responds to ping)" + # Full-stack mDNS test: ping hostname.local. QEMU user-mode (slirp, + # 10.0.2.x) doesn't pass multicast, so mDNS genuinely can't resolve + # there — only run the ping on real networking. + if ssh_cmd "ip -4 addr show" 2>/dev/null | grep -q "10\.0\.2\."; then + validation_skip "mDNS ping not possible on slirp networking (no multicast)" else - validation_warn "mDNS ping failed (avahi may need time to propagate)" + local hostname=$(ssh_cmd "hostname") + if ssh_cmd "ping -c 1 -W 2 ${hostname}.local" &>> "$LOGFILE"; then + validation_pass "mDNS working (${hostname}.local responds to ping)" + else + validation_warn "mDNS ping failed (avahi may need time to propagate)" + fi fi else # This might be OK if avahi was pre-installed @@ -795,8 +817,13 @@ validate_service_functions() { step "Testing Docker functionality" if ssh_cmd "docker info" &>> "$LOGFILE"; then validation_pass "Docker is responding" + elif ! ssh_cmd "systemctl is-active --quiet docker"; then + # archsetup enables docker for next boot (enable, not enable --now, + # by design — the daemon is heavy). Validation runs pre-reboot, so + # enabled-but-not-started is the correct installed state. + validation_skip "Docker enabled but not started (starts on boot by design)" else - validation_warn "Docker enabled but not responding" + validation_warn "Docker active but not responding" fi fi } -- cgit v1.2.3