Add regression tests about adding already existsing groups/users
This commit is contained in:
parent
f4124312a1
commit
b8a5086ef0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286200
@ -10,6 +10,17 @@ group_add_gid_too_large_body() {
|
||||
${PW} groupadd -n test1 -g 9999999999999
|
||||
}
|
||||
|
||||
atf_test_case group_add_already_exists
|
||||
group_add_already_exists_body() {
|
||||
populate_etc_skel
|
||||
|
||||
atf_check -s exit:0 ${PW} groupadd foo
|
||||
atf_check -s exit:65 \
|
||||
-e inline:"pw: group name \`foo' already exists\n" \
|
||||
${PW} groupadd foo
|
||||
}
|
||||
|
||||
atf_init_test_cases() {
|
||||
atf_add_test_case group_add_gid_too_large
|
||||
atf_add_test_case group_add_already_exists
|
||||
}
|
||||
|
@ -304,6 +304,16 @@ user_add_bad_shell_body() {
|
||||
atf_check -s exit:78 -e ignore ${PW} useradd bar -s badshell
|
||||
}
|
||||
|
||||
atf_test_case user_add_already_exists
|
||||
user_add_already_exists_body() {
|
||||
populate_etc_skel
|
||||
|
||||
atf_check -s exit:0 ${PW} useradd foo
|
||||
atf_check -s exit:65 \
|
||||
-e inline:"pw: login name \`foo' already exists\n" \
|
||||
${PW} useradd foo
|
||||
}
|
||||
|
||||
atf_init_test_cases() {
|
||||
atf_add_test_case user_add
|
||||
atf_add_test_case user_add_noupdate
|
||||
@ -330,4 +340,5 @@ atf_init_test_cases() {
|
||||
atf_add_test_case user_add_uid0
|
||||
atf_add_test_case user_add_uid_too_large
|
||||
atf_add_test_case user_add_bad_shell
|
||||
atf_add_test_case user_add_already_exists
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user