Debian Codegraph @

tests/grouptools/chgpasswd/04_chgpasswd_no_gshadow_entry/chgpasswd.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" "chgpasswd changes the group entry if there are no entries in gshadow"
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 -n "Change nogroup's and disk's password..."
20 echo 'nogroup:test
21 disk:test2' | chgpasswd
22 echo "OK"
23
24 echo -n "Check the passwd file..."
25 ../../../common/compare_file.pl config/etc/passwd /etc/passwd
26 echo "OK"
27 echo -n "Check the group file..."
28 ../../../common/compare_file.pl data/group /etc/group
29 echo "OK"
30 echo -n "Check the shadow file..."
31 ../../../common/compare_file.pl config/etc/shadow /etc/shadow
32 echo "OK"
33 echo -n "Check the gshadow file..."
34 ../../../common/compare_file.pl data/gshadow /etc/gshadow
35 echo "OK"
36
37 log_status "$0" "SUCCESS"
38 restore_config
39 trap '' 0
40