Whamcloud - gitweb
LU-10994 test: remove netdisk from obdfilter-survey
[fs/lustre-release.git] / lustre / tests / mmp.sh
index d3b5632..a4997ed 100755 (executable)
@@ -10,19 +10,17 @@ set -e
 
 ONLY=${ONLY:-"$*"}
 
-# bug number for skipped test:
-ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"$MMP_EXCEPT"}
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
-SRCDIR=$(cd $(dirname $0); echo $PWD)
-export PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH:/sbin
-
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
+# bug number for skipped test:
+ALWAYS_EXCEPT=$MMP_EXCEPT
+# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
+
+build_test_filter
+
 remote_mds_nodsh && skip "remote MDS with nodsh"
 remote_ost_nodsh && skip "remote OST with nodsh"
 
@@ -36,8 +34,6 @@ fi
 SAVED_FAIL_ON_ERROR=$FAIL_ON_ERROR
 FAIL_ON_ERROR=false
 
-build_test_filter
-
 # Get the failover facet.
 get_failover_facet() {
     local facet=$1
@@ -411,11 +407,12 @@ mount_after_reboot() {
 # Run e2fsck on the Lustre server target.
 run_e2fsck() {
        local facet=$1
-       shift
-       local device=$1
-       shift
+       local device=$2
+       shift 2
        local opts="$@"
 
+       # turn on pfsck if it is supported
+       do_facet $facet $E2FSCK -h 2>&1 | grep -qw -- -m && opts+=" -m8"
        echo "Running e2fsck on the device $device on $facet..."
        do_facet $facet "$E2FSCK $opts $device"
        return ${PIPESTATUS[0]}