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