summaryrefslogtreecommitdiffstats
path: root/pw/tests/pw_etcdir.sh
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
commita697e7c7ae3f57207a6ad6d016fafb4bd4edbed0 (patch)
tree50af2908e381b03974977649fd0dedb542c63475 /pw/tests/pw_etcdir.sh
parente4061ea7d682a38b6ce4da1d45e20f840d367b19 (diff)
parent04c1a8669ab01c8bb76f4cbf48aa2f8c56fa80e9 (diff)
downloadpw-darwin-a697e7c7ae3f57207a6ad6d016fafb4bd4edbed0.tar.gz
pw-darwin-a697e7c7ae3f57207a6ad6d016fafb4bd4edbed0.tar.zst
pw-darwin-a697e7c7ae3f57207a6ad6d016fafb4bd4edbed0.zip
Merge from head@274682
Diffstat (limited to 'pw/tests/pw_etcdir.sh')
-rwxr-xr-xpw/tests/pw_etcdir.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/pw/tests/pw_etcdir.sh b/pw/tests/pw_etcdir.sh
new file mode 100755
index 0000000..b237789
--- /dev/null
+++ b/pw/tests/pw_etcdir.sh
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+# When the '-V directory' option is provided, the directory must exist
+atf_test_case etcdir_must_exist
+etcdir_must_exist_head() {
+ atf_set "descr" "When the '-V directory' option is provided, the directory must exist"
+}
+
+etcdir_must_exist_body() {
+ local fakedir="/this_directory_does_not_exist"
+ atf_check -e inline:"pw: no such directory \`$fakedir'\n" \
+ -s exit:72 -x pw -V ${fakedir} usershow root
+}
+
+atf_init_test_cases() {
+ atf_add_test_case etcdir_must_exist
+}
+