Debian Codegraph @

tests/grouptools/gpasswd/68_gpasswd-M_myuser/gpasswd.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" "gpasswd can be used by root to change one group's passwd"
11
12
13 # no testsuite password
14 # root password: rootF00barbaz
15 # myuser password: myuserF00barbaz
16
17 save_config
18
19 # restore the files on exit
20 trap 'log_status "$0" "FAILURE"; restore_config' 0
21
22 change_config
23
24 ./gpasswd.exp myuser users '$ '
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 config/etc/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 ../../../common/compare_file.pl config/etc/gshadow /etc/gshadow
37 echo "OK"
38
39 log_status "$0" "SUCCESS"
40 restore_config
41 trap '' 0
42