]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - usr.sbin/pw/tests/pw_groupdel.sh
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / usr.sbin / pw / tests / pw_groupdel.sh
1 # $FreeBSD$
2
3 # Import helper functions
4 . $(atf_get_srcdir)/helper_functions.shin
5
6
7 # Test to make sure we do not accidentially delete wheel when trying to delete
8 # an unknown group
9 atf_test_case group_do_not_delete_wheel_if_group_unknown
10 group_do_not_delete_wheel_if_group_unknown_head() {
11         atf_set "descr" "Make sure we do not consider gid 0 an unknown group"
12 }
13 group_do_not_delete_wheel_if_group_unknown_body() {
14         populate_etc_skel
15         atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel
16         atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x \
17                 ${PW} groupdel -g I_do_not_exist
18         atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel
19 }
20
21
22 atf_init_test_cases() {
23         atf_add_test_case group_do_not_delete_wheel_if_group_unknown
24 }