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