summaryrefslogtreecommitdiff
path: root/tests/fake_adduser_test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fake_adduser_test')
-rwxr-xr-xtests/fake_adduser_test21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/fake_adduser_test b/tests/fake_adduser_test
new file mode 100755
index 0000000..fe13690
--- /dev/null
+++ b/tests/fake_adduser_test
@@ -0,0 +1,21 @@
+#!/usr/bin/env atf-sh
+
+. $(atf_get_srcdir)/test_env.sh
+init_tests \
+ fake_adduser_usage \
+ fake_adduser_failure
+
+fake_adduser_usage_body() {
+ init_env
+ atf_check -s exit:0 \
+ -e match:"Usage: adduser" \
+ adduser --help
+}
+
+fake_adduser_failure_body() {
+ init_env
+ ADDUSER_EXIST=juser atf_check -s exit:1 \
+ -e match:"adduser: user 'juser' in use" \
+ adduser juser
+}
+