Whamcloud - gitweb
LU-13019 tests: replace usleep in test scripts
[fs/lustre-release.git] / lustre / tests / replay-dual.sh
index 2114600..8aa6de8 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!
 
 [[ "$mds1_FSTYPE" == zfs ]] &&
-# bug number for skipped test:       LU-2230
+# 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
@@ -454,7 +451,7 @@ test_18() { # bug 3822 - evicting client with enqueued lock
        do_facet client lctl set_param ldlm.namespaces.*.early_lock_cancel=0
        do_facet client lctl set_param fail_loc=0x80000305  # drop cb, evict
        cancel_lru_locks mdc
-       usleep 500 # wait to ensure first client is one that will be evicted
+       sleep 0.1 # wait to ensure first client is one that will be evicted
        openfile -f O_RDONLY $MOUNT2/$tdir/$tfile
        wait $OPENPID
        do_facet client lctl set_param ldlm.namespaces.*.early_lock_cancel=1
@@ -637,6 +634,7 @@ test_22a () {
        do_facet mds$((MDTIDX + 1)) lctl set_param fail_loc=0x119
        do_node $CLIENT1 $LFS mkdir -i $MDTIDX $MOUNT1/$remote_dir &
        CLIENT_PID=$!
+       sleep 1
 
        fail mds$((MDTIDX + 1))
        wait $CLIENT_PID || error "lfs mkdir failed"
@@ -663,6 +661,7 @@ test_22b () {
        do_facet mds$((MDTIDX + 1)) lctl set_param fail_loc=0x119
        do_node $CLIENT1 $LFS mkdir -i $MDTIDX $MOUNT1/$remote_dir &
        CLIENT_PID=$!
+       sleep 1
 
        fail mds${MDTIDX},mds$((MDTIDX + 1))
        wait $CLIENT_PID || error "lfs mkdir failed"
@@ -693,6 +692,7 @@ test_22c () {
        do_facet mds$MDTIDX lctl set_param fail_loc=0x1701
        do_node $CLIENT1 $LFS mkdir -i $MDTIDX $MOUNT1/$remote_dir &
        CLIENT_PID=$!
+       sleep 1
        do_facet mds$MDTIDX lctl set_param fail_loc=0
 
        fail mds$MDTIDX
@@ -720,6 +720,7 @@ test_22d () {
        do_facet mds$MDTIDX lctl set_param fail_loc=0x1701
        do_node $CLIENT1 $LFS mkdir -i $MDTIDX $MOUNT1/$remote_dir &
        CLIENT_PID=$!
+       sleep 1
        do_facet mds$MDTIDX lctl set_param fail_loc=0
 
        fail mds${MDTIDX},mds$((MDTIDX + 1))
@@ -764,6 +765,7 @@ test_23a () {
        do_facet mds$((MDTIDX + 1)) lctl set_param fail_loc=0x119
        do_node $CLIENT1 rmdir $MOUNT1/$remote_dir &
        local CLIENT_PID=$!
+       sleep 1
        do_facet mds$((MDTIDX + 1)) lctl set_param fail_loc=0
 
        fail mds$((MDTIDX + 1))
@@ -793,6 +795,7 @@ test_23b () {
        do_facet mds$((MDTIDX + 1)) lctl set_param fail_loc=0x119
        do_node $CLIENT1 rmdir $MOUNT1/$remote_dir &
        local CLIENT_PID=$!
+       sleep 1
        do_facet mds$((MDTIDX + 1)) lctl set_param fail_loc=0
 
        fail mds${MDTIDX},mds$((MDTIDX + 1))
@@ -827,6 +830,7 @@ test_23c () {
        do_facet mds${MDTIDX} lctl set_param fail_loc=0x1701
        do_node $CLIENT1 rmdir $MOUNT1/$remote_dir &
        CLIENT_PID=$!
+       sleep 1
        do_facet mds${MDTIDX} lctl set_param fail_loc=0
 
        fail mds${MDTIDX}
@@ -856,6 +860,7 @@ test_23d () {
        do_facet mds${MDTIDX} lctl set_param fail_loc=0x1701
        do_node $CLIENT1 rmdir $MOUNT1/$remote_dir &
        CLIENT_PID=$!
+       sleep 1
        do_facet mds${MDTIDX} lctl set_param fail_loc=0
 
        fail mds${MDTIDX},mds$((MDTIDX + 1))