From 8aadafb4608d23f8c9e346925e4938024a6e0ed0 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sun, 3 Aug 2025 00:08:48 +0100 Subject: [PATCH] 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. --- tests/t-persist | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) 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. -- 2.30.2