Whamcloud - gitweb
b=20878
[fs/lustre-release.git] / lustre / tests / lreplicate-test.sh
index 12dbcb9..563839d 100644 (file)
@@ -10,8 +10,8 @@ SRCDIR=`dirname $0`
 export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
 
 ONLY=${ONLY:-"$*"}
-ALWAYS_EXCEPT="$LREPLICATE_EXCEPT"
-# bug number for skipped test: -
+ALWAYS_EXCEPT="$LREPLICATE_EXCEPT 5a 5b"
+# bug number for skipped test: -  20878
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 [ "$ALWAYS_EXCEPT$EXCEPT" ] && \
@@ -187,7 +187,6 @@ test_1() {
     fini_changelog
     cleanup_src_tgt
     return $RC
-
 }
 run_test 1 "Simple Replication"
 
@@ -392,7 +391,20 @@ test_4() {
 
     $KILL -SIGCONT $child_pid
     sleep 60
-    $KILL -SIGKILL $child_pid
+    $KILL -SIGKILL $(pgrep run_iozone.sh)
+    $KILL -SIGKILL $(pgrep iozone)
+
+    # After killing 'run_iozone.sh', process 'iozone' becomes the
+    # child of PID 1. Hence 'wait' does not wait for it. Killing
+    # iozone first, means more iozone processes are spawned off which
+    # is not desirable. So, after sending a sigkill, the test goes
+    # into a wait loop for iozone to cleanup and exit.
+    wait
+    while [ "$(pgrep "iozone")" != "" ];
+    do
+      ps -ef | grep iozone | grep -v grep
+      sleep 1;
+    done
 
     $LREPLICATE -l $LREPL_LOG
     check_diff $DIR/$tdir $TGT/$tdir
@@ -505,9 +517,9 @@ test_7() {
     createmany -o $DIR/$tdir/$tfile $NUMFILES
 
     # To simulate replication to another lustre filesystem, replicate
-    # the changes to $DIR/tgt. Disable changelogs before replication
-    # so that the files created as part of replication are not logged.
-    do_facet $SINGLEMDS lctl set_param -n mdd.$MDT0.changelog off
+    # the changes to $DIR/tgt. We can't turn off the changelogs
+    # while we are registered, so lreplicate better not try to 
+    # replicate the replication steps.  It seems ok :)
     mkdir $DIR/tgt
 
     $LREPLICATE -s $DIR -t $DIR/tgt -m $MDT0 -u $CL_USER -l $LREPL_LOG
@@ -563,5 +575,5 @@ log "cleanup: ======================================================"
 cd $ORIG_PWD
 check_and_cleanup_lustre
 echo '=========================== finished ==============================='
-[ -f "$REPLOG" ] && cat $REPLLOG && grep -q FAIL $REPLLOG && exit 1 || true
+[ -f "$REPLLOG" ] && cat $REPLLOG && grep -q FAIL $REPLLOG && exit 1 || true
 echo "$0: completed"