Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/kern/execve/execve_test.sh
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | trunc_aout_head() | ||||
atf_set "descr" 'Truncated file' | atf_set "descr" 'Truncated file' | ||||
} | } | ||||
trunc_aout_body() | trunc_aout_body() | ||||
{ | { | ||||
atf_check -s exit:1 -e 'match:Exec format error' -o empty \ | atf_check -s exit:1 -e 'match:Exec format error' -o empty \ | ||||
-x "cd $(atf_get_srcdir) && ./execve_helper trunc_aout" | -x "cd $(atf_get_srcdir) && ./execve_helper trunc_aout" | ||||
} | } | ||||
empty_args_head() | |||||
{ | |||||
atf_set "descr" "Empty argv behavior" | |||||
} | |||||
empty_args_body() | |||||
{ | |||||
# Exit status misleading, if stderr is empty then it's OK and the exit | |||||
# status is argc. | |||||
atf_check -s exit:1 \ | |||||
emaste: ah, so we either get exit 1 because execve_argc_helper exited with argc == 1 ... | |||||
-x "cd $(atf_get_srcdir) && ./execve_helper execve_argc_helper" | |||||
# Historically we allowed argc == 0, while execve(2) claimed we didn't. | |||||
# execve() should kick back an EINVAL now. We verified the helper was | |||||
# there/working in the check just above. | |||||
atf_check -s exit:1 \ | |||||
emasteUnsubmitted Done Inline Actions... or because execve_helper failed to exec it OK I guess, would it be clearer if execve_argc_helper just did printf("%d", argc)? emaste: ... or because execve_helper failed to exec it
OK I guess, would it be clearer if… | |||||
-e inline:"execve_helper: execve failed: Invalid argument\n" \ | |||||
-x "cd $(atf_get_srcdir) && ./execve_helper -n execve_argc_helper" | |||||
} | |||||
atf_init_test_cases() | atf_init_test_cases() | ||||
{ | { | ||||
atf_add_test_case bad_interp_len | atf_add_test_case bad_interp_len | ||||
atf_add_test_case empty | atf_add_test_case empty | ||||
atf_add_test_case good_aout | atf_add_test_case good_aout | ||||
atf_add_test_case good_script | atf_add_test_case good_script | ||||
atf_add_test_case non_exist | atf_add_test_case non_exist | ||||
atf_add_test_case non_exist_shell | atf_add_test_case non_exist_shell | ||||
atf_add_test_case script_arg | atf_add_test_case script_arg | ||||
atf_add_test_case script_arg_nospace | atf_add_test_case script_arg_nospace | ||||
atf_add_test_case sparse_aout | atf_add_test_case sparse_aout | ||||
atf_add_test_case trunc_aout | atf_add_test_case trunc_aout | ||||
atf_add_test_case empty_args | |||||
} | } |
ah, so we either get exit 1 because execve_argc_helper exited with argc == 1 ...