From: Denys Vlasenko Date: Wed, 19 Jun 2013 14:37:24 +0000 (+0200) Subject: tests/detach-{running,sleeping,stopped}: check post-detach state X-Git-Tag: v4.9~236 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a815185d558d5f38393a9994443b2a191c5b9485;p=strace tests/detach-{running,sleeping,stopped}: check post-detach state Check that traced process still exists and is in a right state after strace detached from it. Signed-off-by: Denys Vlasenko --- diff --git a/tests/detach-running b/tests/detach-running index 1132e0f5..8c084d05 100755 --- a/tests/detach-running +++ b/tests/detach-running @@ -41,5 +41,15 @@ wait $! grep -F "Process $tracee_pid detached" $LOG > /dev/null || { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; } +$SLEEP_A_BIT +test -d /proc/$tracee_pid || + { cat $LOG; cleanup; fail_ 'tracee died after detach'; } +grep '^State:.*R (running)' /dev/null || + { cat $LOG + grep '^State:' /dev/null || { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; } +$SLEEP_A_BIT +test -d /proc/$tracee_pid || + { cat $LOG; cleanup; fail_ 'tracee died after detach'; } +grep '^State:.*S (sleeping)' /dev/null || + { cat $LOG + grep '^State:' /dev/null || { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; } +$SLEEP_A_BIT +test -d /proc/$tracee_pid || + { cat $LOG; cleanup; fail_ 'tracee died after detach'; } +grep '^State:.*T (stopped)' /dev/null || + { cat $LOG + grep '^State:'