From: Ruediger Meier Date: Tue, 13 May 2014 13:13:12 +0000 (+0200) Subject: tests: script/race would work with variable loop count X-Git-Tag: v2.25-rc1~156^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcbc4db886752d822561149b820195ee666ca875;p=thirdparty%2Futil-linux.git tests: script/race would work with variable loop count Signed-off-by: Ruediger Meier --- diff --git a/tests/expected/script/race b/tests/expected/script/race index 83b33d238d..faede5f622 100644 --- a/tests/expected/script/race +++ b/tests/expected/script/race @@ -1 +1 @@ -1000 +all bingos seen diff --git a/tests/ts/script/race b/tests/ts/script/race index ef7e83f12c..103a14a473 100755 --- a/tests/ts/script/race +++ b/tests/ts/script/race @@ -28,10 +28,18 @@ bingofile="$TS_OUTDIR/${TS_TESTNAME}-bingo" set -o pipefail -for i in `seq 1 1000`; do +count=1000 +for i in `seq 1 $count`; do $TS_CMD_SCRIPT -q -c "printf 'Bingo\n'" $bingofile done | grep -c Bingo >> $TS_OUTPUT +seen=$(<$TS_OUTPUT) +if [ $seen = $count ]; then + echo "all bingos seen" > $TS_OUTPUT +else + echo "only $seen of $count bingos seen" > $TS_OUTPUT +fi + rm -f $bingofile ts_finalize