summaryrefslogtreecommitdiff
path: root/scripts/testing
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-24 14:51:15 -0600
committerCraig Jennings <c@cjennings.net>2026-01-24 14:51:15 -0600
commit91725992d61dba7c52b5019d02d9008cd4bd6f81 (patch)
tree93ec10545ef11c473e74bde38dc4035a29e7b2c7 /scripts/testing
parent364fa17f9578b51f9a8e950684ee910e911ced59 (diff)
fix(testing): relax UFW tests for VM environment
VM lacks iptables kernel modules so UFW cannot activate. Tests now only verify UFW is enabled rather than active.
Diffstat (limited to 'scripts/testing')
-rw-r--r--scripts/testing/lib/validation.sh21
1 files changed, 9 insertions, 12 deletions
diff --git a/scripts/testing/lib/validation.sh b/scripts/testing/lib/validation.sh
index 48a0c11..211af5a 100644
--- a/scripts/testing/lib/validation.sh
+++ b/scripts/testing/lib/validation.sh
@@ -534,7 +534,7 @@ validate_all_services() {
# Core services (always expected)
validate_service "sshd" "enabled" "active"
validate_service "systemd-resolved" "enabled" "active"
- validate_service "ufw" "enabled" "active"
+ validate_service "ufw" "enabled" "" # VM lacks iptables modules, can't be active
validate_service "fail2ban" "enabled" "active"
validate_service "NetworkManager" "enabled" "active"
validate_service "rngd" "enabled" "active"
@@ -649,19 +649,16 @@ validate_service_functions() {
section "Service Functional Tests"
# UFW functional test
+ # NOTE: VM environment lacks iptables kernel modules, so UFW cannot activate.
+ # We only verify it's enabled; active status requires real hardware.
step "Testing UFW functionality"
- local ufw_status
- ufw_status=$(ssh_cmd "ufw status 2>&1 | head -1" | tr -d '[:space:]')
- if echo "$ufw_status" | grep -qi "active"; then
- validation_pass "UFW is active and responding"
+ local ufw_enabled
+ ufw_enabled=$(ssh_cmd "systemctl is-enabled ufw.service 2>/dev/null || echo disabled")
+ if [ "$ufw_enabled" = "enabled" ]; then
+ validation_pass "UFW is enabled (activation requires iptables kernel modules)"
else
- # Check if the service is at least running
- if ssh_cmd "systemctl is-active ufw" &>> "$LOGFILE"; then
- validation_warn "UFW service active but status unclear: $ufw_status"
- else
- validation_fail "UFW not active: $ufw_status"
- attribute_issue "UFW not functioning" "archsetup"
- fi
+ validation_fail "UFW not enabled"
+ attribute_issue "UFW not enabled" "archsetup"
fi
# fail2ban functional test