Debian Codegraph @

tests/grouptools/groupadd/10_groupadd_-o_add_existing_GID/groupadd.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" "groupadd -o accepts to add a group with an already used GID"
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 "Add group bar, GID 1003 (groupadd -g 1003 -o bar)..."
20 groupadd -g 1003 -o bar
21 echo "OK"
22
23 echo -n "Check the passwd file..."
24 ../../../common/compare_file.pl config/etc/passwd /etc/passwd
25 echo "OK"
26 echo -n "Check the group file..."
27 ../../../common/compare_file.pl data/group /etc/group
28 echo "OK"
29 echo -n "Check the shadow file..."
30 ../../../common/compare_file.pl config/etc/shadow /etc/shadow
31 echo "OK"
32 echo -n "Check the gshadow file..."
33 ../../../common/compare_file.pl data/gshadow /etc/gshadow
34 echo "OK"
35
36 log_status "$0" "SUCCESS"
37 restore_config
38 trap '' 0
39