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.
This commit is contained in:
parent
a815185d55
commit
0d7c3653c5
@ -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)' </proc/$tracee_pid/status > /dev/null ||
|
||||
{ cat $LOG
|
||||
grep '^State:' </proc/$tracee_pid/status
|
||||
cleanup
|
||||
fail_ 'tracee is not running after detach'
|
||||
if [ -f /proc/self/status ]; then
|
||||
$SLEEP_A_BIT
|
||||
test -d /proc/$tracee_pid ||
|
||||
{ cat $LOG; cleanup; fail_ 'tracee died after detach'; }
|
||||
grep '^State:.*R (running)' < /proc/$tracee_pid/status > /dev/null || {
|
||||
cat $LOG
|
||||
grep '^State:' < /proc/$tracee_pid/status
|
||||
cleanup
|
||||
fail_ 'tracee is not running after detach'
|
||||
}
|
||||
fi
|
||||
|
||||
cleanup
|
||||
exit 0
|
||||
|
@ -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)' </proc/$tracee_pid/status > /dev/null ||
|
||||
{ cat $LOG
|
||||
grep '^State:' </proc/$tracee_pid/status
|
||||
cleanup
|
||||
fail_ 'tracee is not sleeping after detach'
|
||||
if [ -f /proc/self/status ]; then
|
||||
$SLEEP_A_BIT
|
||||
test -d /proc/$tracee_pid ||
|
||||
{ cat $LOG; cleanup; fail_ 'tracee died after detach'; }
|
||||
grep '^State:.*S (sleeping)' < /proc/$tracee_pid/status > /dev/null || {
|
||||
cat $LOG
|
||||
grep '^State:' < /proc/$tracee_pid/status
|
||||
cleanup
|
||||
fail_ 'tracee is not sleeping after detach'
|
||||
}
|
||||
fi
|
||||
|
||||
cleanup
|
||||
exit 0
|
||||
|
@ -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)' </proc/$tracee_pid/status > /dev/null ||
|
||||
{ cat $LOG
|
||||
grep '^State:' </proc/$tracee_pid/status
|
||||
cleanup
|
||||
fail_ 'tracee is not group-stopped after detach'
|
||||
if [ -f /proc/self/status ]; then
|
||||
$SLEEP_A_BIT
|
||||
test -d /proc/$tracee_pid ||
|
||||
{ cat $LOG; cleanup; fail_ 'tracee died after detach'; }
|
||||
grep '^State:.*T (stopped)' < /proc/$tracee_pid/status > /dev/null || {
|
||||
cat $LOG
|
||||
grep '^State:' < /proc/$tracee_pid/status
|
||||
cleanup
|
||||
fail_ 'tracee is not group-stopped after detach'
|
||||
}
|
||||
fi
|
||||
|
||||
cleanup
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user