diff options
Diffstat (limited to 'tests/tests/failures/groupmod/06_groupmod_-g_no_gshadow_open_failure/groupmod.test')
-rwxr-xr-x | tests/tests/failures/groupmod/06_groupmod_-g_no_gshadow_open_failure/groupmod.test | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/tests/failures/groupmod/06_groupmod_-g_no_gshadow_open_failure/groupmod.test b/tests/tests/failures/groupmod/06_groupmod_-g_no_gshadow_open_failure/groupmod.test new file mode 100755 index 0000000..c4d41de --- /dev/null +++ b/tests/tests/failures/groupmod/06_groupmod_-g_no_gshadow_open_failure/groupmod.test @@ -0,0 +1,39 @@ +#!/bin/sh + +set -e + +cd $(dirname $0) + +. ../../../common/config.sh +. ../../../common/log.sh + +log_start "$0" "groupmod does not need to open gshadow to change a gid" + +save_config + +# restore the files on exit +trap 'log_status "$0" "FAILURE"; restore_config' 0 + +change_config + +echo -n "Change group foo (groupmod -g 1001 foo)..." +LD_PRELOAD=../../../common/open_RDWR_failure.so FAILURE_PATH=/etc/gshadow groupmod -g 1001 foo +echo "OK" + +echo -n "Check the passwd file..." +../../../common/compare_file.pl config/etc/passwd /etc/passwd +echo "OK" +echo -n "Check the group file..." +../../../common/compare_file.pl data/group /etc/group +echo "OK" +echo -n "Check the shadow file..." +../../../common/compare_file.pl config/etc/shadow /etc/shadow +echo "OK" +echo -n "Check the gshadow file..." +../../../common/compare_file.pl config/etc/gshadow /etc/gshadow +echo "OK" + +log_status "$0" "SUCCESS" +restore_config +trap '' 0 + |