1 #!/bin/sh 2 3 # Check -bexecve behavior. 4 5 . "${srcdir=.}/init.sh" 6 7 run_strace_redir() 8 { 9 args="$*" 10 $STRACE "$@" 2> "$LOG" 11 } 12 13 run_strace_redir -enone sh -c 'exec false' 14 [ $? -eq 1 ] || 15 dump_log_and_fail_with "$STRACE $args: unexpected exit status" 16 17 run_strace_redir -bexecve -enone sh -c 'exec false' || 18 dump_log_and_fail_with "$STRACE $args: unexpected exit status" 19 20 pattern='Process [1-9][0-9]* detached' 21 22 LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || 23 dump_log_and_fail_with "$STRACE $args: output mismatch" 24 25 if LC_ALL=C grep -v -x "$pattern" "$LOG" > /dev/null; then 26 dump_log_and_fail_with "$STRACE $args: unexpected output" 27 fi 28 29 exit 0 30