From 589ebb89c626d5d9bca72f93d8339f13c4572170 Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Fri, 5 Mar 2010 22:51:38 +0300 Subject: [PATCH] b=22169 t-f cleanup: new do_nodev (), do_nodesv () functions i=Robert.Read --- lustre/tests/metadata-updates.sh | 6 +++--- lustre/tests/recovery-double-scale.sh | 6 +----- lustre/tests/recovery-mds-scale.sh | 6 +----- lustre/tests/recovery-random-scale.sh | 6 +----- lustre/tests/replay-single.sh | 2 +- lustre/tests/test-framework.sh | 18 +++++++++++++----- 6 files changed, 20 insertions(+), 24 deletions(-) diff --git a/lustre/tests/metadata-updates.sh b/lustre/tests/metadata-updates.sh index 432e96d..67ba51c 100755 --- a/lustre/tests/metadata-updates.sh +++ b/lustre/tests/metadata-updates.sh @@ -74,7 +74,7 @@ do_check_data () { echo "Checking file(s) data ... md5sum : " echo "$sums" - do_nodes --verbose $NODES_TO_USE "echo \\\"$sums\\\" | md5sum --check $sum" || \ + do_nodesv $NODES_TO_USE "echo \\\"$sums\\\" | md5sum --check $sum" || \ return ${PIPESTATUS[0]} return 0 } @@ -96,7 +96,7 @@ get_stat () { echo "Checking file(s) attributes ... " - do_nodes --verbose $NODES_TO_USE "set $TRACE; + do_nodesv $NODES_TO_USE "set $TRACE; for HOST in ${NODES_TO_USE//,/ } ; do TESTFILE=$TESTDIR/\\\$HOST/$FILE; tmp=\\\$(stat -c \\\"%u %g %s 0%a\\\" \\\$TESTFILE); @@ -139,7 +139,7 @@ do_check_timestamps () { echo "Checking atime, mtime ... " - do_nodes --verbose $NODES_TO_USE "set $TRACE; + do_nodesv $NODES_TO_USE "set $TRACE; for HOST in ${NODES_TO_USE//,/ } ; do TESTFILE=$TESTDIR/\\\$HOST/$FILE; tmp=\\\$(stat -c \\\"%X %Y\\\" \\\$TESTFILE); diff --git a/lustre/tests/recovery-double-scale.sh b/lustre/tests/recovery-double-scale.sh index a996a83..3a8e203 100644 --- a/lustre/tests/recovery-double-scale.sh +++ b/lustre/tests/recovery-double-scale.sh @@ -266,12 +266,8 @@ FAILOVER_PERIOD=${FAILOVER_PERIOD:-$((60*5))} # 5 minutes # Start client loads. start_client_loads $NODES_TO_USE echo clients load pids: -if ! do_nodes $NODES_TO_USE "set -x; echo \$(hostname): && cat $TMP/client-load.pid"; then - if [ -e $DEBUGLOG ]; then - exec 2<&- - cat $DEBUGLOG +if ! do_nodesv $NODES_TO_USE "cat $TMP/client-load.pid"; then exit 3 - fi fi # FIXME: Do we want to have an initial sleep period where the clients diff --git a/lustre/tests/recovery-mds-scale.sh b/lustre/tests/recovery-mds-scale.sh index 4ed4b4e..eef229d 100644 --- a/lustre/tests/recovery-mds-scale.sh +++ b/lustre/tests/recovery-mds-scale.sh @@ -187,12 +187,8 @@ fi start_client_loads $NODES_TO_USE echo clients load pids: -if ! do_nodes $NODES_TO_USE "set -x; echo \$(hostname): && cat $LOAD_PID_FILE"; then - if [ -e $DEBUGLOG ]; then - exec 2<&- - cat $DEBUGLOG +if ! do_nodesv $NODES_TO_USE "cat $LOAD_PID_FILE"; then exit 3 - fi fi MINSLEEP=${MINSLEEP:-120} diff --git a/lustre/tests/recovery-random-scale.sh b/lustre/tests/recovery-random-scale.sh index c996677..e76d7cf 100644 --- a/lustre/tests/recovery-random-scale.sh +++ b/lustre/tests/recovery-random-scale.sh @@ -189,12 +189,8 @@ fi start_client_loads $NODES_TO_USE echo clients load pids: -if ! do_nodes $NODES_TO_USE "set -x; echo \$(hostname): && cat $LOAD_PID_FILE"; then - if [ -e $DEBUGLOG ]; then - exec 2<&- - cat $DEBUGLOG +if ! do_nodesv $NODES_TO_USE "cat $LOAD_PID_FILE"; then exit 3 - fi fi START_TS=$(date +%s) diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 1790376..3d50f3d 100644 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -1803,7 +1803,7 @@ test_70b () { [ "$SLOW" = "no" ] && duration=60 local cmd="rundbench 1 -t $duration" local PID="" - do_nodes $clients "set -x; MISSING_DBENCH_OK=$MISSING_DBENCH_OK \ + do_nodesv $clients "set -x; MISSING_DBENCH_OK=$MISSING_DBENCH_OK \ PATH=:$PATH:$LUSTRE/utils:$LUSTRE/tests/:$DBENCH_LIB \ DBENCH_LIB=$DBENCH_LIB TESTSUITE=$TESTSUITE TESTNAME=$TESTNAME \ LCTL=$LCTL $cmd" & diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 5def868..0484889 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1311,6 +1311,10 @@ do_node() { return ${PIPESTATUS[0]} } +do_nodev() { + do_node --verbose "$@" +} + single_local_node () { [ "$1" = "$HOSTNAME" ] } @@ -1328,7 +1332,7 @@ do_nodes() { if $(single_local_node $rnodes); then if $verbose; then - do_node --verbose $rnodes "$@" + do_nodev $rnodes "$@" else do_node $rnodes "$@" fi @@ -1362,6 +1366,10 @@ do_facet() { do_node $HOST "$@" } +do_nodesv() { + do_nodes --verbose "$@" +} + add() { local facet=$1 shift @@ -2521,7 +2529,7 @@ setstripe_nfsserver () { [ -z $nfsserver ] && echo "$dir is not nfs mounted" && return 1 - do_node --verbose $nfsserver lfs setstripe "$@" + do_nodev $nfsserver lfs setstripe "$@" } check_runas_id_ret() { @@ -2537,7 +2545,7 @@ check_runas_id_ret() { chmod 0755 $DIR chown $myRUNAS_UID:$myRUNAS_GID $DIR/d0_runas_test if ! $myRUNAS touch $DIR/d0_runas_test/f$$ ; then - do_nodes --verbose $(comma_list $(nodes_list)) grep -w $myRUNAS_UID /etc/passwd + do_nodesv $(comma_list $(nodes_list)) grep -w $myRUNAS_UID /etc/passwd myRC=1 fi rm -rf $DIR/d0_runas_test @@ -2629,7 +2637,7 @@ calc_osc_kbytes () { # generate a stream of formatted strings ( =) save_lustre_params() { local s - do_nodes --verbose $1 "lctl get_param $2 | while read s; do echo \\\$s; done" + do_nodesv $1 "lctl get_param $2 | while read s; do echo \\\$s; done" } # restore lustre parameters from input stream, produces by save_lustre_params @@ -2866,7 +2874,7 @@ do_rpc_nodes () { local list=$1 shift - do_nodes --verbose $list "PATH=$LUSTRE/tests/:$PATH sh rpc.sh $@ " + do_nodesv $list "PATH=$LUSTRE/tests/:$PATH sh rpc.sh $@ " } wait_clients_import_state () { -- 1.8.3.1