X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=500d660e7d143ad4713e3fddd59b71c92bd031c1;hp=18ad4eb7ce9699819389c6d632bcaa5842f12bcf;hb=c038909fbc2b3b14763dd731e9c877d11d338f04;hpb=2dae2b8ffb8f3238f240e0e59987e93ce3e31d86 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 18ad4eb..500d660 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -15468,6 +15468,56 @@ test_230j() { } run_test 230j "DoM file data not changed after dir migration" +test_230k() { + [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" + [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.56) ] && + skip "Need MDS version at least 2.11.56" + + local total=20 + local files_on_starting_mdt=0 + + $LFS mkdir -i -1 -c 2 $DIR/$tdir || error "mkdir failed" + $LFS getdirstripe $DIR/$tdir + for i in $(seq $total); do + echo $((i*i - i)) > $DIR/$tdir/$tfile.$i || error "write failed" + [[ $($LFS getstripe -m $DIR/$tdir/$tfile.$i) -eq 0 ]] && + files_on_starting_mdt=$((files_on_starting_mdt + 1)) + done + + echo "$files_on_starting_mdt files on MDT0" + + $LFS migrate -m 1,3 $DIR/$tdir || error "migrate -m 1,3 failed" + $LFS getdirstripe $DIR/$tdir + + files_on_starting_mdt=0 + for i in $(seq $total); do + $(echo $((i*i - i)) | cmp $DIR/$tdir/$tfile.$i -) || + error "file $tfile.$i mismatch after migration" + [[ $($LFS getstripe -m $DIR/$tdir/$tfile.$i) -eq 1 ]] && + files_on_starting_mdt=$((files_on_starting_mdt + 1)) + done + + echo "$files_on_starting_mdt files on MDT1 after migration" + [[ $files_on_starting_mdt -eq $total ]] && error "all files on MDT1" + + $LFS migrate -m 0 -c 2 $DIR/$tdir || error "migrate -m 0 -c 2 failed" + $LFS getdirstripe $DIR/$tdir + + files_on_starting_mdt=0 + for i in $(seq $total); do + $(echo $((i*i - i)) | cmp $DIR/$tdir/$tfile.$i -) || + error "file $tfile.$i mismatch after 2nd migration" + [[ $($LFS getstripe -m $DIR/$tdir/$tfile.$i) -eq 0 ]] && + files_on_starting_mdt=$((files_on_starting_mdt + 1)) + done + + echo "$files_on_starting_mdt files on MDT0 after 2nd migration" + [[ $files_on_starting_mdt -eq $total ]] && error "all files on MDT0" + + true +} +run_test 230k "file data not changed after dir migration" + test_231a() { # For simplicity this test assumes that max_pages_per_rpc @@ -19944,6 +19994,51 @@ test_808() { } run_test 808 "Check trusted.som xattr not logged in Changelogs" +check_som_nodata() +{ + $LFS getsom $1 + [[ $? -eq 61 ]] || error "DoM-only file $1 has SOM xattr" +} + +test_809() { + [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.56) ] && + skip "Need MDS version at least 2.11.56" && return + + $LFS setstripe -E 1M -L mdt $DIR/$tfile || + error "failed to create DoM-only file $DIR/$tfile" + touch $DIR/$tfile || error "touch $tfile failed" + check_som_nodata $DIR/$tfile + + dd if=/dev/zero of=$DIR/$tfile bs=2048 count=1 || + error "write $tfile failed" + check_som_nodata $DIR/$tfile + + $TRUNCATE $DIR/$tfile 1234 + check_som_nodata $DIR/$tfile + + $TRUNCATE $DIR/$tfile 4097 + check_som_nodata $DIR/$file +} +run_test 809 "Verify no SOM xattr store for DoM-only files" + +test_810() { + local ORIG + local CSUM + + # t10 seem to dislike partial pages + lctl set_param osc.*.checksum_type=adler + lctl set_param fail_loc=0x411 + dd if=/dev/urandom of=$DIR/$tfile bs=10240 count=2 + ORIG=$(md5sum $DIR/$tfile) + lctl set_param ldlm.namespaces.*osc*.lru_size=clear + CSUM=$(md5sum $DIR/$tfile) + set_checksum_type adler + if [ "$ORIG" != "$CSUM" ]; then + error "$ORIG != $CSUM" + fi +} +run_test 810 "partial page writes on ZFS (LU-11663)" + # # tests that do cleanup/setup should be run at the end #