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