From: Ben Harris Date: Sat, 2 Aug 2025 23:08:48 +0000 (+0100) Subject: Run t-persist test with service user as root as well X-Git-Tag: userv-1.2.3~1^2~8 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=8aadafb4608d23f8c9e346925e4938024a6e0ed0;p=userv.git Run t-persist test with service user as root as well Services running as root should survive restarts just as well as ones running as other users. But I think start-stop-daemon will get this wrong. --- diff --git a/tests/t-persist b/tests/t-persist index b886f85..2f4708a 100755 --- a/tests/t-persist +++ b/tests/t-persist @@ -3,24 +3,26 @@ set -ex . tests/lib -coproc userv --override 'execute cat -vet' games spong +for service_user in games root; do + coproc userv --override 'execute cat -vet' "$service_user" spong -stdout=${COPROC[0]} -stdin=${COPROC[1]} + stdout=${COPROC[0]} + stdin=${COPROC[1]} -print_expect_reply () { - local m=$1 - local got - echo >&$stdin "$m" - read <&$stdout got - local exp="$(printf '%s$\n' "$m")" - test "$got" = "$exp" -} + print_expect_reply () { + local m=$1 + local got + echo >&$stdin "$m" + read <&$stdout got + local exp="$(printf '%s$\n' "$m")" + test "$got" = "$exp" + } -print_expect_reply hi + print_expect_reply hi -service userv restart + service userv restart -print_expect_reply ho + print_expect_reply ho +done echo ok.