Debian Codegraph @

tests/grouptools/groupmems/36_groupmems_user_del_user-no_gshadow_file/groupmems.test

raw
1 #!/bin/sh
2
3 set -e
4
5 cd $(dirname $0)
6
7 . ../../../common/config.sh
8 . ../../../common/log.sh
9
10 log_start "$0" "groupmems (called by a regular user) can remove an user from a group if there are no gshadow file"
11
12 save_config
13
14 # restore the files on exit
15 trap 'log_status "$0" "FAILURE"; restore_config' 0
16
17 change_config
18
19 echo "Remove the gshadow file"
20 rm -f /etc/gshadow
21
22 echo -n "myuser will call groupmems..."
23 ./run_groupmems.exp
24 echo "OK"
25
26 echo -n "Check the passwd file..."
27 ../../../common/compare_file.pl config/etc/passwd /etc/passwd
28 echo "OK"
29 echo -n "Check the group file..."
30 ../../../common/compare_file.pl data/group /etc/group
31 echo "OK"
32 echo -n "Check the shadow file..."
33 ../../../common/compare_file.pl config/etc/shadow /etc/shadow
34 echo "OK"
35 echo -n "Check the gshadow file..."
36 test ! -f /etc/gshadow
37 echo "OK"
38
39 log_status "$0" "SUCCESS"
40 restore_config
41 trap '' 0
42