strace/tests/clone_ptrace.test
Dmitry V. Levin a93e2de99e tests: check handling of CLONE_PARENT'ed and CLONE_PTRACE'ed processes
* tests/clone_parent.c: New file.
* tests/clone_ptrace.c: Likewise.
* tests/clone_parent.test: New test.
* tests/clone_ptrace.test: Likewise.
* tests/.gitignore: Add clone_parent and clone_ptrace.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(MISC_TESTS): Add clone_parent.test and clone_ptrace.test.
2017-08-06 00:23:20 +00:00

18 lines
410 B
Bash
Executable File

#!/bin/sh -efu
# Check handling of CLONE_PTRACE'ed processes.
. "${srcdir=.}/init.sh"
run_prog > /dev/null 3>&1
args="-e trace=none $args"
> "$LOG" || fail_ "failed to write $LOG"
$STRACE -o "$LOG" $args > "$EXP" 2> "$OUT"-err 3> "$EXP"-err || {
msg="$STRACE $args failed with code $?"
cat "$OUT"-err "$LOG" >&2
fail_ "$msg"
}
cat "$OUT"-err >&2
match_diff "$LOG" "$EXP"
match_diff "$OUT"-err "$EXP"-err