Whamcloud - gitweb
b091763421f1217c925f2bd02ccf2c65efcc0078
[fs/lustre-release.git] / lustre / tests / lustre-rsync-test.sh
1 #!/bin/bash
2 # -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
3 # vim:shiftwidth=4:softtabstop=4:tabstop=4:
4 #
5 # Run select tests by setting ONLY, or as arguments to the script.
6 # Skip specific tests by setting EXCEPT.
7 #
8 # Run test by setting NOSETUP=true when ltest has setup env for us
9 set -e
10
11 SRCDIR=`dirname $0`
12 export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
13
14 ONLY=${ONLY:-"$*"}
15 ALWAYS_EXCEPT="$LRSYNC_EXCEPT"
16 # bug number for skipped test:
17 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
18
19 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
20
21 [ "$ALWAYS_EXCEPT$EXCEPT" ] &&
22         echo "Skipping tests: `echo $ALWAYS_EXCEPT $EXCEPT`"
23
24 KILL=/bin/kill
25
26 TMP=${TMP:-/tmp}
27 LREPL_LOG=$TMP/lustre_rsync.log
28 ORIG_PWD=${PWD}
29
30 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
31 . $LUSTRE/tests/test-framework.sh
32 init_test_env $@
33 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
34 init_logging
35
36 check_and_setup_lustre
37
38 DIR=${DIR:-$MOUNT}
39 assert_DIR
40
41
42 build_test_filter
43
44 export LRSYNC=${LRSYNC:-"$LUSTRE/utils/lustre_rsync"}
45 [ ! -f "$LRSYNC" ] && export LRSYNC=$(which lustre_rsync)
46 export LRSYNC="$LRSYNC -v -c no -d 2"
47
48 # control the time of tests
49 DBENCH_TIME=${DBENCH_TIME:-60}  # No of seconds to run dbench
50 TGT=$TMP/target
51 TGT2=$TMP/target2
52 MDT0=$($LCTL get_param -n mdc.*.mds_server_uuid |
53         awk '{ gsub(/_UUID/,""); print $1 }' | head -n1)
54
55 init_changelog() {
56     CL_USER=$(do_facet $SINGLEMDS lctl --device $MDT0 changelog_register -n)
57     echo $MDT0: Registered changelog user $CL_USER
58     CL_USERS=$(( $(do_facet $SINGLEMDS lctl get_param -n \
59         mdd.$MDT0.changelog_users | wc -l) - 2 ))
60     [ $CL_USERS -ne 1 ] && \
61         echo "Other changelog users present ($CL_USERS)"
62 }
63
64 init_src() {
65     rm -rf $TGT/$tdir $TGT/d*.lustre_rsync-test 2> /dev/null
66     rm -rf $TGT2/$tdir $TGT2/d*.lustre_rsync-test 2> /dev/null
67     rm -rf ${DIR}/$tdir $DIR/d*.lustre_rsync-test ${DIR}/tgt 2> /dev/null
68     rm -f $LREPL_LOG
69     mkdir -p ${DIR}/$tdir
70     mkdir -p ${TGT}/$tdir
71     mkdir -p ${TGT2}/$tdir
72     if [ $? -ne 0 ]; then
73         error "Failed to create target: " $TGT
74     fi
75 }
76
77 cleanup_src_tgt() {
78     rm -rf $TGT/$tdir
79     rm -rf $DIR/$tdir
80     rm -rf $DIR/tgt
81 }
82
83 fini_changelog() {
84     $LFS changelog_clear $MDT0 $CL_USER 0
85     do_facet $SINGLEMDS lctl --device $MDT0 changelog_deregister $CL_USER
86 }
87
88 # Check whether the filesystem supports xattr or not.
89 # Return value:
90 # "large" - large xattr is supported
91 # "small" - large xattr is unsupported but small xattr is supported
92 # "no"    - xattr is unsupported
93 check_xattr() {
94     local tgt=$1
95     local xattr="no"
96
97     touch $tgt
98
99     local val="$(generate_string $(max_xattr_size))"
100     if large_xattr_enabled &&
101        setfattr -n user.foo -v $val $tgt 2>/dev/null; then
102             xattr="large"
103     else
104         setfattr -n user.foo -v bar $tgt 2>/dev/null && xattr="small"
105     fi
106
107     rm -f $tgt
108     echo $xattr
109 }
110
111 check_diff() {
112         local changelog_file=$(generate_logname "changelog")
113
114         if [ -e $1 -o -e $2 ]; then
115                 diff -rq -x "dev1" $1 $2
116                 local RC=$?
117                 if [ $RC -ne 0 ]; then
118                         $LFS changelog $MDT0 > $changelog_file
119                         error "Failure in replication; differences found."
120                 fi
121         fi
122 }
123
124 # Test 1 - test basic operations
125 test_1() {
126     init_src
127     init_changelog
128     local xattr=$(check_xattr $TGT/foo)
129
130     # Directory create
131     mkdir $DIR/$tdir/d1
132     mkdir $DIR/$tdir/d2
133
134     # File create
135     touch $DIR/$tdir/file1
136     cp /etc/hosts  $DIR/$tdir/d1/
137     touch  $DIR/$tdir/d1/"space in filename"
138     touch  $DIR/$tdir/d1/file2
139
140     # File rename
141     mv $DIR/$tdir/d1/file2 $DIR/$tdir/d2/file3
142
143     # File and directory delete
144     touch $DIR/$tdir/d1/file4
145     mkdir $DIR/$tdir/d1/del
146     touch  $DIR/$tdir/d1/del/del1
147     touch  $DIR/$tdir/d1/del/del2
148     rm -rf $DIR/$tdir/d1/del
149     rm $DIR/$tdir/d1/file4
150
151     #hard and soft links
152     cat /etc/hosts > $DIR/$tdir/d1/link1
153     ln  $DIR/$tdir/d1/link1  $DIR/$tdir/d1/link2
154     ln -s $DIR/$tdir/d1/link1  $DIR/$tdir/d1/link3
155
156     # Device files
157     #mknod $DIR/$tdir/dev1 b 8 1
158
159         # Replicate
160         local LRSYNC_LOG=$(generate_logname "lrsync_log")
161         echo "Replication #1"
162         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
163                 -D $LRSYNC_LOG
164
165     # Set attributes
166     chmod 000 $DIR/$tdir/d2/file3
167     chown nobody:nobody $DIR/$tdir/d2/file3
168
169     # Set xattrs
170     if [[ "$xattr" != "no" ]]; then
171         local value
172         touch $DIR/$tdir/file5
173         [[ "$xattr" = "large" ]] &&
174             value="$(generate_string $(max_xattr_size))" || value="bar"
175         setfattr -n user.foo -v $value $DIR/$tdir/file5
176     fi
177
178         echo "Replication #2"
179         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
180
181     if [[ "$xattr" != "no" ]]; then
182         local xval1=$(get_xattr_value user.foo $TGT/$tdir/file5)
183         local xval2=$(get_xattr_value user.foo $TGT2/$tdir/file5)
184     fi
185
186     RC=0
187
188     # fid2path and path2fid aren't implemented for block devices
189     #if [[ ! -b $TGT/$tdir/dev1 ]] || [[ ! -b $TGT2/$tdir/dev1 ]]; then
190     #   ls -l $DIR/$tdir/dev1 $TGT/$tdir/dev1 $TGT2/$tdir/dev1
191     #   error "Error replicating block devices"
192     #   RC=1
193
194     if [[ "$xattr" != "no" ]] &&
195        [[ "$xval1" != "$value" || "$xval2" != "$value" ]]; then
196         error "Error in replicating xattrs."
197         RC=1
198     fi
199
200         # Use diff to compare the source and the destination
201         check_diff $DIR/$tdir $TGT/$tdir
202         check_diff $DIR/$tdir $TGT2/$tdir
203
204     fini_changelog
205     cleanup_src_tgt
206     return $RC
207 }
208 run_test 1 "Simple Replication"
209
210 # Test 1a - test create/delete operations in ROOT directory
211 test_1a() { # LU-5005
212         rm -rf $TGT/root-* 2> /dev/null
213         rm -rf $DIR/root-* 2> /dev/null
214         init_changelog
215
216         # Directory create
217         mkdir $DIR/root-dir
218
219         # File create
220         touch $DIR/root-file
221         touch $DIR/root-file2
222
223         # File rename
224         mv $DIR/root-file2 $DIR/root-file3
225
226         # File and directory delete
227         touch $DIR/root-file4
228         mkdir $DIR/root-dir1
229         rm $DIR/root-file4
230         rm -rf $DIR/root-dir1
231
232         # Replicate
233         local LRSYNC_LOG=$(generate_logname "lrsync_log")
234         echo "Replication"
235         $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG \
236                 -D $LRSYNC_LOG
237
238         # Verify
239         stat $TGT/root-dir || error "Dir create not replicated"
240         stat $TGT/root-file || error "File create not replicated"
241         stat $TGT/root-file2 && error "Rename not replicated (src)"
242         stat $TGT/root-file3 || error "Rename not replicated (tgt)"
243         stat $TGT/root-dir1 && error "Dir delete not replicated"
244         stat $TGT/root-file4 && error "File delete not replicated"
245
246         fini_changelog
247         rm -fr $TGT/root-*
248         rm -fr $DIR/root-*
249         return 0
250 }
251 run_test 1a "Replicate create/delete operations in ROOT directory"
252
253 # Test 2a - Replicate files created by dbench
254 test_2a() {
255         init_src
256         init_changelog
257
258         # Run dbench
259         sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME || error "dbench failed"
260
261         local LRSYNC_LOG=$(generate_logname "lrsync_log")
262         # Replicate the changes to $TGT
263         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
264                 -D $LRSYNC_LOG
265
266         # Use diff to compare the source and the destination
267         check_diff $DIR/$tdir $TGT/$tdir
268         check_diff $DIR/$tdir $TGT2/$tdir
269
270         fini_changelog
271         cleanup_src_tgt
272         return 0
273 }
274 run_test 2a "Replicate files created by dbench."
275
276
277 # Test 2b - Replicate files changed by dbench.
278 test_2b() {
279         local child_pid
280         init_src
281         init_changelog
282
283         # Run dbench
284         sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME &
285         # wait for dbench to start
286         wait_for_function 'child_pid=$(pgrep dbench)' 360
287         # let dbench run for a bit
288         sleep 10
289
290         echo PIDs: $child_pid
291         echo Stopping dbench
292         $KILL -SIGSTOP $child_pid
293
294         local LRSYNC_LOG=$(generate_logname "lrsync_log")
295         echo Starting replication
296         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
297                 -D $LRSYNC_LOG
298         check_diff $DIR/$tdir $TGT/$tdir
299
300     echo Resuming dbench
301     $KILL -SIGCONT $child_pid
302     sleep 10
303
304     echo Stopping dbench
305     $KILL -SIGSTOP $child_pid
306
307         echo Starting replication
308         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
309         check_diff $DIR/$tdir $TGT/$tdir
310
311     echo "Wait for dbench to finish"
312     $KILL -SIGCONT $child_pid
313     wait
314
315         # Replicate the changes to $TGT
316         echo Starting replication
317         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
318
319         check_diff $DIR/$tdir $TGT/$tdir
320         check_diff $DIR/$tdir $TGT2/$tdir
321
322     fini_changelog
323     cleanup_src_tgt
324     return 0
325 }
326 run_test 2b "Replicate files changed by dbench."
327
328 # Test 2c - Replicate files while dbench is running
329 test_2c() {
330         init_src
331         init_changelog
332
333         # Run dbench
334         sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME &
335
336         local LRSYNC_LOG=$(generate_logname "lrsync_log")
337         # Replicate the changes to $TGT
338         sleep 10 # give dbench a headstart
339         local quit=0
340         while [ $quit -le 1 ];
341         do
342                 echo "Running lustre_rsync"
343                 $LRSYNC -s $DIR -t $TGT -t $TGT2 -m ${mds1_svc} -u $CL_USER \
344                         -l $LREPL_LOG -D $LRSYNC_LOG
345                 sleep 5
346                 pgrep dbench
347                 if [ $? -ne 0 ]; then
348                         quit=$(expr $quit + 1)
349                 fi
350         done
351
352         # Use diff to compare the source and the destination
353         check_diff $DIR/$tdir $TGT/$tdir
354         check_diff $DIR/$tdir $TGT2/$tdir
355
356         fini_changelog
357         cleanup_src_tgt
358         return 0
359 }
360 run_test 2c "Replicate files while dbench is running."
361
362 # Test 3a - Replicate files created by createmany
363 test_3a() {
364         init_src
365         init_changelog
366
367         local numfiles=1000
368         createmany -o $DIR/$tdir/$tfile $numfiles || error "createmany failed"
369
370         local LRSYNC_LOG=$(generate_logname "lrsync_log")
371         # Replicate the changes to $TGT
372         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
373                 -D $LRSYNC_LOG
374         check_diff $DIR/$tdir $TGT/$tdir
375         check_diff $DIR/$tdir $TGT2/$tdir
376
377         fini_changelog
378         cleanup_src_tgt
379         return 0
380 }
381 run_test 3a "Replicate files created by createmany"
382
383
384 # Test 3b - Replicate files created by writemany
385 test_3b() {
386         init_src
387         init_changelog
388
389         local time=60
390         local threads=5
391         writemany -q -a $DIR/$tdir/$tfile $time $threads ||
392                 error "writemany failed"
393
394         local LRSYNC_LOG=$(generate_logname "lrsync_log")
395         # Replicate the changes to $TGT
396         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
397                 -D $LRSYNC_LOG
398
399         check_diff $DIR/$tdir $TGT/$tdir
400         check_diff $DIR/$tdir $TGT2/$tdir
401
402         fini_changelog
403         cleanup_src_tgt
404         return 0
405 }
406 run_test 3b "Replicate files created by writemany"
407
408 # Test 3c - Replicate files created by createmany/unlinkmany
409 test_3c() {
410         init_src
411         init_changelog
412
413         local numfiles=1000
414         createmany -o $DIR/$tdir/$tfile $numfiles || error "createmany failed"
415         unlinkmany $DIR/$tdir/$tfile $numfiles || error "unlinkmany failed"
416
417         local LRSYNC_LOG=$(generate_logname "lrsync_log")
418         # Replicate the changes to $TGT
419         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0  -u $CL_USER -l $LREPL_LOG \
420                 -D $LRSYNC_LOG
421         check_diff $DIR/$tdir $TGT/$tdir
422         check_diff $DIR/$tdir $TGT2/$tdir
423
424         fini_changelog
425         cleanup_src_tgt
426         return 0
427 }
428 run_test 3c "Replicate files created by createmany/unlinkmany"
429
430 # Test 4 - Replicate files created by iozone
431 test_4() {
432     which iozone > /dev/null 2>&1
433     if [ $? -ne 0 ]; then
434         skip "iozone not found. Skipping test"
435         return
436     fi
437
438     init_src
439     init_changelog
440
441     END_RUN_FILE=${DIR}/$tdir/run LOAD_PID_FILE=${DIR}/$tdir/pid \
442         MOUNT=${DIR}/$tdir run_iozone.sh &
443     sleep 30
444     child_pid=$(pgrep iozone)
445     $KILL -SIGSTOP $child_pid
446
447         local LRSYNC_LOG=$(generate_logname "lrsync_log")
448         # Replicate the changes to $TGT
449         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0  -u $CL_USER -l $LREPL_LOG \
450                 -D $LRSYNC_LOG
451         check_diff $DIR/$tdir $TGT/$tdir
452         check_diff $DIR/$tdir $TGT2/$tdir
453
454     $KILL -SIGCONT $child_pid
455     sleep 60
456     $KILL -SIGKILL $(pgrep run_iozone.sh)
457     $KILL -SIGKILL $(pgrep iozone)
458
459     # After killing 'run_iozone.sh', process 'iozone' becomes the
460     # child of PID 1. Hence 'wait' does not wait for it. Killing
461     # iozone first, means more iozone processes are spawned off which
462     # is not desirable. So, after sending a sigkill, the test goes
463     # into a wait loop for iozone to cleanup and exit.
464     wait
465     while [ "$(pgrep "iozone")" != "" ];
466     do
467       ps -ef | grep iozone | grep -v grep
468       sleep 1;
469     done
470
471         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
472         check_diff $DIR/$tdir $TGT/$tdir
473         check_diff $DIR/$tdir $TGT2/$tdir
474
475     fini_changelog
476     cleanup_src_tgt
477     return 0
478 }
479 run_test 4 "Replicate files created by iozone"
480
481 # Test 5a - Stop / start lustre_rsync
482 test_5a() {
483         init_src
484         init_changelog
485
486         NUMTEST=2000
487         createmany -o $DIR/$tdir/$tfile $NUMTEST
488
489         # Replicate the changes to $TGT
490         local LRSYNC_LOG=$(generate_logname "lrsync_log")
491         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
492                 -D $LRSYNC_LOG &
493         local child_pid=$!
494         sleep 30
495         $KILL -SIGHUP $child_pid
496         wait
497         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
498
499         check_diff $DIR/$tdir $TGT/$tdir
500         check_diff $DIR/$tdir $TGT2/$tdir
501
502         fini_changelog
503         cleanup_src_tgt
504         return 0
505 }
506 run_test 5a "Stop / start lustre_rsync"
507
508 # Test 5b - Kill / restart lustre_rsync
509 test_5b() {
510         init_src
511         init_changelog
512
513         NUMTEST=2000
514         createmany -o $DIR/$tdir/$tfile $NUMTEST
515
516         # Replicate the changes to $TGT
517         local LRSYNC_LOG=$(generate_logname "lrsync_log")
518         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
519                 -D $LRSYNC_LOG &
520         local child_pid=$!
521         sleep 30
522         $KILL -SIGKILL $child_pid
523         wait
524         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
525
526         check_diff $DIR/$tdir $TGT/$tdir
527         check_diff $DIR/$tdir $TGT2/$tdir
528
529         fini_changelog
530         cleanup_src_tgt
531         return 0
532 }
533 run_test 5b "Kill / restart lustre_rsync"
534
535 # Test 6 - lustre_rsync large no of hard links
536 test_6() {
537     init_src
538     init_changelog
539
540     local NUMLINKS=128
541     touch $DIR/$tdir/link0
542     local i=1
543     while [ $i -lt $NUMLINKS ];
544     do
545       ln $DIR/$tdir/link0  $DIR/$tdir/link${i}
546       i=$(expr $i + 1)
547     done
548
549         local LRSYNC_LOG=$(generate_logname "lrsync_log")
550         # Replicate the changes to $TGT
551         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
552                 -D $LRSYNC_LOG
553         check_diff $DIR/$tdir $TGT/$tdir
554         check_diff $DIR/$tdir $TGT2/$tdir
555
556     local count1=$(ls -l $TGT/$tdir/link0 | sed -r 's/ +/ /g' | cut -f 2 -d ' ')
557     local count2=$(ls -l $TGT/$tdir/link0 | sed -r 's/ +/ /g' | cut -f 2 -d ' ')
558     if [[ $count1 -ne $NUMLINKS ]] ||  [[ $count2 -ne $NUMLINKS ]]; then
559         ls -l $TGT/$tdir/link0 $TGT2/$tdir/link0
560         error "Incorrect no of hard links found $count1, $count2"
561     fi
562     fini_changelog
563     cleanup_src_tgt
564     return 0
565 }
566 run_test 6 "lustre_rsync large no of hard links"
567
568 # Test 7 - lustre_rsync stripesize
569 test_7() {
570     init_src
571     mkdir -p ${DIR}/tgt/$tdir
572     init_changelog
573
574     local NUMFILES=100
575     lfs setstripe -c $OSTCOUNT $DIR/$tdir
576     createmany -o $DIR/$tdir/$tfile $NUMFILES
577
578         # To simulate replication to another lustre filesystem, replicate
579         # the changes to $DIR/tgt. We can't turn off the changelogs
580         # while we are registered, so lustre_rsync better not try to
581         # replicate the replication steps.  It seems ok :)
582
583         local LRSYNC_LOG=$(generate_logname "lrsync_log")
584         $LRSYNC -s $DIR -t $DIR/tgt -m $MDT0 -u $CL_USER -l $LREPL_LOG \
585                 -D $LRSYNC_LOG
586         check_diff ${DIR}/$tdir $DIR/tgt/$tdir
587
588         local i=0
589         while [ $i -lt $NUMFILES ];
590         do
591                 local count=$(lfs getstripe $DIR/tgt/$tdir/${tfile}$i | \
592                               awk '/stripe_count/ {print $2}')
593                 if [ $count -ne $OSTCOUNT ]; then
594                         error "Stripe size not replicated"
595                 fi
596                 i=$(expr $i + 1)
597         done
598         fini_changelog
599         cleanup_src_tgt
600         return 0
601 }
602 run_test 7 "lustre_rsync stripesize"
603
604 # Test 8 - Replicate multiple file/directory moves
605 test_8() {
606     init_src
607     init_changelog
608
609     for i in 1 2 3 4 5 6 7 8 9; do
610         mkdir $DIR/$tdir/d$i
611             for j in 1 2 3 4 5 6 7 8 9; do
612                 mkdir $DIR/$tdir/d$i/d$i$j
613                 createmany -o $DIR/$tdir/d$i/d$i$j/a 10 \
614                     > /dev/null
615                 mv $DIR/$tdir/d$i/d$i$j $DIR/$tdir/d$i/d0$i$j
616                 createmany -o $DIR/$tdir/d$i/d0$i$j/b 10 \
617                     > /dev/null
618                 mv $DIR/$tdir/d$i/d0$i$j/a0 $DIR/$tdir/d$i/d0$i$j/c0
619             done
620             mv $DIR/$tdir/d$i $DIR/$tdir/d0$i
621     done
622
623         local LRSYNC_LOG=$(generate_logname "lrsync_log")
624         $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG \
625                 -D $LRSYNC_LOG
626
627         check_diff ${DIR}/$tdir $TGT/$tdir
628
629     fini_changelog
630     cleanup_src_tgt
631     return 0
632 }
633 run_test 8 "Replicate multiple file/directory moves"
634
635 test_9() {
636     init_src
637     init_changelog
638
639     mkdir $DIR/$tdir/foo
640     touch $DIR/$tdir/foo/a1
641
642         local LRSYNC_LOG=$(generate_logname "lrsync_log")
643         $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG \
644                 -D $LRSYNC_LOG
645
646         check_diff ${DIR}/$tdir $TGT/$tdir
647
648         rm -rf $DIR/$tdir/foo
649
650         $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG \
651                 -D $LRSYNC_LOG
652
653         check_diff ${DIR}/$tdir $TGT/$tdir
654
655     fini_changelog
656     cleanup_src_tgt
657     return 0
658 }
659 run_test 9 "Replicate recursive directory removal"
660
661 cd $ORIG_PWD
662 complete $SECONDS
663 check_and_cleanup_lustre
664 exit_status