aboutsummaryrefslogtreecommitdiff
path: root/scripts/testing
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/testing')
-rw-r--r--scripts/testing/lib/validation.sh43
1 files changed, 35 insertions, 8 deletions
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
}