Whamcloud - gitweb
b=17931
[fs/lustre-release.git] / lustre / tests / replay-dual.sh
index 8806f2a..c6428c7 100755 (executable)
@@ -31,6 +31,12 @@ remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
 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
+fi
+
 assert_DIR
 rm -rf $DIR/[df][0-9]*
 
@@ -430,46 +436,6 @@ test_21a() {
 }
 run_test 21a "commit on sharing"
 
-shutdown_client() {
-    local client=$1
-    local mnt=$2
-
-    if [ "$FAILURE_MODE" = HARD ]; then
-       $POWER_DOWN $client
-       while ping -w 3 -c 1 $client > /dev/null 2>&1; do
-           echo "waiting for node $client to fail"
-           sleep 1
-       done
-    else
-       zconf_umount_clients $client $mnt -f
-    fi
-}
-
-# CMD: determine mds index where directory inode presents 
-get_mds_dir () {
-    local dir=$1
-    local file=$dir/$tfile
-
-    rm -f $file
-    local iused=$(lfs df -i $dir | grep MDT | awk '{print $3}')
-    local oldused=($iused)
-
-    touch $file
-    sleep 1
-    iused=$(lfs df -i $dir | grep MDT | awk '{print $3}')
-    local newused=($iused)
-
-    local num=0
-    for ((i=0; i<${#newused[@]}; i++)); do
-         if [ ${oldused[$i]} -lt ${newused[$i]} ];  then
-             echo $(( i + 1 ))
-             rm -f $dir/$tfile
-             return 0
-         fi 
-    done
-    error "mdt-s : inodes count OLD ${oldused[@]} NEW ${newused[@]}"
-}
-
 test_21b_sub () {
     local mds=$1 
     do_node $CLIENT1 rm -f $MOUNT1/$tfile-*
@@ -539,6 +505,6 @@ run_test 21b "commit on sharing, two clients"
 equals_msg `basename $0`: test complete, cleaning up
 SLEEP=$((`date +%s` - $NOW))
 [ $SLEEP -lt $TIMEOUT ] && sleep $SLEEP
+[ "$MOUNTED2" = yes ] && zconf_umount $HOSTNAME $MOUNT2 || true
 check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true
-
+[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true