3 . "${TEST_SCRIPTS_DIR}/unit.sh"
7 Process exited with error 2
9 unit_test run_proc_test 0 -1 /a/b/c
12 prog=$(mktemp --tmpdir="$TEST_VAR_DIR")
18 Process exited with error 13
20 unit_test run_proc_test 0 -1 "$prog"
26 Process exited with error 8
28 unit_test run_proc_test 0 -1 "$prog"
37 Process exited with status 0
41 unit_test run_proc_test 0 -1 "$prog"
45 Process exited with status 0
49 unit_test run_proc_test 5 -1 "$prog"
52 output=$(mktemp --tmpdir="$TEST_VAR_DIR")
60 Process exited with status 0
62 unit_test run_proc_test 0 -1 "$prog"
67 unit_test cat "$output"
76 Process exited with status 1
78 unit_test run_proc_test 0 -1 "$prog"
87 Process exited with signal 15
89 unit_test run_proc_test 0 -1 "$prog"
94 echo "Sleeping for 5 seconds"
101 sed -e "s|= ${_pid}|= PID|"
105 Process exited with error 62
107 Output = (Sleeping for 5 seconds
110 unit_test run_proc_test 1 -1 "$prog"
112 # No zombie processes
113 pidfile=$(mktemp --tmpdir="$TEST_VAR_DIR")
117 echo \$$ > "$pidfile"
122 Process exited with error 62
125 unit_test run_proc_test 1 -1 "$prog"
129 _header=" *PID *TTY *TIME *CMD"
130 sed -e "s|^${_header}|HEADER|"
133 pid=$(cat "$pidfile")
134 required_result 1 <<EOF
137 unit_test ps -p "$pid"
145 cat > "$output" <<EOF
150 Process exited with status 0
151 Output = (this is sample input
154 (unit_test run_proc_test 0 4 "$prog") 4<"$output"