X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=01229b1b9bea5da504cd4a72c5e474b6850559c2;hp=7b7f51385a52b5591de116918afa22270fbb8300;hb=d633172a38519aba2585c2a1fdcdd821cb19010c;hpb=cda353e6efae5013a26aedbe49d8aa6fb8fe456e diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 7b7f513..01229b1 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -23789,6 +23789,34 @@ test_430b() { } run_test 430b "lseek: SEEK_DATA/SEEK_HOLE special cases" +test_430c() { + $LCTL get_param osc.*.import | grep -q 'connect_flags:.*seek' || + skip "OST does not support SEEK_HOLE" + + local file=$DIR/$tdir/$tfile + local start + + mkdir -p $DIR/$tdir + dd if=/dev/urandom of=$file bs=1k count=1 seek=5M + + # cp version 8.33+ prefers lseek over fiemap + if [[ $(cp --version | head -n1 | sed "s/[^0-9]//g") -ge 833 ]]; then + start=$SECONDS + time cp $file /dev/null + (( SECONDS - start < 5 )) || + error "cp: too long runtime $((SECONDS - start))" + + fi + # tar version 1.29+ supports SEEK_HOLE/DATA + if [[ $(tar --version | head -n1 | sed "s/[^0-9]//g") -ge 129 ]]; then + start=$SECONDS + time tar cS $file - | cat > /dev/null + (( SECONDS - start < 5 )) || + error "tar: too long runtime $((SECONDS - start))" + fi +} +run_test 430c "lseek: external tools check" + prep_801() { [[ $MDS1_VERSION -lt $(version_code 2.9.55) ]] || [[ $OST1_VERSION -lt $(version_code 2.9.55) ]] &&