3 # Import helper functions
4 . $(atf_get_srcdir)/helper_functions.shin
6 atf_test_case user_show_all
9 atf_check -o not-empty ${PW} usershow -a
12 atf_test_case user_show_name
13 user_show_name_body() {
15 atf_check -o not-empty ${PW} usershow root
18 atf_test_case user_show_nonexistent_name
19 user_show_nonexistent_name_body() {
22 nonexistent_user=bogus
23 no_such_user_msg="pw: no such user \`$nonexistent_user'\n"
25 atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \
27 atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \
31 atf_test_case user_show_nonexistent_uid
32 user_show_nonexistent_uid_body() {
36 no_such_uid_msg="pw: no such uid \`$nonexistent_uid'\n"
38 atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \
40 atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \
44 atf_test_case user_show_uid
45 user_show_uid_body() {
47 atf_check -o not-empty ${PW} usershow -u 0
50 atf_init_test_cases() {
51 atf_add_test_case user_show_all
52 atf_add_test_case user_show_name
53 atf_add_test_case user_show_nonexistent_name
54 atf_add_test_case user_show_nonexistent_uid
55 atf_add_test_case user_show_uid