- init_src
- mkdir -p ${DIR}/tgt/$tdir
- init_changelog
-
- local NUMFILES=100
- lfs setstripe -c $OSTCOUNT $DIR/$tdir
- createmany -o $DIR/$tdir/$tfile $NUMFILES
-
- # To simulate replication to another lustre filesystem, replicate
- # the changes to $DIR/tgt. We can't turn off the changelogs
- # while we are registered, so lustre_rsync better not try to
- # 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
-
- local i=0
- while [ $i -lt $NUMFILES ];
- do
- local count=$(lfs getstripe $DIR/tgt/$tdir/${tfile}$i | awk '/stripe_count/ {print $2}')
- if [ $count -ne $OSTCOUNT ]; then
- error "Stripe size not replicated"
- fi
- i=$(expr $i + 1)
- done
- fini_changelog
- cleanup_src_tgt
- return 0
+ local numfiles=100
+
+ init_src
+ mkdir -p ${DIR}/tgt/$tdir
+ init_changelog
+
+ $LFS setstripe -c $OSTCOUNT $DIR/$tdir ||
+ error "$LFS setstripe failed"
+ createmany -o $DIR/$tdir/$tfile $numfiles
+
+ # To simulate replication to another lustre filesystem, replicate
+ # the changes to $DIR/tgt. We can't turn off the changelogs
+ # while we are registered, so lustre_rsync better not try to
+ # replicate the replication steps. It seems ok :)
+
+ local LRSYNC_LOG=$(generate_logname "lrsync_log")
+ $LRSYNC -s $DIR -t $DIR/tgt -m $MDT0 -u $CL_USER -l $LREPL_LOG \
+ -D $LRSYNC_LOG
+ check_diff ${DIR}/$tdir $DIR/tgt/$tdir
+
+ local i=0
+ while [ $i -lt $numfiles ];
+ do
+ local count=$($LFS getstripe $DIR/tgt/$tdir/${tfile}$i |
+ awk '/stripe_count/ {print $2}')
+ if [ $count -ne $OSTCOUNT ]; then
+ error "Stripe size not replicated"
+ fi
+ i=$(expr $i + 1)
+ done
+ fini_changelog
+ cleanup_src_tgt
+ return 0