]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - usr.sbin/pw/tests/pw_groupadd_test.sh
MFC r315798:
[FreeBSD/stable/10.git] / usr.sbin / pw / tests / pw_groupadd_test.sh
1 # $FreeBSD$
2
3 # Import helper functions
4 . $(atf_get_srcdir)/helper_functions.shin
5
6 atf_test_case group_add_gid_too_large
7 group_add_gid_too_large_body() {
8         populate_etc_skel
9         atf_check -s exit:64 -e inline:"pw: Bad id '9999999999999': too large\n" \
10                 ${PW} groupadd -n test1 -g 9999999999999
11 }
12
13 atf_test_case group_add_already_exists
14 group_add_already_exists_body() {
15         populate_etc_skel
16
17         atf_check -s exit:0 ${PW} groupadd foo
18         atf_check -s exit:65 \
19                 -e inline:"pw: group name \`foo' already exists\n" \
20                 ${PW} groupadd foo
21 }
22
23 atf_init_test_cases() {
24         atf_add_test_case group_add_gid_too_large
25         atf_add_test_case group_add_already_exists
26 }