X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Flustre-rsync-test.sh;h=b091763421f1217c925f2bd02ccf2c65efcc0078;hb=245c6d39387bf85b18ea8c4db161f693739fca26;hp=416ced331ca89423588467c014aa65335605b620;hpb=0dd6278b8a8e4a03935c29e45f82d6184cd653eb;p=fs%2Flustre-release.git diff --git a/lustre/tests/lustre-rsync-test.sh b/lustre/tests/lustre-rsync-test.sh index 416ced3..b091763 100644 --- a/lustre/tests/lustre-rsync-test.sh +++ b/lustre/tests/lustre-rsync-test.sh @@ -49,8 +49,8 @@ export LRSYNC="$LRSYNC -v -c no -d 2" DBENCH_TIME=${DBENCH_TIME:-60} # No of seconds to run dbench TGT=$TMP/target TGT2=$TMP/target2 -MDT0=$($LCTL get_param -n mdc.*.mds_server_uuid | \ - awk '{gsub(/_UUID/,""); print $1}' | head -1) +MDT0=$($LCTL get_param -n mdc.*.mds_server_uuid | + awk '{ gsub(/_UUID/,""); print $1 }' | head -n1) init_changelog() { CL_USER=$(do_facet $SINGLEMDS lctl --device $MDT0 changelog_register -n) @@ -207,6 +207,49 @@ test_1() { } run_test 1 "Simple Replication" +# Test 1a - test create/delete operations in ROOT directory +test_1a() { # LU-5005 + rm -rf $TGT/root-* 2> /dev/null + rm -rf $DIR/root-* 2> /dev/null + init_changelog + + # Directory create + mkdir $DIR/root-dir + + # File create + touch $DIR/root-file + touch $DIR/root-file2 + + # File rename + mv $DIR/root-file2 $DIR/root-file3 + + # File and directory delete + touch $DIR/root-file4 + mkdir $DIR/root-dir1 + rm $DIR/root-file4 + rm -rf $DIR/root-dir1 + + # Replicate + local LRSYNC_LOG=$(generate_logname "lrsync_log") + echo "Replication" + $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG \ + -D $LRSYNC_LOG + + # Verify + stat $TGT/root-dir || error "Dir create not replicated" + stat $TGT/root-file || error "File create not replicated" + stat $TGT/root-file2 && error "Rename not replicated (src)" + stat $TGT/root-file3 || error "Rename not replicated (tgt)" + stat $TGT/root-dir1 && error "Dir delete not replicated" + stat $TGT/root-file4 && error "File delete not replicated" + + fini_changelog + rm -fr $TGT/root-* + rm -fr $DIR/root-* + return 0 +} +run_test 1a "Replicate create/delete operations in ROOT directory" + # Test 2a - Replicate files created by dbench test_2a() { init_src @@ -233,14 +276,17 @@ run_test 2a "Replicate files created by dbench." # Test 2b - Replicate files changed by dbench. test_2b() { + local child_pid init_src init_changelog # Run dbench sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME & - sleep 20 + # wait for dbench to start + wait_for_function 'child_pid=$(pgrep dbench)' 360 + # let dbench run for a bit + sleep 10 - local child_pid=$(pgrep dbench) echo PIDs: $child_pid echo Stopping dbench $KILL -SIGSTOP $child_pid