Whamcloud - gitweb
LU-1303 mds: integration lod/osp into the stack
[fs/lustre-release.git] / lustre / tests / lustre-rsync-test.sh
index e09985e..b07d1e7 100644 (file)
@@ -20,6 +20,9 @@ ALWAYS_EXCEPT="$LRSYNC_EXCEPT"
 [ "$ALWAYS_EXCEPT$EXCEPT" ] && \
         echo "Skipping tests: `echo $ALWAYS_EXCEPT $EXCEPT`"
 
+# disable till changelogs from orion landed (LU-2034)
+ALWAYS_EXCEPT="1 2 3 4 5 6 7 8 9"
+
 KILL=/bin/kill
 
 TMP=${TMP:-/tmp}
@@ -42,7 +45,7 @@ build_test_filter
 
 export LRSYNC=${LRSYNC:-"$LUSTRE/utils/lustre_rsync"}
 [ ! -f "$LRSYNC" ] && export LRSYNC=$(which lustre_rsync)
-export LRSYNC="$LRSYNC -v" # -a
+export LRSYNC="$LRSYNC -v -c no" # -a
 
 # control the time of tests
 DBENCH_TIME=${DBENCH_TIME:-60}  # No of seconds to run dbench
@@ -108,13 +111,16 @@ check_xattr() {
 }
 
 check_diff() {
-    if [ -e $1 -o -e $2 ]; then 
-        diff -rq -x "dev1" $1 $2
-        local RC=$?
-        if [ $RC -ne 0 ]; then
-            error "Failure in replication; differences found."
-        fi
-    fi
+       local changelog_file=$LOGDIR/${TESTSUITE}.test_${3}.changelog
+
+       if [ -e $1 -o -e $2 ]; then
+               diff -rq -x "dev1" $1 $2
+               local RC=$?
+               if [ $RC -ne 0 ]; then
+                       $LFS changelog $MDT0 > $changelog_file
+                       error "Failure in replication; differences found."
+               fi
+       fi
 }
 
 # Test 1 - test basic operations
@@ -192,8 +198,8 @@ test_1() {
     fi
 
     # Use diff to compare the source and the destination
-    check_diff $DIR/$tdir $TGT/$tdir
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 1
+    check_diff $DIR/$tdir $TGT2/$tdir 1
 
     fini_changelog
     cleanup_src_tgt
@@ -214,8 +220,8 @@ test_2a() {
     $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
 
     # Use diff to compare the source and the destination
-    check_diff $DIR/$tdir $TGT/$tdir
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 2a
+    check_diff $DIR/$tdir $TGT2/$tdir 2a
 
     fini_changelog
     cleanup_src_tgt
@@ -242,7 +248,7 @@ test_2b() {
 
     echo Starting replication
     $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
-    check_diff $DIR/$tdir $TGT/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 2b
 
     echo Resuming dbench
     $KILL -SIGCONT $child_pid
@@ -253,7 +259,7 @@ test_2b() {
 
     echo Starting replication
     $LRSYNC -l $LREPL_LOG
-    check_diff $DIR/$tdir $TGT/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 2b
 
     echo "Wait for dbench to finish"
     $KILL -SIGCONT $child_pid
@@ -263,8 +269,8 @@ test_2b() {
     echo Starting replication
     $LRSYNC -l $LREPL_LOG
 
-    check_diff $DIR/$tdir $TGT/$tdir
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 2b
+    check_diff $DIR/$tdir $TGT2/$tdir 2b
 
     fini_changelog
     cleanup_src_tgt
@@ -296,8 +302,8 @@ test_2c() {
     done
 
     # Use diff to compare the source and the destination
-    check_diff $DIR/$tdir $TGT/$tdir
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 2c
+    check_diff $DIR/$tdir $TGT2/$tdir 2c
 
     fini_changelog
     cleanup_src_tgt
@@ -317,8 +323,8 @@ test_3a() {
 
     # Replicate the changes to $TGT
     $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
-    check_diff $DIR/$tdir $TGT/$tdir   
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 3a
+    check_diff $DIR/$tdir $TGT2/$tdir 3a
 
     fini_changelog
     cleanup_src_tgt
@@ -341,8 +347,8 @@ test_3b() {
     # Replicate the changes to $TGT
     $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
 
-    check_diff $DIR/$tdir $TGT/$tdir   
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 3b
+    check_diff $DIR/$tdir $TGT2/$tdir 3b
 
     fini_changelog
     cleanup_src_tgt
@@ -363,8 +369,8 @@ test_3c() {
 
     # Replicate the changes to $TGT
     $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0  -u $CL_USER -l $LREPL_LOG
-    check_diff $DIR/$tdir $TGT/$tdir   
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 3c
+    check_diff $DIR/$tdir $TGT2/$tdir 3c
 
     fini_changelog
     cleanup_src_tgt
@@ -393,8 +399,8 @@ test_4() {
 
     # Replicate the changes to $TGT
     $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0  -u $CL_USER -l $LREPL_LOG
-    check_diff $DIR/$tdir $TGT/$tdir
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 4
+    check_diff $DIR/$tdir $TGT2/$tdir 4
 
     $KILL -SIGCONT $child_pid
     sleep 60
@@ -414,8 +420,8 @@ test_4() {
     done
 
     $LRSYNC -l $LREPL_LOG
-    check_diff $DIR/$tdir $TGT/$tdir
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 4
+    check_diff $DIR/$tdir $TGT2/$tdir 4
 
     fini_changelog
     cleanup_src_tgt
@@ -442,8 +448,8 @@ test_5a() {
     wait
     $LRSYNC -l $LREPL_LOG
 
-    check_diff $DIR/$tdir $TGT/$tdir   
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 5a
+    check_diff $DIR/$tdir $TGT2/$tdir 5a
 
     fini_changelog
     cleanup_src_tgt
@@ -470,8 +476,8 @@ test_5b() {
     wait
     $LRSYNC -l $LREPL_LOG
 
-    check_diff $DIR/$tdir $TGT/$tdir   
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 5b
+    check_diff $DIR/$tdir $TGT2/$tdir 5b
 
     fini_changelog
     cleanup_src_tgt
@@ -495,8 +501,8 @@ test_6() {
 
     # Replicate the changes to $TGT
     $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
-    check_diff $DIR/$tdir $TGT/$tdir
-    check_diff $DIR/$tdir $TGT2/$tdir
+    check_diff $DIR/$tdir $TGT/$tdir 6
+    check_diff $DIR/$tdir $TGT2/$tdir 6
 
     local count1=$(ls -l $TGT/$tdir/link0 | sed -r 's/ +/ /g' | cut -f 2 -d ' ')
     local count2=$(ls -l $TGT/$tdir/link0 | sed -r 's/ +/ /g' | cut -f 2 -d ' ')
@@ -526,7 +532,7 @@ test_7() {
     # replicate the replication steps.  It seems ok :)
 
     $LRSYNC -s $DIR -t $DIR/tgt -m $MDT0 -u $CL_USER -l $LREPL_LOG
-    check_diff ${DIR}/$tdir $DIR/tgt/$tdir
+    check_diff ${DIR}/$tdir $DIR/tgt/$tdir 7
 
     local i=0
     while [ $i -lt $NUMFILES ];
@@ -564,7 +570,7 @@ test_8() {
 
     $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG
 
-    check_diff ${DIR}/$tdir $TGT/$tdir
+    check_diff ${DIR}/$tdir $TGT/$tdir 8
 
     fini_changelog
     cleanup_src_tgt
@@ -581,13 +587,13 @@ test_9() {
 
     $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG
 
-    check_diff ${DIR}/$tdir $TGT/$tdir
+    check_diff ${DIR}/$tdir $TGT/$tdir 9
 
     rm -rf $DIR/$tdir/foo
 
     $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG
 
-    check_diff ${DIR}/$tdir $TGT/$tdir
+    check_diff ${DIR}/$tdir $TGT/$tdir 9
 
     fini_changelog
     cleanup_src_tgt