X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-dom.sh;h=f26ced750a62483f44d2f5c5e8ebec5e56cee574;hb=1bb7d66a574664c95c4933ee720f6a85ff13dddf;hp=01bedae6d07b6e393a3320411ad3754192eb0e31;hpb=b915221b6d0f3457fd9dd202a9d14c5f8385bf47;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity-dom.sh b/lustre/tests/sanity-dom.sh index 01bedae..f26ced7 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! - -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 -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 +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; } +[[ "$MDS1_VERSION" -ge $(version_code 2.10.56) ]] || + skip "Need MDS version at least 2.10.56" -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" @@ -120,6 +106,55 @@ test_4() { } run_test 4 "DoM: glimpse doesn't produce duplicated locks" +test_5() { + local before=$(date +%s) + local evict + + dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1 || return 1 + + multiop_bg_pause $DIR/$tfile O_Ac || return 1 + setxattr=$! + + multiop_bg_pause $DIR/$tfile O_Tc || return 1 + truncate=$! + + multiop $DIR2/$tfile Ow10 || return 1 + + getfattr -d $DIR2/$tfile + +#define OBD_FAIL_LLITE_TRUNCATE_INODE_PAUSE 0x1415 + $LCTL set_param fail_loc=0x80001415 fail_val=5 + kill -USR1 $truncate + sleep 1 + multiop $DIR2/$tfile Ow10 & + sleep 1 + kill -USR1 $setxattr + + wait + + evict=$(do_facet client $LCTL get_param mdc.$FSNAME-MDT*.state | + awk -F"[ [,]" '/EVICTED ]$/ { if (mx<$5) {mx=$5;} } END { print mx }') + + [ -z "$evict" ] || [[ $evict -le $before ]] || + (do_facet client $LCTL get_param mdc.$FSNAME-MDT*.state; + error "eviction happened: $evict before:$before") +} +run_test 5 "DoM truncate deadlock" + +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 @@ -133,10 +168,8 @@ test_sanity() { # XXX: to fix 45. Add 42a, c when LU-9693 fixed. # Add 42b when LU-6493 fixed - # Enable 39k when LU-10496 fixed ONLY="36 39 40 41 42d 42e 43 46 56r 101e 119a 131 150 155a 155b 155c \ - 155d 207 241 251" \ - EXCEPT=39k OSC="mdc" DOM="yes" bash sanity.sh + 155d 207 241 251" OSC="mdc" DOM="yes" bash sanity.sh } run_test sanity "Run sanity with Data-on-MDT files"