xref: /freebsd/usr.sbin/pw/tests/pw_etcdir_test.sh (revision cddbc3b40812213ff00041f79174cac0be360a2a)
1# $FreeBSD$
2
3# When the '-V directory' option is provided, the directory must exist
4atf_test_case etcdir_must_exist
5etcdir_must_exist_head() {
6	atf_set "descr" "When the '-V directory' option is provided, the directory must exist"
7}
8
9etcdir_must_exist_body() {
10	local fakedir="/this_directory_does_not_exist"
11	atf_check -e inline:"pw: no such directory \`$fakedir'\n" \
12		-s exit:72 -x pw -V ${fakedir} usershow root
13}
14
15atf_init_test_cases() {
16	atf_add_test_case etcdir_must_exist
17}
18
19