Whamcloud - gitweb
LU-7469 test: add missing init to lustre-rsync-test:test_1a
[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_src
215         init_changelog
216
217         # Directory create
218         mkdir $DIR/root-dir
219
220         # File create
221         touch $DIR/root-file
222         touch $DIR/root-file2
223
224         # File rename
225         mv $DIR/root-file2 $DIR/root-file3
226
227         # File and directory delete
228         touch $DIR/root-file4
229         mkdir $DIR/root-dir1
230         rm $DIR/root-file4
231         rm -rf $DIR/root-dir1
232
233         # Replicate
234         local LRSYNC_LOG=$(generate_logname "lrsync_log")
235         echo "Replication"
236         $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG \
237                 -D $LRSYNC_LOG
238
239         # Verify
240         stat $TGT/root-dir || error "Dir create not replicated"
241         stat $TGT/root-file || error "File create not replicated"
242         stat $TGT/root-file2 && error "Rename not replicated (src)"
243         stat $TGT/root-file3 || error "Rename not replicated (tgt)"
244         stat $TGT/root-dir1 && error "Dir delete not replicated"
245         stat $TGT/root-file4 && error "File delete not replicated"
246
247         cleanup_src_tgt
248         fini_changelog
249         rm -fr $TGT/root-*
250         rm -fr $DIR/root-*
251         return 0
252 }
253 run_test 1a "Replicate create/delete operations in ROOT directory"
254
255 # Test 2a - Replicate files created by dbench
256 test_2a() {
257         init_src
258         init_changelog
259
260         # Run dbench
261         sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME || error "dbench failed"
262
263         local LRSYNC_LOG=$(generate_logname "lrsync_log")
264         # Replicate the changes to $TGT
265         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
266                 -D $LRSYNC_LOG
267
268         # Use diff to compare the source and the destination
269         check_diff $DIR/$tdir $TGT/$tdir
270         check_diff $DIR/$tdir $TGT2/$tdir
271
272         fini_changelog
273         cleanup_src_tgt
274         return 0
275 }
276 run_test 2a "Replicate files created by dbench."
277
278
279 # Test 2b - Replicate files changed by dbench.
280 test_2b() {
281         local child_pid
282         init_src
283         init_changelog
284
285         # Run dbench
286         sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME &
287         # wait for dbench to start
288         wait_for_function 'child_pid=$(pgrep dbench)' 360
289         # let dbench run for a bit
290         sleep 10
291
292         echo PIDs: $child_pid
293         echo Stopping dbench
294         $KILL -SIGSTOP $child_pid
295
296         local LRSYNC_LOG=$(generate_logname "lrsync_log")
297         echo Starting replication
298         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
299                 -D $LRSYNC_LOG
300         check_diff $DIR/$tdir $TGT/$tdir
301
302     echo Resuming dbench
303     $KILL -SIGCONT $child_pid
304     sleep 10
305
306     echo Stopping dbench
307     $KILL -SIGSTOP $child_pid
308
309         echo Starting replication
310         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
311         check_diff $DIR/$tdir $TGT/$tdir
312
313     echo "Wait for dbench to finish"
314     $KILL -SIGCONT $child_pid
315     wait
316
317         # Replicate the changes to $TGT
318         echo Starting replication
319         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
320
321         check_diff $DIR/$tdir $TGT/$tdir
322         check_diff $DIR/$tdir $TGT2/$tdir
323
324     fini_changelog
325     cleanup_src_tgt
326     return 0
327 }
328 run_test 2b "Replicate files changed by dbench."
329
330 # Test 2c - Replicate files while dbench is running
331 test_2c() {
332         init_src
333         init_changelog
334
335         # Run dbench
336         sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME &
337
338         local LRSYNC_LOG=$(generate_logname "lrsync_log")
339         # Replicate the changes to $TGT
340         sleep 10 # give dbench a headstart
341         local quit=0
342         while [ $quit -le 1 ];
343         do
344                 echo "Running lustre_rsync"
345                 $LRSYNC -s $DIR -t $TGT -t $TGT2 -m ${mds1_svc} -u $CL_USER \
346                         -l $LREPL_LOG -D $LRSYNC_LOG
347                 sleep 5
348                 pgrep dbench
349                 if [ $? -ne 0 ]; then
350                         quit=$(expr $quit + 1)
351                 fi
352         done
353
354         # Use diff to compare the source and the destination
355         check_diff $DIR/$tdir $TGT/$tdir
356         check_diff $DIR/$tdir $TGT2/$tdir
357
358         fini_changelog
359         cleanup_src_tgt
360         return 0
361 }
362 run_test 2c "Replicate files while dbench is running."
363
364 # Test 3a - Replicate files created by createmany
365 test_3a() {
366         init_src
367         init_changelog
368
369         local numfiles=1000
370         createmany -o $DIR/$tdir/$tfile $numfiles || error "createmany failed"
371
372         local LRSYNC_LOG=$(generate_logname "lrsync_log")
373         # Replicate the changes to $TGT
374         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
375                 -D $LRSYNC_LOG
376         check_diff $DIR/$tdir $TGT/$tdir
377         check_diff $DIR/$tdir $TGT2/$tdir
378
379         fini_changelog
380         cleanup_src_tgt
381         return 0
382 }
383 run_test 3a "Replicate files created by createmany"
384
385
386 # Test 3b - Replicate files created by writemany
387 test_3b() {
388         init_src
389         init_changelog
390
391         local time=60
392         local threads=5
393         writemany -q -a $DIR/$tdir/$tfile $time $threads ||
394                 error "writemany failed"
395
396         local LRSYNC_LOG=$(generate_logname "lrsync_log")
397         # Replicate the changes to $TGT
398         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
399                 -D $LRSYNC_LOG
400
401         check_diff $DIR/$tdir $TGT/$tdir
402         check_diff $DIR/$tdir $TGT2/$tdir
403
404         fini_changelog
405         cleanup_src_tgt
406         return 0
407 }
408 run_test 3b "Replicate files created by writemany"
409
410 # Test 3c - Replicate files created by createmany/unlinkmany
411 test_3c() {
412         init_src
413         init_changelog
414
415         local numfiles=1000
416         createmany -o $DIR/$tdir/$tfile $numfiles || error "createmany failed"
417         unlinkmany $DIR/$tdir/$tfile $numfiles || error "unlinkmany failed"
418
419         local LRSYNC_LOG=$(generate_logname "lrsync_log")
420         # Replicate the changes to $TGT
421         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0  -u $CL_USER -l $LREPL_LOG \
422                 -D $LRSYNC_LOG
423         check_diff $DIR/$tdir $TGT/$tdir
424         check_diff $DIR/$tdir $TGT2/$tdir
425
426         fini_changelog
427         cleanup_src_tgt
428         return 0
429 }
430 run_test 3c "Replicate files created by createmany/unlinkmany"
431
432 # Test 4 - Replicate files created by iozone
433 test_4() {
434     which iozone > /dev/null 2>&1
435     if [ $? -ne 0 ]; then
436         skip "iozone not found. Skipping test"
437         return
438     fi
439
440     init_src
441     init_changelog
442
443     END_RUN_FILE=${DIR}/$tdir/run LOAD_PID_FILE=${DIR}/$tdir/pid \
444         MOUNT=${DIR}/$tdir run_iozone.sh &
445     sleep 30
446     child_pid=$(pgrep iozone)
447     $KILL -SIGSTOP $child_pid
448
449         local LRSYNC_LOG=$(generate_logname "lrsync_log")
450         # Replicate the changes to $TGT
451         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0  -u $CL_USER -l $LREPL_LOG \
452                 -D $LRSYNC_LOG
453         check_diff $DIR/$tdir $TGT/$tdir
454         check_diff $DIR/$tdir $TGT2/$tdir
455
456     $KILL -SIGCONT $child_pid
457     sleep 60
458     $KILL -SIGKILL $(pgrep run_iozone.sh)
459     $KILL -SIGKILL $(pgrep iozone)
460
461     # After killing 'run_iozone.sh', process 'iozone' becomes the
462     # child of PID 1. Hence 'wait' does not wait for it. Killing
463     # iozone first, means more iozone processes are spawned off which
464     # is not desirable. So, after sending a sigkill, the test goes
465     # into a wait loop for iozone to cleanup and exit.
466     wait
467     while [ "$(pgrep "iozone")" != "" ];
468     do
469       ps -ef | grep iozone | grep -v grep
470       sleep 1;
471     done
472
473         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
474         check_diff $DIR/$tdir $TGT/$tdir
475         check_diff $DIR/$tdir $TGT2/$tdir
476
477     fini_changelog
478     cleanup_src_tgt
479     return 0
480 }
481 run_test 4 "Replicate files created by iozone"
482
483 # Test 5a - Stop / start lustre_rsync
484 test_5a() {
485         init_src
486         init_changelog
487
488         NUMTEST=2000
489         createmany -o $DIR/$tdir/$tfile $NUMTEST
490
491         # Replicate the changes to $TGT
492         local LRSYNC_LOG=$(generate_logname "lrsync_log")
493         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
494                 -D $LRSYNC_LOG &
495         local child_pid=$!
496         sleep 30
497         $KILL -SIGHUP $child_pid
498         wait
499         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
500
501         check_diff $DIR/$tdir $TGT/$tdir
502         check_diff $DIR/$tdir $TGT2/$tdir
503
504         fini_changelog
505         cleanup_src_tgt
506         return 0
507 }
508 run_test 5a "Stop / start lustre_rsync"
509
510 # Test 5b - Kill / restart lustre_rsync
511 test_5b() {
512         init_src
513         init_changelog
514
515         NUMTEST=2000
516         createmany -o $DIR/$tdir/$tfile $NUMTEST
517
518         # Replicate the changes to $TGT
519         local LRSYNC_LOG=$(generate_logname "lrsync_log")
520         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
521                 -D $LRSYNC_LOG &
522         local child_pid=$!
523         sleep 30
524         $KILL -SIGKILL $child_pid
525         wait
526         $LRSYNC -l $LREPL_LOG -D $LRSYNC_LOG
527
528         check_diff $DIR/$tdir $TGT/$tdir
529         check_diff $DIR/$tdir $TGT2/$tdir
530
531         fini_changelog
532         cleanup_src_tgt
533         return 0
534 }
535 run_test 5b "Kill / restart lustre_rsync"
536
537 # Test 6 - lustre_rsync large no of hard links
538 test_6() {
539         init_src
540         init_changelog
541
542         local num_links=128
543         local i
544
545         touch $DIR/$tdir/link0
546         for ((i = 1; i < num_links - 1; i++)); do
547                 ln $DIR/$tdir/link0 $DIR/$tdir/link$i
548         done
549         # create an extra hard link of src name ending with dest name
550         ln $DIR/$tdir/link0 $DIR/$tdir/ink0
551
552         local LRSYNC_LOG=$(generate_logname "lrsync_log")
553         # Replicate the changes to $TGT
554         $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG \
555                 -D $LRSYNC_LOG
556         check_diff $DIR/$tdir $TGT/$tdir
557         check_diff $DIR/$tdir $TGT2/$tdir
558
559         local count1=$(stat --format=%h $TGT/$tdir/link0)
560         local count2=$(stat --format=%h $TGT2/$tdir/link0)
561         if ((count1 != num_links || count2 != num_links)); then
562                 ls -l $TGT/$tdir/link0 $TGT2/$tdir/link0
563                 error "Incorrect no of hard links found $count1, $count2"
564         fi
565
566         fini_changelog
567         cleanup_src_tgt
568         return 0
569 }
570 run_test 6 "lustre_rsync large no of hard links"
571
572 # Test 7 - lustre_rsync stripesize
573 test_7() {
574     init_src
575     mkdir -p ${DIR}/tgt/$tdir
576     init_changelog
577
578     local NUMFILES=100
579     lfs setstripe -c $OSTCOUNT $DIR/$tdir
580     createmany -o $DIR/$tdir/$tfile $NUMFILES
581
582         # To simulate replication to another lustre filesystem, replicate
583         # the changes to $DIR/tgt. We can't turn off the changelogs
584         # while we are registered, so lustre_rsync better not try to
585         # replicate the replication steps.  It seems ok :)
586
587         local LRSYNC_LOG=$(generate_logname "lrsync_log")
588         $LRSYNC -s $DIR -t $DIR/tgt -m $MDT0 -u $CL_USER -l $LREPL_LOG \
589                 -D $LRSYNC_LOG
590         check_diff ${DIR}/$tdir $DIR/tgt/$tdir
591
592         local i=0
593         while [ $i -lt $NUMFILES ];
594         do
595                 local count=$(lfs getstripe $DIR/tgt/$tdir/${tfile}$i | \
596                               awk '/stripe_count/ {print $2}')
597                 if [ $count -ne $OSTCOUNT ]; then
598                         error "Stripe size not replicated"
599                 fi
600                 i=$(expr $i + 1)
601         done
602         fini_changelog
603         cleanup_src_tgt
604         return 0
605 }
606 run_test 7 "lustre_rsync stripesize"
607
608 # Test 8 - Replicate multiple file/directory moves
609 test_8() {
610     init_src
611     init_changelog
612
613     for i in 1 2 3 4 5 6 7 8 9; do
614         mkdir $DIR/$tdir/d$i
615             for j in 1 2 3 4 5 6 7 8 9; do
616                 mkdir $DIR/$tdir/d$i/d$i$j
617                 createmany -o $DIR/$tdir/d$i/d$i$j/a 10 \
618                     > /dev/null
619                 mv $DIR/$tdir/d$i/d$i$j $DIR/$tdir/d$i/d0$i$j
620                 createmany -o $DIR/$tdir/d$i/d0$i$j/b 10 \
621                     > /dev/null
622                 mv $DIR/$tdir/d$i/d0$i$j/a0 $DIR/$tdir/d$i/d0$i$j/c0
623             done
624             mv $DIR/$tdir/d$i $DIR/$tdir/d0$i
625     done
626
627         local LRSYNC_LOG=$(generate_logname "lrsync_log")
628         $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG \
629                 -D $LRSYNC_LOG
630
631         check_diff ${DIR}/$tdir $TGT/$tdir
632
633     fini_changelog
634     cleanup_src_tgt
635     return 0
636 }
637 run_test 8 "Replicate multiple file/directory moves"
638
639 test_9() {
640     init_src
641     init_changelog
642
643     mkdir $DIR/$tdir/foo
644     touch $DIR/$tdir/foo/a1
645
646         local LRSYNC_LOG=$(generate_logname "lrsync_log")
647         $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG \
648                 -D $LRSYNC_LOG
649
650         check_diff ${DIR}/$tdir $TGT/$tdir
651
652         rm -rf $DIR/$tdir/foo
653
654         $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG \
655                 -D $LRSYNC_LOG
656
657         check_diff ${DIR}/$tdir $TGT/$tdir
658
659     fini_changelog
660     cleanup_src_tgt
661     return 0
662 }
663 run_test 9 "Replicate recursive directory removal"
664
665 cd $ORIG_PWD
666 complete $SECONDS
667 check_and_cleanup_lustre
668 exit_status