tests: parametrize "sleep 1"

* tests/init.sh (SLEEP_A_BIT): New variable.
* tests/detach-sleeping: Use it.
* tests/detach-stopped: Likewise.
This commit is contained in:
Дмитрий Левин 2013-06-18 20:51:49 +00:00
parent 97c85088a2
commit 1e0a28063f
3 changed files with 6 additions and 5 deletions

View File

@ -14,7 +14,7 @@ set -e
while ! [ -s set_ptracer_any.out ]; do
kill -0 $! 2> /dev/null ||
fail_ 'set_ptracer_any sleep failed'
sleep 1
$SLEEP_A_BIT
done
rm -f set_ptracer_any.out
@ -33,7 +33,7 @@ $STRACE -p $tracee_pid 2> $LOG &
while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do
kill -0 $! 2> /dev/null ||
{ cat $LOG; cleanup; fail_ 'strace -p does not work'; }
sleep 1
$SLEEP_A_BIT
done
kill -INT $!

View File

@ -14,7 +14,7 @@ set -e
while ! [ -s set_ptracer_any.out ]; do
kill -0 $! 2> /dev/null ||
fail_ 'set_ptracer_any sleep failed'
sleep 1
$SLEEP_A_BIT
done
rm -f set_ptracer_any.out
@ -34,13 +34,13 @@ $STRACE -p $tracee_pid 2> $LOG &
while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do
kill -0 $! 2> /dev/null ||
{ cat $LOG; cleanup; fail_ 'strace -p does not work'; }
sleep 1
$SLEEP_A_BIT
done
while ! grep -F -e '--- stopped by ' $LOG > /dev/null; do
kill -0 $! 2> /dev/null ||
{ cat $LOG; cleanup; fail_ 'strace -p does not work'; }
sleep 1
$SLEEP_A_BIT
done
kill -INT $!

View File

@ -19,3 +19,4 @@ check_prog()
: "${STRACE:=../strace}"
: "${TIMEOUT_DURATION:=60}"
: "${SLEEP_A_BIT:=sleep 1}"