4 atf_set "descr" "Bad interpreter length"
8 atf_check -s exit:1 -e 'match:No such file or directory' -o empty \
9 -x "cd $(atf_get_srcdir) && ./execve_helper bad_interp_len"
14 atf_set "descr" "Empty file"
18 atf_check -s exit:1 -e 'match:Exec format error' -o empty \
19 -x "cd $(atf_get_srcdir) && ./execve_helper empty"
24 atf_set "descr" "Good a.out"
28 atf_check -s exit:0 -e empty -o 'match:succeeded' \
29 -x "cd $(atf_get_srcdir) && ./execve_helper ./good_aout"
34 atf_set "descr" "Good script"
38 atf_check -s exit:0 -e empty -o 'match:succeeded' \
39 -x "cd $(atf_get_srcdir) && ./execve_helper good_script"
44 atf_set "descr" "Non-existent file"
48 atf_check -s exit:1 -e 'match:No such file or directory' -o empty \
49 -x "cd $(atf_get_srcdir) && ./execve_helper non_exist"
52 non_exist_shell_head()
54 atf_set "descr" "Non-existent shell"
56 non_exist_shell_body()
58 atf_check -s exit:1 -e 'match:No such file or directory' -o empty \
59 -x "cd $(atf_get_srcdir) && ./execve_helper non_exist_shell"
64 atf_set "descr" "-x in the shebang"
68 atf_check -s exit:0 -e 'match:\+ echo succeeded' -o 'match:succeeded' \
69 -x "cd $(atf_get_srcdir) && ./execve_helper script_arg"
72 script_arg_nospace_head()
74 atf_set "descr" '-x in the shebang; no space between #! and /bin/sh'
76 script_arg_nospace_body()
78 atf_check -s exit:0 -e 'match:\+ echo succeeded' -o 'match:succeeded' \
79 -x "cd $(atf_get_srcdir) && ./execve_helper script_arg_nospace"
84 atf_set "descr" 'Sparse file'
88 atf_check -s exit:1 -e 'match:Exec format error' -o empty \
89 -x "cd $(atf_get_srcdir) && ./execve_helper sparse_aout"
94 atf_set "descr" 'Truncated file'
98 atf_check -s exit:1 -e 'match:Exec format error' -o empty \
99 -x "cd $(atf_get_srcdir) && ./execve_helper trunc_aout"
102 atf_init_test_cases()
104 atf_add_test_case bad_interp_len
105 atf_add_test_case empty
106 atf_add_test_case good_aout
107 atf_add_test_case good_script
108 atf_add_test_case non_exist
109 atf_add_test_case non_exist_shell
110 atf_add_test_case script_arg
111 atf_add_test_case script_arg_nospace
112 atf_add_test_case sparse_aout
113 atf_add_test_case trunc_aout