From a67b6de00e31b3377009a1829032350cb344fa15 Mon Sep 17 00:00:00 2001
From: grev <grev>
Date: Wed, 22 Oct 2008 11:55:15 +0000
Subject: [PATCH] b=16551 (att 19784) o=Adilger i=grev skip replay/recovery
 tests if remote MDS/OSS with nodsh

b=16551 (att 19835)
i=Nathan
do skip_rem[mds|ost] check only if test suit is run; fail acc-sm if
tests suits were skipped due to nodsh

b=17326
i=Alexey.Lyashkov
remove now-useless remount/reconfig for liblustre;
always add accept=all fo lnet module
---
 lustre/tests/acceptance-small.sh  | 56 ++++++++++++++++++-------------
 lustre/tests/conf-sanity.sh       |  3 ++
 lustre/tests/insanity.sh          |  3 ++
 lustre/tests/lfscktest.sh         |  3 ++
 lustre/tests/recovery-small.sh    | 27 +++++++++++++--
 lustre/tests/replay-dual.sh       |  5 ++-
 lustre/tests/replay-ost-single.sh |  4 +++
 lustre/tests/replay-single.sh     | 30 +++++++++++++++++
 lustre/tests/sanity-quota.sh      |  3 ++
 lustre/tests/test-framework.sh    | 14 ++------
 10 files changed, 111 insertions(+), 37 deletions(-)

diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh
index dafd335621..372531458f 100755
--- a/lustre/tests/acceptance-small.sh
+++ b/lustre/tests/acceptance-small.sh
@@ -69,6 +69,18 @@ title() {
     RANTEST=${RANTEST}$*", "
 }
 
+skip_remost()
+{
+	remote_ost_nodsh && log "SKIP: $1: remote OST with nodsh" && return 0
+	return 1
+}
+
+skip_remmds()
+{
+	remote_mds_nodsh && log "SKIP: $1: remote MDS with nodsh" && return 0
+	return 1
+}
+
 for NAME in $CONFIGS; do
 	export NAME MOUNT START CLEAN
 	. $LUSTRE/tests/cfg/$NAME.sh
@@ -84,6 +96,8 @@ for NAME in $CONFIGS; do
 
 	setup_if_needed
 
+	MSKIPPED=0
+	OSKIPPED=0
 	if [ "$RUNTESTS" != "no" ]; then
 	        title runtests
 		bash runtests
@@ -263,19 +277,15 @@ for NAME in $CONFIGS; do
 		SANITYN="done"
 	fi
 
-	remote_mds && log "Remote MDS, skipping LFSCK test" && LFSCK=no
-	remote_ost && log "Remote OST, skipping LFSCK test" && LFSCK=no
-
-	if [ "$LFSCK" != "no" -a -x /usr/sbin/lfsck ]; then
+	[ "$LFSCK" != "no" ] && remote_mds && log "Remote MDS, skipping LFSCK test" && LFSCK=no && MSKIPPED=1
+	[ "$LFSCK" != "no" ] && remote_ost && log "Remote OST, skipping LFSCK test" && LFSCK=no && OSKIPPED=1
+	if [ "$LFSCK" != "no" ]; then
 	        title lfsck
-		E2VER=`e2fsck -V 2>&1 | head -n 1 | cut -d' ' -f 2`
-		if [ `echo $E2VER | cut -d. -f2` -ge 39 ] && \
-		   [ "`echo $E2VER | grep cfs`" -o \
-			"`echo $E2VER | grep sun`" ]; then
-		   		bash lfscktest.sh
+		if [ -x /usr/sbin/lfsck ]; then
+			bash lfscktest.sh
 		else
-			e2fsck -V
-			echo "e2fsck does not support lfsck, skipping"
+			log "$(e2fsck -V)"
+			log "SKIP: e2fsck does not support lfsck"
 		fi
 		LFSCK="done"
 	fi
@@ -284,18 +294,6 @@ for NAME in $CONFIGS; do
 	if [ "$LIBLUSTRE" != "no" ]; then
 	        title liblustre
 		assert_env MGSNID MOUNT2
-		$CLEANUP
-		unload_modules
-		# Liblustre needs accept=all, noacl
-		[ -f /etc/modprobe.conf ] && MODPROBECONF=/etc/modprobe.conf
-		[ -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre
-
-		LNETOPTS="$(awk '/^options lnet/ { print $0}' $MODPROBECONF | \
-			sed 's/^options lnet //g; s/"//g') accept=all" \
-			MDS_MOUNT_OPTS=$(echo $MDS_MOUNT_OPTS | sed 's/^[ \t]*//;s/[ \t]*$//') \
-			MDS_MOUNT_OPTS="${MDS_MOUNT_OPTS},noacl" \
-			MDS_MOUNT_OPTS=${MDS_MOUNT_OPTS/#,/-o } \
-			$SETUP
 		export LIBLUSTRE_MOUNT_POINT=$MOUNT2
 		export LIBLUSTRE_MOUNT_RETRY=5
 		export LIBLUSTRE_MOUNT_TARGET=$MGSNID:/$FSNAME
@@ -314,42 +312,52 @@ for NAME in $CONFIGS; do
 	$CLEANUP
 done
 
+[ "$REPLAY_SINGLE" != "no" ] && skip_remmds replay-single && REPLAY_SINGLE=no && MSKIPPED=1
 if [ "$REPLAY_SINGLE" != "no" ]; then
         title replay-single
 	bash replay-single.sh
 	REPLAY_SINGLE="done"
 fi
 
+[ "$CONF_SANITY" != "no" ] && skip_remmds conf-sanity && CONF_SANITY=no && MSKIPPED=1
+[ "$CONF_SANITY" != "no" ] && skip_remost conf-sanity && CONF_SANITY=no && OSKIPPED=1
 if [ "$CONF_SANITY" != "no" ]; then
         title conf-sanity
         bash conf-sanity.sh
         CONF_SANITY="done"
 fi
 
+[ "$RECOVERY_SMALL" != "no" ] && skip_remmds recover-small && RECOVERY_SMALL=no && MSKIPPED=1
 if [ "$RECOVERY_SMALL" != "no" ]; then
         title recovery-small
         bash recovery-small.sh
         RECOVERY_SMALL="done"
 fi
 
+[ "$REPLAY_OST_SINGLE" != "no" ] && skip_remost replay-ost-single && REPLAY_OST_SINGLE=no && OSKIPPED=1
 if [ "$REPLAY_OST_SINGLE" != "no" ]; then
         title replay-ost-single
         bash replay-ost-single.sh
         REPLAY_OST_SINGLE="done"
 fi
 
+[ "$REPLAY_DUAL" != "no" ] && skip_remost replay-dual && REPLAY_DUAL=no && OSKIPPED=1
 if [ "$REPLAY_DUAL" != "no" ]; then
         title replay-dual
         bash replay-dual.sh
         REPLAY_DUAL="done"
 fi
 
+[ "$INSANITY" != "no" ] && skip_remmds insanity && INSANITY=no && MSKIPPED=1
+[ "$INSANITY" != "no" ] && skip_remost insanity && INSANITY=no && OSKIPPED=1
 if [ "$INSANITY" != "no" ]; then
         title insanity
         bash insanity.sh -r
         INSANITY="done"
 fi
 
+[ "$SANITY_QUOTA" != "no" ] && skip_remmds sanity-quota && SANITY_QUOTA=no && MSKIPPED=1
+[ "$SANITY_QUOTA" != "no" ] && skip_remost sanity-quota && SANITY_QUOTA=no && OSKIPPED=1
 if [ "$SANITY_QUOTA" != "no" ]; then
         title sanity-quota
         bash sanity-quota.sh
@@ -371,4 +379,6 @@ title FINISHED
 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
 echo "Tests ran: $RANTEST"
 print_summary
+[ "$MSKIPPED" = 1 ] && log "FAIL: remote MDS tests skipped" && RC=1
+[ "$OSKIPPED" = 1 ] && log "FAIL: remote OST tests skipped" && RC=1
 echo "$0: completed with rc $RC" && exit $RC
diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh
index 0f54f7f976..9e38a0c0c9 100644
--- a/lustre/tests/conf-sanity.sh
+++ b/lustre/tests/conf-sanity.sh
@@ -34,6 +34,9 @@ MDSSIZE=40000
 OSTSIZE=40000
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 
+remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
+remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
+
 #
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="0 1 2 3 6 7 15 18 24b 25 30 31 32 33 34a "
 
diff --git a/lustre/tests/insanity.sh b/lustre/tests/insanity.sh
index df7e8b6e92..2fa8187e0d 100755
--- a/lustre/tests/insanity.sh
+++ b/lustre/tests/insanity.sh
@@ -35,6 +35,9 @@ assert_env mds_HOST MDS_MKFS_OPTS MDSDEV
 assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
 assert_env LIVE_CLIENT FSNAME
 
+remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
+remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
+
 # FAIL_CLIENTS list should not contain the LIVE_CLIENT
 FAIL_CLIENTS=$(echo " $FAIL_CLIENTS " | sed -re "s/\s+$LIVE_CLIENT\s+/ /g")
 
diff --git a/lustre/tests/lfscktest.sh b/lustre/tests/lfscktest.sh
index d7691f627a..67fbd7ed5e 100755
--- a/lustre/tests/lfscktest.sh
+++ b/lustre/tests/lfscktest.sh
@@ -25,6 +25,9 @@ LUSTRE=${LUSTRE:-`dirname $0`/..}
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 
+remote_mds && skip "remote MDS" && exit 0
+remote_ost && skip "remote OST" && exit 0
+
 # if nothing mounted, don't nuke MOUNT variable needed in llmount.sh
 WAS_MOUNTED=$(mounted_lustre_filesystems | head -1)
 if [ -z "$WAS_MOUNTED" ]; then
diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh
index ba92229fbe..ba6bc91d78 100755
--- a/lustre/tests/recovery-small.sh
+++ b/lustre/tests/recovery-small.sh
@@ -11,6 +11,8 @@ LUSTRE=${LUSTRE:-`dirname $0`/..}
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 
+remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
+
 # also long tests: 19, 21a, 21e, 21f, 23, 27
 #                                   1  2.5  2.5    4    4          (min)"
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="17  26a  26b    50   51     57"
@@ -23,6 +25,7 @@ SETUP=${SETUP:-""}
 CLEANUP=${CLEANUP:-""}
 
 cleanup_and_setup_lustre
+
 assert_DIR
 rm -rf $DIR/[df][0-9]*
 
@@ -94,6 +97,8 @@ dd if=/dev/urandom of=$SAMPLE_FILE bs=1M count=4
 
 #bug 1420
 test_9() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     pause_bulk "cp /etc/profile $DIR/$tfile"       || return 1
     do_facet client "cp $SAMPLE_FILE $DIR/${tfile}.2"  || return 2
     do_facet client "sync"
@@ -184,6 +189,8 @@ start_read_ahead() {
 }
 
 test_16() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     do_facet client cp $SAMPLE_FILE $DIR
     sync
     stop_read_ahead
@@ -204,6 +211,8 @@ run_test 16 "timeout bulk put, don't evict client (2732)"
 test_17() {
     local at_max_saved=0
 
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     # With adaptive timeouts, bulk_get won't expire until adaptive_timeout_max
     if at_is_valid && at_is_enabled; then
         at_max_saved=$(at_max_get ost1)
@@ -258,6 +267,8 @@ test_18a() {
 run_test 18a "manual ost invalidate clears page cache immediately"
 
 test_18b() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     do_facet client mkdir -p $DIR/$tdir
     f=$DIR/$tdir/$tfile
     f2=$DIR/$tdir/${tfile}-2
@@ -286,6 +297,8 @@ test_18b() {
 run_test 18b "eviction and reconnect clears page cache (2766)"
 
 test_18c() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     do_facet client mkdir -p $DIR/$tdir
     f=$DIR/$tdir/$tfile
     f2=$DIR/$tdir/${tfile}-2
@@ -343,6 +356,8 @@ test_19b() {
 run_test 19b "test expired_lock_main on ost (2867)"
 
 test_20a() {	# bug 2983 - ldlm_handle_enqueue cleanup
+	remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
 	mkdir -p $DIR/$tdir
 	lfs setstripe $DIR/$tdir/${tfile} -i 0 -c 1
 	multiop_bg_pause $DIR/$tdir/${tfile} O_wc || return 1
@@ -358,6 +373,8 @@ test_20a() {	# bug 2983 - ldlm_handle_enqueue cleanup
 run_test 20a "ldlm_handle_enqueue error (should return error)" 
 
 test_20b() {	# bug 2986 - ldlm_handle_enqueue error during open
+	remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
 	mkdir -p $DIR/$tdir
 	lfs setstripe $DIR/$tdir/${tfile} -i 0 -c 1
 	cancel_lru_locks osc
@@ -597,6 +614,8 @@ test_23() { #b=4561
 run_test 23 "client hang when close a file after mds crash"
 
 test_24() { # bug 11710 details correct fsync() behavior
+	remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
 	mkdir -p $DIR/$tdir
 	lfs setstripe $DIR/$tdir -s 0 -i 0 -c 1
 	cancel_lru_locks osc
@@ -615,6 +634,7 @@ run_test 24 "fsync error (should return error)"
 test_26a() {      # was test_26 bug 5921 - evict dead exports by pinger
 # this test can only run from a client on a separate node.
 	remote_ost || { skip "local OST" && return 0; }
+	remote_ost_nodsh && skip "remote OST with nodsh" && return 0
 	remote_mds || { skip "local MDS" && return 0; }
 	OST_FILE=obdfilter.${ost1_svc}.num_exports
         OST_EXP="`do_facet ost1 lctl get_param -n $OST_FILE`"
@@ -637,6 +657,8 @@ test_26a() {      # was test_26 bug 5921 - evict dead exports by pinger
 run_test 26a "evict dead exports"
 
 test_26b() {      # bug 10140 - evict dead exports by pinger
+	remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
 	client_df
 	zconf_mount `hostname` $MOUNT2 || error "Failed to mount $MOUNT2"
 	MDS_FILE=mds.${mds_svc}.num_exports
@@ -661,7 +683,6 @@ test_26b() {      # bug 10140 - evict dead exports by pinger
 run_test 26b "evict dead exports"
 
 test_27() {
-	remote_mds && { skip "remote MDS" && return 0; }
 	mkdir -p $DIR/$tdir
 	writemany -q -a $DIR/$tdir/$tfile 0 5 &
 	CLIENT_PID=$!
@@ -776,6 +797,8 @@ test_52_guts() {
 }
 
 test_52() {
+	remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
 	mkdir -p $DIR/$tdir
 	test_52_guts 1
 	rc=$?
@@ -816,7 +839,7 @@ run_test 54 "back in time"
 
 # bug 11330 - liblustre application death during I/O locks up OST
 test_55() {
-	remote_ost && { skip "remote OST" && return 0; }
+	remote_ost_nodsh && skip "remote OST with nodsh" && return 0
 
 	mkdir -p $DIR/$tdir
 
diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh
index 8d38be6f6c..b0a3e4c4cc 100755
--- a/lustre/tests/replay-dual.sh
+++ b/lustre/tests/replay-dual.sh
@@ -24,7 +24,8 @@ init_test_env $@
 
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 
-#
+remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
+
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="1 2 3 4 5 14"
 
 build_test_filter
@@ -321,6 +322,8 @@ test_16() {
 run_test 16 "fail MDS during recovery (3571)"
 
 test_17() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     createmany -o $MOUNT1/$tfile- 25
     createmany -o $MOUNT2/$tfile-2- 1
 
diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh
index 087aef8325..5c60d332a9 100755
--- a/lustre/tests/replay-ost-single.sh
+++ b/lustre/tests/replay-ost-single.sh
@@ -13,6 +13,8 @@ init_test_env $@
 ostfailover_HOST=${ostfailover_HOST:-$ost_HOST}
 #failover= must be defined in OST_MKFS_OPTIONS if ostfailover_HOST != ost_HOST
 
+remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
+
 # Tests that fail on uml
 CPU=`awk '/model/ {print $4}' /proc/cpuinfo`
 [ "$CPU" = "UML" ] && EXCEPT="$EXCEPT 6"
@@ -122,6 +124,8 @@ kbytesfree() {
 }
 
 test_6() {
+    remote_mds_nodsh && skip "remote MDS with nodsh" && return 0
+
     f=$DIR/$tfile
     rm -f $f
     sync && sleep 2 && sync	# wait for delete thread
diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh
index 0433306200..5d50ac90e1 100755
--- a/lustre/tests/replay-single.sh
+++ b/lustre/tests/replay-single.sh
@@ -16,6 +16,8 @@ init_test_env $@
 CHECK_GRANT=${CHECK_GRANT:-"yes"}
 GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
 
+remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
+
 # Skip these tests
 # bug number:
 ALWAYS_EXCEPT="$REPLAY_SINGLE_EXCEPT"
@@ -46,6 +48,8 @@ test_0a() {	# was test_0
 run_test 0a "empty replay"
 
 test_0b() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     # this test attempts to trigger a race in the precreation code, 
     # and must run before any other objects are created on the filesystem
     fail ost1
@@ -832,6 +836,8 @@ run_test 42 "recovery after ost failure"
 
 # timeout in MDS/OST recovery RPC will LBUG MDS
 test_43() { # bug 2530
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     replay_barrier mds
 
     # OBD_FAIL_OST_CREATE_NET 0x204
@@ -924,6 +930,8 @@ test_46() {
 run_test 46 "Don't leak file handle after open resend (3325)"
 
 test_47() { # bug 2824
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     # create some files to make sure precreate has been done on all 
     # OSTs. (just in case this test is run independently)
     createmany -o $DIR/$tfile 20  || return 1
@@ -947,6 +955,8 @@ test_47() { # bug 2824
 run_test 47 "MDS->OSC failure during precreate cleanup (2824)"
 
 test_48() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     replay_barrier mds
     createmany -o $DIR/$tfile 20  || return 1
     # OBD_FAIL_OST_EROFS 0x216
@@ -1307,6 +1317,8 @@ run_test 58c "resend/reconstruct setxattr op"
 # log_commit_thread vs filter_destroy race used to lead to import use after free
 # bug 11658
 test_59() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     mkdir -p $DIR/$tdir
     createmany -o $DIR/$tdir/$tfile-%d 200
     sync
@@ -1352,6 +1364,8 @@ run_test 60 "test llog post recovery init vs llog unlink"
 
 #test race  llog recovery thread vs llog cleanup
 test_61a() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     mkdir -p $DIR/$tdir
     createmany -o $DIR/$tdir/$tfile-%d 800
     replay_barrier ost1 
@@ -1381,6 +1395,8 @@ run_test 61b "test race mds llog sync vs llog cleanup"
 
 #test race  cancel cookie cb vs llog cleanup
 test_61c() {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
 #   OBD_FAIL_OST_CANCEL_COOKIE_TIMEOUT 0x222 
     touch $DIR/$tfile 
     do_facet ost "lctl set_param fail_loc=0x80000222"
@@ -1456,6 +1472,8 @@ at_start()
 
 test_65a() #bug 3055
 {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     at_start || return 0
     $LCTL dk > /dev/null
     debugsave
@@ -1482,6 +1500,8 @@ run_test 65a "AT: verify early replies"
 
 test_65b() #bug 3055
 {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     at_start || return 0
     # turn on D_ADAPTTO
     debugsave
@@ -1513,6 +1533,8 @@ run_test 65b "AT: verify early replies on packed reply / bulk"
 
 test_66a() #bug 3055
 {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     at_start || return 0
     lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | grep "portal 12"
     # adjust 5s at a time so no early reply is sent (within deadline)
@@ -1541,6 +1563,8 @@ run_test 66a "AT: verify MDT service time adjusts with no early replies"
 
 test_66b() #bug 3055
 {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     at_start || return 0
     ORIG=$(lctl get_param -n mdc.${FSNAME}-*.timeouts | awk '/network/ {print $4}')
     lctl set_param fail_val=$(($ORIG + 5))
@@ -1557,6 +1581,8 @@ run_test 66b "AT: verify net latency adjusts"
 
 test_67a() #bug 3055
 {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     at_start || return 0
     CONN1=$(lctl get_param -n osc.*.stats | awk '/_connect/ {total+=$2} END {print total}')
     # sleeping threads may drive values above this
@@ -1576,6 +1602,8 @@ run_test 67a "AT: verify slow request processing doesn't induce reconnects"
 
 test_67b() #bug 3055
 {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     at_start || return 0
     CONN1=$(lctl get_param -n osc.*.stats | awk '/_connect/ {total+=$2} END {print total}')
 #define OBD_FAIL_OST_PAUSE_CREATE        0x223
@@ -1604,6 +1632,8 @@ run_test 67b "AT: verify instant slowdown doesn't induce reconnects"
 
 test_68 () #bug 13813
 {
+    remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
     at_start || return 0
     local ldlm_enqueue_min=$(find /sys -name ldlm_enqueue_min)
     [ -z "$ldlm_enqueue_min" ] && skip "missing /sys/.../ldlm_enqueue_min" && return 0
diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh
index a5ab50797b..9645fb6a4d 100644
--- a/lustre/tests/sanity-quota.sh
+++ b/lustre/tests/sanity-quota.sh
@@ -48,6 +48,9 @@ init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 DIRECTIO=${DIRECTIO:-$LUSTRE/tests/directio}
 
+remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
+remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
+
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="9 10 11 18b 21"
 
 QUOTALOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh
index 14e3eab9f9..dba511b4c1 100644
--- a/lustre/tests/test-framework.sh
+++ b/lustre/tests/test-framework.sh
@@ -172,6 +172,7 @@ load_modules() {
     [ -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre
     [ -z "$LNETOPTS" -a -n "$MODPROBECONF" ] && \
         LNETOPTS=$(awk '/^options lnet/ { print $0}' $MODPROBECONF | sed 's/^options lnet //g')
+    echo $LNETOPTS | grep -q "accept=all"  || LNETOPTS="$LNETOPTS accept=all";
     echo "lnet options: '$LNETOPTS'"
     # note that insmod will ignore anything in modprobe.conf
     load_module ../lnet/lnet/lnet $LNETOPTS
@@ -1184,15 +1185,6 @@ set_nodes_failloc () {
     done
 }
 
-set_nodes_failloc () {
-    local nodes=$1
-    local node
-
-    for node in $nodes ; do
-        do_node $node sysctl -w lustre.fail_loc=$2
-    done
-}
-
 cancel_lru_locks() {
     $LCTL mark "cancel_lru_locks $1 start"
     for d in `lctl get_param -N ldlm.namespaces.*.lru_size | egrep -i $1`; do
@@ -1516,7 +1508,7 @@ osc_to_ost()
 
 remote_mds ()
 {
-    [ -z "$(lctl dl | grep mdt)" ]
+    [ "$mds_HOST" != "$(hostname)" ]
 }
 
 remote_mds_nodsh()
@@ -1526,7 +1518,7 @@ remote_mds_nodsh()
 
 remote_ost ()
 {
-    [ -z "$(lctl dl | grep ost)" ]
+    [ "$ost_HOST" != "$(hostname)" ]
 }
 
 remote_ost_nodsh()
-- 
GitLab