From 5d2676f598836418a2aa1d1bfa4742cde0ca1c6f Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Fri, 28 May 2010 17:15:12 +0800 Subject: [PATCH] b=22853 test should stop at once if any dbench failed. test should stop at once if any dbench failed. i=jian.yu i=robert.read --- lustre/tests/replay-single.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 2c2b35f..dfbae3f 100644 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -1801,6 +1801,24 @@ test_70a () { } run_test 70a "check multi client t-f" +check_dbench_load () { + local clients=${1//,/ } + local client= + + for client in $clients; do + if ! do_node $client "ps ax | grep -v grep | awk '{ print $6 }' | grep -q rundbench"; then + error_noexit "rundbench load on $client failed!" + return 1 + fi + done + return 0 +} + +kill_dbench_load () { + local clients=${1:-$(hostname)} + do_nodes $clients "killall dbench" +} + test_70b () { local clients=${CLIENTS:-$HOSTNAME} @@ -1822,6 +1840,10 @@ test_70b () { START_TS=$(date +%s) CURRENT_TS=$START_TS while [ $ELAPSED -lt $duration ]; do + if ! check_dbench_load $clients; then + kill_dbench_load $clients + break + fi sleep 1 replay_barrier mds sleep 1 # give clients a time to do operations -- 1.8.3.1