Whamcloud - gitweb
b=22853 test should stop at once if any dbench failed.
authorFan Yong <Yong.Fan@Sun.COM>
Fri, 28 May 2010 09:15:12 +0000 (17:15 +0800)
committerJohann Lombardi <johann@sun.com>
Fri, 28 May 2010 11:31:30 +0000 (13:31 +0200)
test should stop at once if any dbench failed.

i=jian.yu
i=robert.read

lustre/tests/replay-single.sh

index 2c2b35f..dfbae3f 100644 (file)
@@ -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