aboutsummaryrefslogtreecommitdiff
path: root/scripts/testing/lib/validation.sh
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-11 12:57:49 -0500
committerCraig Jennings <c@cjennings.net>2026-06-11 12:57:49 -0500
commite1b271ef9f1c7310a7cad6105ec2e889db0f6bc1 (patch)
tree83b2cb92f28a64f0754abf3b6c51e7cf7461e48e /scripts/testing/lib/validation.sh
parent9168e0de3223e9110abee970073f599bce42d5af (diff)
downloadarchsetup-e1b271ef9f1c7310a7cad6105ec2e889db0f6bc1.tar.gz
archsetup-e1b271ef9f1c7310a7cad6105ec2e889db0f6bc1.zip
fix(testing): lingering check could never pass — ls output broke the capture
The check captured 'ls path && echo yes', so a present linger file produced 'path\nyes', which never string-equals yes — every run warned regardless of actual state. Forensics on a kept VM showed lingering correctly enabled all along (file present mid-install, loginctl Linger=yes, logind healthy): the original VM-artifact hypothesis was wrong, archsetup's enable-linger calls were always fine. test -e captures cleanly; verified returning 'yes' against the live VM.
Diffstat (limited to 'scripts/testing/lib/validation.sh')
-rw-r--r--scripts/testing/lib/validation.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/testing/lib/validation.sh b/scripts/testing/lib/validation.sh
index f6e7fbf..91270ef 100644
--- a/scripts/testing/lib/validation.sh
+++ b/scripts/testing/lib/validation.sh
@@ -687,9 +687,12 @@ validate_all_services() {
validate_service_optional "cups" "enabled"
validate_service_optional "docker" "enabled"
validate_service_optional "tailscaled" "enabled"
- # Syncthing uses user service (not system), check lingering is enabled
+ # Syncthing uses user service (not system), check lingering is enabled.
+ # test -e, not ls: ls prints the path on success, so the old capture held
+ # "path\nyes" and could never equal "yes" — the check warned on every
+ # run, even with lingering correctly enabled.
step "Checking user lingering for syncthing"
- local linger_enabled=$(ssh_cmd "ls /var/lib/systemd/linger/cjennings 2>/dev/null && echo yes || echo no")
+ local linger_enabled=$(ssh_cmd "test -e /var/lib/systemd/linger/cjennings && echo yes || echo no")
if [ "$linger_enabled" = "yes" ]; then
validation_pass "User lingering enabled for syncthing user service"
else