Whamcloud - gitweb
LU-1538 tests: standardize test script init – failover
[fs/lustre-release.git] / lustre / tests / replay-dual.sh
index f9af360..ea5df4e 100755 (executable)
@@ -2,43 +2,40 @@
 
 set -e
 
-# bug number:  LU-2012 LU-8333 LU-7372
-ALWAYS_EXCEPT="14b     21b     26      $REPLAY_DUAL_EXCEPT"
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
-SAVE_PWD=$PWD
 PTLDEBUG=${PTLDEBUG:--1}
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
-SETUP=${SETUP:-""}
-CLEANUP=${CLEANUP:-""}
 MOUNT_2=${MOUNT_2:-"yes"}
-export MULTIOP=${MULTIOP:-multiop}
-. $LUSTRE/tests/test-framework.sh
 
+LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+. $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
 remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
 
-#                                   7  (min)"
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="21b"
+ALWAYS_EXCEPT="$REPLAY_DUAL_EXCEPT "
+# bug number for skipped test:  LU-2012 LU-8333 LU-7372
+ALWAYS_EXCEPT+="                14b     21b     26 "
+# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
-[[ $(facet_fstype $SINGLEMDS) == zfs ]] &&
-# bug number for skipped test:       LU-2230
+[[ "$mds1_FSTYPE" == zfs ]] &&
+# bug number for skipped test:        LU-2230
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT 21b"
+
 if $SHARED_KEY; then
-# bug number for skipped tests:        LU-9795 LU-9795
-       ALWAYS_EXCEPT="         0a      0b      $ALWAYS_EXCEPT"
+# bug number for skipped tests:  LU-9795 LU-9795
+       ALWAYS_EXCEPT+="         0a      0b "
 fi
 
-build_test_filter
+#                                   7  (min)"
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="21b "
 
+build_test_filter
 check_and_setup_lustre
+
 MOUNTED=$(mounted_lustre_filesystems)
 if ! $(echo $MOUNTED' ' | grep -w -q $MOUNT2' '); then
-    zconf_mount $HOSTNAME $MOUNT2
-    MOUNTED2=yes
+       zconf_mount $HOSTNAME $MOUNT2
+       MOUNTED2=yes
 fi
 
 assert_DIR
@@ -873,8 +870,8 @@ test_23d () {
 run_test 23d "c1 rmdir d1, M0 drop update reply and fail M0/M1, c2 mkdir d1"
 
 test_24 () {
-       [[ $(lustre_version_code $SINGLEMDS) -gt $(version_code 2.5.2) ]] ||
-               { skip "Need MDS version newer than 2.5.2"; return 0; }
+       [[ "$MDS1_VERSION" -gt $(version_code 2.5.2) ]] ||
+               skip "Need MDS version newer than 2.5.2"
 
        touch $MOUNT/$tfile
        stat $MOUNT/$tfile >&/dev/null
@@ -908,7 +905,7 @@ test_25() {
        sleep 1
 
        # failover, replay and resend replayed waiting locks
-       if [ $(lustre_version_code ost1) -ge $(version_code 2.6.90) ]; then
+       if [ "$OST1_VERSION" -ge $(version_code 2.6.90) ]; then
                #define OBD_FAIL_LDLM_SRV_CP_AST      0x325
                do_facet ost1 lctl set_param fail_loc=0x80000325
        else