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