X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-dom.sh;h=41b29eb2b00cbb399bf8b3f23d192279fb5032cc;hb=1155c2fee4c197bfc295f761d52f9b748c37ad79;hp=f87be088acda69b0a2287a70a3a6deac3b8cf81b;hpb=68dd8a8acff9ad2295a1fcba318fc8ed5f140026;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity-dom.sh b/lustre/tests/sanity-dom.sh index f87be08..41b29eb 100644 --- a/lustre/tests/sanity-dom.sh +++ b/lustre/tests/sanity-dom.sh @@ -7,33 +7,21 @@ set -e ONLY=${ONLY:-"$*"} -# bug number for skipped test: -ALWAYS_EXCEPT="$SANITY_DOM_EXCEPT" -[ "$SLOW" = "no" ] && EXCEPT_SLOW="" -# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! - -if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then -# bug number for skipped test: - ALWAYS_EXCEPT+="" - if [ $MDSCOUNT -gt 1 ]; then -# bug number for skipped test: - ALWAYS_EXCEPT+="" - fi -fi - -LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh -CLEANUP=${CLEANUP:-:} -SETUP=${SETUP:-:} init_test_env $@ -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging +# bug number for skipped test: +ALWAYS_EXCEPT="$SANITY_DOM_EXCEPT" +# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! + +build_test_filter + [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.56) ]] || { skip "Need MDS version at least 2.10.56"; exit 0; } -MULTIOP=${MULTIOP:-multiop} OPENFILE=${OPENFILE:-openfile} MOUNT_2=${MOUNT_2:-"yes"} FAIL_ON_ERROR=false @@ -46,8 +34,6 @@ if [[ $UID -eq 0 && $RUNAS_ID -eq 0 ]]; then fi check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS -build_test_filter - DOM="yes" DOM_SIZE=${DOM_SIZE:-"$((1024*1024))"} OSC="mdc" @@ -96,6 +82,44 @@ test_3() { } run_test 3 "Truncate over DoM size on different nodes" +test_4() { + local before=0 + local after=0 + + dd if=/dev/zero of=$DIR1/$tfile bs=2M count=1 + cancel_lru_locks mdc + + #define OBD_FAIL_MDC_GLIMPSE_DDOS 0x808 + $LCTL set_param fail_loc=0x80000808 + before=$(lctl get_param -n ldlm.namespaces.*mdc*.lock_count | + gawk '{cnt=cnt+$1} END{print cnt}') + for ((i=1; i < 100; i++)) + do + tail -n100 $DIR1/$tfile > /dev/null + stat -f $DIR2/$tfile > /dev/null + done + after=$(lctl get_param -n ldlm.namespaces.*mdc*.lock_count | + gawk '{cnt=cnt+$1} END{print cnt}') + [[ $((after - before)) -ge 20 ]] && + error "Too many locks found $((after - before))" + return 0 +} +run_test 4 "DoM: glimpse doesn't produce duplicated locks" + +test_6() { + $MULTIOP $DIR1/$tfile Oz40960w100_z200w100c & + MULTIPID=$! + + # let MULTIPID to create the file + sleep 1 + $MULTIOP $DIR2/$tfile oO_RDWR:Tw100c + kill -USR1 $MULTIPID + wait + $MULTIOP $DIR2/$tfile oO_RDWR:z400w100c + $CHECKSTAT -s 500 $DIR2/$tfile || error "wrong size" +} +run_test 6 "Race two writes, check file size" + test_fsx() { local file1=$DIR1/$tfile local file2=$DIR2/$tfile