chiark / gitweb /
debian: Use debhelper to generate maint scripts
[userv.git] / tests / t-config
index b4ed7f3406b7162b33ed470b9869a5033f72620b..946f7b892b302822fc1681ad9c692319e0f5060f 100755 (executable)
@@ -3,40 +3,16 @@ set -ex
 
 . tests/lib
 
-(
-    cat >/etc/userv/services.d/userv-t-env <<END
-if ( glob calling-user bin
-   & glob service-user games
-   )
-       execute printenv
-fi
-END
-)
-
-tmp="${AUTOPKGTEST_ARTIFACTS}"
-if [ "x$tmp" = x ]; then
-    rm -rf tmp
-    mkdir tmp
-    tmp=tmp
-fi
-
-bin_uid=$(id -u bin)
-bin_gid=$(id -g bin)
+prep_tmp
+prep_cuser
+prep_config_t_env games /etc/userv
 
 : '---------- test service invocation ----------'
 
-really -u bin \
+really -u $cuser \
 userv games userv-t-env >"$tmp"/env
 
-for expect in                                  \
-    'USERV_SERVICE=userv-t-env'                        \
-    'USERV_USER=bin'                           \
-    'USERV_GROUP=bin bin'                      \
-    "USERV_UID=$bin_uid"                       \
-    "USERV_GID=$bin_gid $bin_gid"              \
-; do
-    egrep "^$expect\$" "$tmp"/env
-done
+check_expected_env "$tmp"/env
 
 : '---------- test rejection (wrong calling user) ----------'