pw_groupadd_test.sh revision 316257
1# $FreeBSD: stable/10/usr.sbin/pw/tests/pw_groupadd_test.sh 316257 2017-03-30 06:20:58Z ngie $
2
3# Import helper functions
4. $(atf_get_srcdir)/helper_functions.shin
5
6atf_test_case group_add_gid_too_large
7group_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
13atf_test_case group_add_already_exists
14group_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
23atf_init_test_cases() {
24	atf_add_test_case group_add_gid_too_large
25	atf_add_test_case group_add_already_exists
26}
27