diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-08-02 13:02:53 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-08-02 13:02:53 +0000 |
commit | b8a5086ef0d85787700f7e94c08ed148a1fa9f2c (patch) | |
tree | 9fd8540b3b66c65a5119df8a006eca67ad8ba9f3 /usr.sbin/pw | |
parent | f4124312a11597ce61b918879185984e8bcb427a (diff) | |
download | src-b8a5086ef0d85787700f7e94c08ed148a1fa9f2c.tar.gz src-b8a5086ef0d85787700f7e94c08ed148a1fa9f2c.zip |
Add regression tests about adding already existsing groups/users
Notes
Notes:
svn path=/head/; revision=286200
Diffstat (limited to 'usr.sbin/pw')
-rwxr-xr-x | usr.sbin/pw/tests/pw_groupadd.sh | 11 | ||||
-rwxr-xr-x | usr.sbin/pw/tests/pw_useradd.sh | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/usr.sbin/pw/tests/pw_groupadd.sh b/usr.sbin/pw/tests/pw_groupadd.sh index 9c8fdf12ebe8..5fa7bef0fdf1 100755 --- a/usr.sbin/pw/tests/pw_groupadd.sh +++ b/usr.sbin/pw/tests/pw_groupadd.sh @@ -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 } diff --git a/usr.sbin/pw/tests/pw_useradd.sh b/usr.sbin/pw/tests/pw_useradd.sh index 401769bcbdb1..f42980d76cc2 100755 --- a/usr.sbin/pw/tests/pw_useradd.sh +++ b/usr.sbin/pw/tests/pw_useradd.sh @@ -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 } |