chiark / gitweb /
64e2b83cd847ea315ccfce7c0e1b049ddd070021
[userv.git] / tests / t-config
1 #!/bin/bash
2 set -ex
3
4 . tests/lib
5
6 (
7     cat >/etc/userv/services.d/userv-t-config <<END
8 if ( glob calling-user bin
9    & glob service-user games
10    )
11         execute printenv
12 fi
13 END
14 )
15
16 tmp="${AUTOPKGTEST_ARTIFACTS}"
17 if [ "x$tmp" = x ]; then
18     rm -rf tmp
19     mkdir tmp
20     tmp=tmp
21 fi
22
23 bin_uid=$(id -u bin)
24 bin_gid=$(id -g bin)
25
26 really -u bin \
27 userv games userv-t-config >"$tmp"/env
28
29 for expect in                                   \
30     'USERV_SERVICE=userv-t-config'              \
31     'USERV_USER=bin'                            \
32     'USERV_GROUP=bin bin'                       \
33     "USERV_UID=$bin_uid"                        \
34     "USERV_GID=$bin_gid $bin_gid"               \
35 ; do
36     egrep "^$expect\$" "$tmp"/env
37 done
38
39 expect_output 255 '' \
40 really -u daemon \
41 userv games userv-t-config
42
43 echo ok.