From be05b7509865fe09815dcb22578e22bd0be2fb82 Mon Sep 17 00:00:00 2001 From: grev Date: Thu, 31 Jan 2008 00:36:36 +0000 Subject: [PATCH] b=12499 i=grev speedups for SLOW=no and fixes for remote client --- lustre/tests/rundbench | 3 +++ lustre/tests/sanity.sh | 41 +++++++++++++++++++++++------------------ lustre/tests/test-framework.sh | 41 +++++++++++++++++++++++++++++++---------- 3 files changed, 57 insertions(+), 28 deletions(-) diff --git a/lustre/tests/rundbench b/lustre/tests/rundbench index f31be70..40a8fde 100755 --- a/lustre/tests/rundbench +++ b/lustre/tests/rundbench @@ -15,3 +15,6 @@ SRC=/usr/lib/dbench/client_plain.txt cd $DIR echo "running 'dbench $@' on $PWD at `date`" dbench -c client.txt $@ +RC=$? +[ $RC -ne 0 ] && killall -9 dbench +exit $RC diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index fd9c990..bc7f44d 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -13,7 +13,7 @@ ALWAYS_EXCEPT=" 27o 27q 42a 42b 42c 42d 45 74b 75 $SANI #ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"27m 42a 42b 42c 42d 45 68 76"} # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! -[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 27m 36f 36g 51b 51c 60c 63 64b 68 71 73 78 101 103 115 120g" +[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 27m 36f 36g 51b 51c 60c 63 64b 68 71 73 77f 78 101 103 115 120g 124b" # Tests that fail on uml CPU=`awk '/model/ {print $4}' /proc/cpuinfo` @@ -1689,9 +1689,9 @@ test_36f() { } run_test 36f "utime on file racing with OST BRW write ==========" -export FMD_MAX_AGE=`do_facet ost1 cat $LPROC/obdfilter/*/client_cache_seconds | head -n 1` test_36g() { - [ -z "$FMD_MAX_AGE" ] && skip "skip test for remote OST" && return + remote_ost && skip "remote OST" && return + export FMD_MAX_AGE=`do_facet ost1 cat $LPROC/obdfilter/*/client_cache_seconds 2> /dev/null | head -n 1` FMD_BEFORE="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`" touch $DIR/d36/$tfile sleep $((FMD_MAX_AGE + 12)) @@ -2866,9 +2866,10 @@ test_65i() { # bug6367 run_test 65i "set non-default striping on root directory (bug 6367)=" test_65j() { # bug6367 + sync; sleep 1 # if we aren't already remounting for each test, do so for this test if [ "$CLEANUP" = ":" -a "$I_MOUNTED" = "yes" ]; then - cleanup -f || error "failed to unmount" + cleanup || error "failed to unmount" setup fi $SETSTRIPE -d $MOUNT || error "setstripe failed" @@ -2877,6 +2878,7 @@ run_test 65j "set default striping on root directory (bug 6367)=" test_65k() { # bug11679 [ "$OSTCOUNT" -lt 2 ] && skip "too few OSTs" && return + remote_mds_nodsh && skip "remote MDS" && return echo "Check OST status: " MDS_OSCS=`do_facet mds lctl dl | awk '/[oO][sS][cC].*md[ts]/ { print $4 }'` @@ -3813,10 +3815,7 @@ run_test 102d "star restore stripe info from tarfile,not keep osts ===========" test_102e() { # b10930: star test for trusted.lov xattr star --xhelp 2>&1 | grep -q nolustre - if [ $? -ne 0 ] - then - skip "being skipped because a lustre-aware star is not installed." && return - fi + [ $? -ne 0 ] && skip "lustre-aware star is not installed" && return [ "$OSTCOUNT" -lt "4" ] && skip "skipping 4-stripe test" && return setup_test102 mkdir -p $DIR/d102e @@ -3829,10 +3828,7 @@ run_test 102e "star restore stripe info from tarfile, keep osts ===========" test_102f() { # b10930: star test for trusted.lov xattr star --xhelp 2>&1 | grep -q nolustre - if [ $? -ne 0 ] - then - skip "being skipped because a lustre-aware star is not installed." && return - fi + [ $? -ne 0 ] && skip "lustre-aware star is not installed" && return [ "$OSTCOUNT" -lt "4" ] && skip "skipping 4-stripe test" && return setup_test102 mkdir -p $DIR/d102f @@ -3846,10 +3842,7 @@ run_test 102f "star copy files, not keep osts ===========" test_102g() { # b10930: star test for trusted.lov xattr star --xhelp 2>&1 | grep -q nolustre - if [ $? -ne 0 ] - then - skip "being skipped because a lustre-aware star is not installed." && return - fi + [ $? -ne 0 ] && skip "lustre-aware star is not installed" && return [ "$OSTCOUNT" -lt "4" ] && skip "skipping 4-stripe test" && return setup_test102 mkdir -p $DIR/d102g @@ -4175,6 +4168,8 @@ run_test 118a "verify O_SYNC works ==========" test_118b() { + remote_ost_nodsh && skip "remote OST" && return + reset_async #define OBD_FAIL_OST_ENOENT 0x217 @@ -4208,6 +4203,8 @@ run_test 118b "Reclaim dirty pages on fatal error ==========" test_118c() { + remote_ost_nodsh && skip "remote OST" && return + reset_async #define OBD_FAIL_OST_EROFS 0x216 @@ -4248,6 +4245,8 @@ run_test 118c "Fsync blocks on EROFS until dirty pages are flushed ==========" test_118d() { + remote_ost_nodsh && skip "remote OST" && return + reset_async #define OBD_FAIL_OST_BRW_PAUSE_BULK @@ -4350,6 +4349,8 @@ test_118g() { run_test 118g "Don't stay in wait if we got local -ENOMEM ==========" test_118h() { + remote_ost_nodsh && skip "remote OST" && return + reset_async #define OBD_FAIL_OST_BRW_WRITE_BULK 0x20e @@ -4382,6 +4383,8 @@ test_118h() { run_test 118h "Verify timeout in handling recoverables errors ==========" test_118i() { + remote_ost_nodsh && skip "remote OST" && return + reset_async #define OBD_FAIL_OST_BRW_WRITE_BULK 0x20e @@ -4418,6 +4421,8 @@ test_118i() { run_test 118i "Fix error before timeout in recoverable error ==========" test_118j() { + remote_ost_nodsh && skip "remote OST" && return + reset_async #define OBD_FAIL_OST_BRW_WRITE_BULK2 0x220 @@ -4904,9 +4909,9 @@ test_124b() { get_lru_size "mdc-" if test $lruresize_delta -gt $nolruresize_delta; then - log "ls -la is $((lruresize_delta - $nolruresize_delta))s slower with lru resize enabled" + log "ls -la is $(((lruresize_delta - $nolruresize_delta) * 100 / $nolruresize_delta))% slower with lru resize enabled" elif test $nolruresize_delta -gt $lruresize_delta; then - log "ls -la is $((nolruresize_delta - $lruresize_delta))s faster with lru resize enabled" + log "ls -la is $(((nolruresize_delta - $lruresize_delta) * 100 / $nolruresize_delta))% faster with lru resize enabled" else log "lru resize performs the same with no lru resize" fi diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index d7fafbe..2a02950 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -75,6 +75,7 @@ init_test_env() { [ -d /r ] && export ROOT=${ROOT:-/r} export TMP=${TMP:-$ROOT/tmp} export TESTSUITELOG=${TMP}/${TESTSUITE}.log + export HOSTNAME=${HOSTNAME:-`hostname`} export PATH=:$PATH:$LUSTRE/utils:$LUSTRE/utils/gss:$LUSTRE/tests export LCTL=${LCTL:-"$LUSTRE/utils/lctl"} @@ -221,8 +222,11 @@ load_modules() { load_module llite/lustre load_module llite/llite_lloop - rm -f $TMP/ogdb-`hostname` - $LCTL modules > $TMP/ogdb-`hostname` + rm -f $TMP/ogdb-$HOSTNAME + OGDB=$TMP + [ -d /r ] && OGDB="/r/tmp" + $LCTL modules > $OGDB/ogdb-$HOSTNAME + # 'mount' doesn't look in $PATH, just sbin [ -f $LUSTRE/utils/mount.lustre ] && cp $LUSTRE/utils/mount.lustre /sbin/. || true } @@ -455,7 +459,7 @@ zconf_mount() { do_node $client "sysctl -w lnet.debug=$PTLDEBUG; sysctl -w lnet.subsystem_debug=${SUBSYSTEM# }; sysctl -w lnet.debug_mb=${DEBUG_SIZE}" - [ -d /r ] && $LCTL modules > /r/tmp/ogdb-`hostname` + [ -d /r ] && $LCTL modules > /r/tmp/ogdb-$HOSTNAME return 0 } @@ -466,6 +470,7 @@ zconf_umount() { local running=$(do_node $client "grep -c $mnt' ' /proc/mounts") || true if [ $running -ne 0 ]; then echo "Stopping client $mnt (opts:$force)" + lsof | grep "$mnt" || true do_node $client umount $force $mnt fi } @@ -765,7 +770,7 @@ facet_active_host() { local facet=$1 local active=`facet_active $facet` if [ "$facet" == client ]; then - hostname + echo $HOSTNAME else echo `facet_host $active` fi @@ -791,8 +796,11 @@ do_node() { HOST=$1 shift local myPDSH=$PDSH - if [ "$HOST" = "$(hostname)" ]; then + if [ "$HOST" = "$HOSTNAME" ]; then myPDSH="no_dsh" + elif [ -z "$myPDSH" -o "$myPDSH" = "no_dsh" ]; then + echo "cannot run remote command on $HOST with $myPDSH" + return 128 fi if $VERBOSE; then echo "CMD: $HOST $@" >&2 @@ -847,8 +855,8 @@ stopall() { fi # assume client mount is local - grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT $* - grep " $MOUNT2 " /proc/mounts && zconf_umount `hostname` $MOUNT2 $* + grep " $MOUNT " /proc/mounts && zconf_umount $HOSTNAME $MOUNT $* + grep " $MOUNT2 " /proc/mounts && zconf_umount $HOSTNAME $MOUNT2 $* [ "$CLIENTONLY" ] && return for num in `seq $MDSCOUNT`; do stop mds$num -f @@ -904,7 +912,7 @@ formatall() { } mount_client() { - grep " $1 " /proc/mounts || zconf_mount `hostname` $* + grep " $1 " /proc/mounts || zconf_mount $HOSTNAME $* } # return value: @@ -1415,11 +1423,21 @@ remote_mds () [ ! -e /proc/fs/lustre/mdt/*MDT* ] } +remote_mds_nodsh() +{ + remote_mds && [ "$PDSH" = "no_dsh" -o -z "$PDSH" -o -z "$mds_HOST" ] +} + remote_ost () { [ $(grep -c obdfilter $LPROC/devices) -eq 0 ] } +remote_ost_nodsh() +{ + remote_ost && [ "$PDSH" = "no_dsh" -o -z "$PDSH" -o -z "$ost_HOST" ] +} + mdts_nodes () { local MDSNODES=$(facet_host $SINGLEMDS) local NODES_sort @@ -1453,10 +1471,13 @@ osts_nodes () { nodes_list () { # FIXME. We need a list of clients - local myNODES=`hostname` + local myNODES=$HOSTNAME local myNODES_sort - myNODES="$myNODES $(osts_nodes) $(mdts_nodes)" + if [ "$PDSH" -a "$PDSH" != "no_dsh" ]; then + myNODES="$myNODES $(osts_nodes) $(mdts_nodes)" + fi + myNODES_sort=$(for i in $myNODES; do echo $i; done | sort -u) echo $myNODES_sort -- 1.8.3.1