if (! state->continue_on_failure) {
state->script_list->num_scripts = state->index + 1;
- if (script->summary == -ETIME && pid != -1) {
+ if (script->summary == -ETIMEDOUT && pid != -1) {
run_event_debug(req, pid);
}
D_NOTICE("%s event %s\n", state->event_str,
- (script->summary == -ETIME) ?
+ (script->summary == -ETIMEDOUT) ?
"timed out" :
"failed");
run_event_stop_running(state->run_ctx);
return;
}
- state->result.err = ETIME;
+ state->result.err = ETIMEDOUT;
if (state->proc->output != NULL) {
state->output = talloc_steal(state, state->proc->output);
}
11.foo: hello
Event monitor completed with result=0
11.foo result=0
-22.bar result=-8
+22.bar result=-$(errcode ENOEXEC)
EOF
unit_test run_event_test "$scriptdir" run 10 monitor
ok <<EOF
11.foo: hello
-Event monitor completed with result=-62
+Event monitor completed with result=-$(errcode ETIMEDOUT)
11.foo result=0
-22.bar result=-62
+22.bar result=-$(errcode ETIMEDOUT)
EOF
unit_test run_event_test "$scriptdir" run 5 monitor
# Invalid path
ok <<EOF
-Process exited with error 2
+Process exited with error $(errcode ENOENT)
EOF
unit_test run_proc_test 0 -1 /a/b/c
EOF
ok <<EOF
-Process exited with error 13
+Process exited with error $(errcode EACCES)
EOF
unit_test run_proc_test 0 -1 "$prog"
chmod +x "$prog"
ok <<EOF
-Process exited with error 8
+Process exited with error $(errcode ENOEXEC)
EOF
unit_test run_proc_test 0 -1 "$prog"
}
ok <<EOF
-Process exited with error 62
+Process exited with error $(errcode ETIMEDOUT)
Child = PID
Output = (Sleeping for 5 seconds
)
EOF
ok <<EOF
-Process exited with error 62
+Process exited with error $(errcode ETIMEDOUT)
Child = PID
EOF
unit_test run_proc_test 1 -1 "$prog"