From: Dmitry V. Levin Date: Wed, 19 Jun 2013 14:57:05 +0000 (+0000) Subject: tests: disable /proc based checks when /proc is not mounted X-Git-Tag: v4.9~235 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d7c3653c58036e0c27d2c321f482e11e6460262;p=strace tests: disable /proc based checks when /proc is not mounted * tests/detach-running: Disable /proc based checks when /proc/self/status is not available. * tests/detach-sleeping: Likewise. * tests/detach-stopped: Likewise. --- diff --git a/tests/detach-running b/tests/detach-running index 8c084d05..16f552b5 100755 --- a/tests/detach-running +++ b/tests/detach-running @@ -41,15 +41,17 @@ 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 + grep '^State:' < /proc/$tracee_pid/status + cleanup + fail_ 'tracee is not running after detach' } +fi cleanup exit 0 diff --git a/tests/detach-sleeping b/tests/detach-sleeping index 8127541f..92138b53 100755 --- a/tests/detach-sleeping +++ b/tests/detach-sleeping @@ -42,15 +42,17 @@ 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:.*S (sleeping)' /dev/null || - { cat $LOG - grep '^State:' /dev/null || { + cat $LOG + grep '^State:' < /proc/$tracee_pid/status + cleanup + fail_ 'tracee is not sleeping after detach' } +fi cleanup exit 0 diff --git a/tests/detach-stopped b/tests/detach-stopped index ba0d82b3..81fd3031 100755 --- a/tests/detach-stopped +++ b/tests/detach-stopped @@ -50,15 +50,17 @@ 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:.*T (stopped)' /dev/null || - { cat $LOG - grep '^State:' /dev/null || { + cat $LOG + grep '^State:' < /proc/$tracee_pid/status + cleanup + fail_ 'tracee is not group-stopped after detach' } +fi cleanup exit 0