summaryrefslogtreecommitdiffstats
path: root/pw/tests/pw_useradd.sh
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-08-02 13:02:53 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-08-02 13:02:53 +0000
commit86b70b831eed513183b8ad9ad2dc3c46acb483f0 (patch)
treecc4c19ca3e9b0107de834bf18153d54a4a6804ce /pw/tests/pw_useradd.sh
parenta210ad360e3bebc7be4230459986be42e8490810 (diff)
downloadpw-darwin-86b70b831eed513183b8ad9ad2dc3c46acb483f0.tar.gz
pw-darwin-86b70b831eed513183b8ad9ad2dc3c46acb483f0.zip
Add regression tests about adding already existsing groups/users
Diffstat (limited to 'pw/tests/pw_useradd.sh')
-rwxr-xr-xpw/tests/pw_useradd.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/pw/tests/pw_useradd.sh b/pw/tests/pw_useradd.sh
index 401769b..f42980d 100755
--- a/pw/tests/pw_useradd.sh
+++ b/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
}