Whamcloud - gitweb
LU-14155 mdc: avoid easize set to 0
[fs/lustre-release.git] / lustre / tests / sanity-dom.sh
index 0b2ecd3..ffff7db 100644 (file)
@@ -19,8 +19,8 @@ ALWAYS_EXCEPT="$SANITY_DOM_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"
 
 OPENFILE=${OPENFILE:-openfile}
 MOUNT_2=${MOUNT_2:-"yes"}
@@ -67,14 +67,14 @@ test_3() {
        # Write on one node to the DoM stripe and then truncate to over DoM size
        dd if=/dev/zero of=$DIR1/$tfile bs=$((DOM_SIZE-100)) count=1 ||
                return 1
-       truncate $DIR1/$tfile $((DOM_SIZE+700)) || return 2
+       $TRUNCATE $DIR1/$tfile $((DOM_SIZE+700)) || return 2
        # read on the second node inside DoM stripe to take a lock data from
        # the first client
        dd if=$DIR2/$tfile of=/dev/null bs=4096 count=1 seek=1 || return 3
        $CHECKSTAT -t file -s $((DOM_SIZE+700)) $DIR2/$tfile ||
                error "Wrong size after first truncate $tfile on first node"
        # now do local truncate over DoM size and check size is correct
-       truncate $DIR2/$tfile $((DOM_SIZE+500)) || return 4
+       $TRUNCATE $DIR2/$tfile $((DOM_SIZE+500)) || return 4
        $CHECKSTAT -t file -s $((DOM_SIZE+500)) $DIR2/$tfile ||
                error "Wrong size after second truncate on the same node"
        $CHECKSTAT -t file -s $((DOM_SIZE+500)) $DIR1/$tfile ||
@@ -155,6 +155,19 @@ test_6() {
 }
 run_test 6 "Race two writes, check file size"
 
+test_7() {
+       dd if=/dev/zero of=$DIR1/$tfile bs=1000 count=1
+       cancel_lru_locks
+
+       $MULTIOP $DIR1/$tfile or1000c
+       dd if=/dev/urandom of=$DIR2/$tfile bs=1000 count=1
+       local md5_1=$(md5sum $DIR/$tfile | awk '{ print $1 }')
+       local md5_2=$(md5sum $DIR2/$tfile | awk '{ print $1 }')
+       [[ $md5_1 == $md5_2 ]] ||
+               error "Client reads stale page"
+}
+run_test 7 "Stale pages after read-on-open"
+
 test_fsx() {
        local file1=$DIR1/$tfile
        local file2=$DIR2/$tfile
@@ -166,23 +179,31 @@ run_test fsx "Dual-mount fsx with DoM files"
 
 test_sanity()
 {
+       SANITY_ONLY=${SANITY_ONLY:-"36 39 40 41 42d 42e 43 46 56r 101e 119a \
+                                   131 150 155a 155b 155c 155d 207 241 251"}
+       SANITY_REPEAT=${SANITY_REPEAT:-1}
        # 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
+       ONLY=$SANITY_ONLY ONLY_REPEAT=$SANITY_REPEAT OSC="mdc" DOM="yes" \
+               bash sanity.sh
+
+       return 0
 }
 run_test sanity "Run sanity with Data-on-MDT files"
 
 test_sanityn()
 {
+       SANITYN_ONLY=${SANITYN_ONLY:-"1 2 4 5 6 7 8 9 10 11 12 14 17 19 20 \
+                                     23 27 39 51a 51c 51d 107"}
+       SANITYN_REPEAT=${SANITYN_REPEAT:-1}
        # XXX: to fix 60
-       ONLY="1 2 4 5 6 7 8 9 10 11 12 14 17 19 20 23 27 39 51a 51c 51d" \
-               OSC="mdc" DOM="yes" bash sanityn.sh
+       ONLY=$SANITYN_ONLY ONLY_REPEAT=$SANITYN_REPEAT OSC="mdc" DOM="yes" \
+               bash sanityn.sh
+
+       return 0
 }
 run_test sanityn "Run sanityn with Data-on-MDT files"
 
 complete $SECONDS
 check_and_cleanup_lustre
-exit_status
+exit_status "${TMP}/sanity.log ${TMP}/sanityn.log"