1# $FreeBSD: head/usr.sbin/pw/tests/pw_delete.sh 273782 2014-10-28 14:54:04Z bapt $ |
2 3# Import helper functions 4. $(atf_get_srcdir)/helper_functions.shin 5 6# Test that a user can be deleted when another user is part of this 7# user's default group and does not go into an infinate loop. 8# PR: 191427 9atf_test_case rmuser_seperate_group cleanup 10rmuser_seperate_group_head() { 11 atf_set "timeout" "30" 12} 13rmuser_seperate_group_body() { 14 populate_etc_skel 15 pw -V ${HOME} useradd test || atf_fail "Creating test user" 16 pw -V ${HOME} groupmod test -M 'test,root' || \ 17 atf_fail "Modifying the group" 18 pw -V ${HOME} userdel test || atf_fail "delete the user" 19} 20 |
21atf_test_case group_do_not_delete_wheel_if_group_unkown 22group_do_not_delete_wheel_if_group_unkown_head() { 23 atf_set "descr" "Make sure we do not consider as gid 0 an unknown group" 24} |
25 |
26group_do_not_delete_wheel_if_group_unkown_body() { 27 populate_etc_skel 28 atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel 29 atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x pw -V ${HOME} groupdel -g I_do_not_exist 30 atf_check -s exit:0 -o "wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel 31} 32 |
33atf_init_test_cases() { 34 atf_add_test_case rmuser_seperate_group |
35 atf_add_test_case group_do_not_delete_wheel_if_group_unkown |
36} |