Whamcloud - gitweb
LU-14642 tests: skip sanity-flr/100 for old servers
[fs/lustre-release.git] / lustre / tests / sanity-flr.sh
index d35ac8e..c268fdc 100644 (file)
@@ -15,7 +15,7 @@ init_logging
 
 ALWAYS_EXCEPT="$SANITY_FLR_EXCEPT "
 # Bug number for skipped test:    LU-14818 LU-11381 LU-14765
-ALWAYS_EXCEPT+="                  6        201      44c"
+ALWAYS_EXCEPT+="                  6        201      44c "
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 # skip all tests for PPC until we can get sanity-pfl to pass
@@ -25,7 +25,7 @@ fi
 
 if [[ "$ost1_FSTYPE" == "zfs" ]]; then
        # bug #:        LU-1941
-       ALWAYS_EXCEPT+="49a"
+       ALWAYS_EXCEPT+=" 49a "
 fi
 
 build_test_filter
@@ -1061,9 +1061,6 @@ test_31() {
        $LFS mirror create -N -o 0 -N -o 1 $tf ||
                error "creating mirrored file $tf failed"
 
-       #define OBD_FAIL_GLIMPSE_IMMUTABLE 0x1A00
-       $LCTL set_param fail_loc=0x1A00
-
        local ost_idx
        for ((ost_idx = 1; ost_idx <= 2; ost_idx++)); do
                cancel_lru_locks osc
@@ -2173,6 +2170,96 @@ test_44c() {
 }
 run_test 44c "lfs mirror split reduces block size of a file"
 
+test_44d() {
+       local tf=$DIR/$tdir/$tfile
+       local size1
+       local size2
+       local size3
+       local size4
+
+       stack_trap "rm -f $tf"
+
+       mkdir -p $DIR/$tdir || error "create directroy failed"
+
+       dd if=/dev/zero of=$tf bs=1M count=10 || error "dd write $tfile failed"
+       sync
+       size1=$(stat -c "%s" $tf)
+       echo " ** before mirror ops, file size=$size1"
+
+       $LFS mirror extend -N2 -c1 $tf || error "mirror extend $tfile failed"
+       sync
+       size2=$(stat -c "%s" $tf)
+       echo " ** after mirror extend, file size=$size2"
+
+       (($size1 == $size2)) ||
+               error "mirror extend should not change size, before: $size1, after $size2"
+
+       $LFS mirror split -d --mirror-id=2 $tf ||
+               error "mirror split $tfile failed"
+
+       size2=$(stat -c "%s" $tf)
+       echo " ** after mirror split, file size=$size2"
+       (($size1 == $size2)) ||
+               error "mirror split should not change size, before: $size1, after $size2"
+
+       # Remount client to clear cached size information
+       remount_client $MOUNT
+       size2=$(stat -c "%s" $tf)
+       echo " ** after mirror split & remount, file size=$size2"
+       (($size1 == $size2)) ||
+               error "mirror extend should not change size, before: $size1, after $size2"
+
+}
+run_test 44d "lfs mirror split does not break size"
+
+test_44e() {
+       local tf=$DIR/$tdir/$tfile
+       local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
+       local size1
+       local size2
+
+       test_mkdir $DIR/$tdir
+       [ $MDS1_VERSION -ge $(version_code 2.14.52) ] ||
+               skip "Need MDS version at least 2.14.52"
+
+       $LFS mirror create -N2 $tf || error "create mirrored file $tf failed"
+
+       # Disable xattr caching so we can repeatedly check SOM with lfs getsom
+       $LCTL set_param llite.*.xattr_cache=0
+       stack_trap "$LCTL set_param llite.*.xattr_cache=1"
+
+       dd if=/dev/zero of=$tf bs=1M count=10 || error "dd write $tfile failed"
+       sync
+       size1=$(stat -c "%s" $tf)
+       echo " ** before mirror resync, file size=$size1"
+
+       $LFS mirror resync $tf || error "mirror resync file $tf failed"
+       size1=$(stat -c "%s" $tf)
+       size2=$($LFS getsom -s $tf)
+
+       $LFS getsom $tf
+
+       ((size1 == size2)) ||
+               error "mirrored file with strict SOM $size1 != disabled SOM $size2"
+
+       # Remount client to clear cached size information
+       remount_client $MOUNT
+
+       save_lustre_params $(get_facets MDS) mdt.*MDT*.enable_strict_som > $p
+       stack_trap "restore_lustre_params < $p; rm -f $p"
+       local mds_facet=mds$(($($LFS getstripe -m $tf) + 1))
+
+       do_facet $mds_facet $LCTL set_param mdt.*MDT*.enable_strict_som=0
+
+       size2=$(stat -c "%s" $tf)
+       # 'getsom' here is just for debugging
+       $LFS getsom $tf
+
+       ((size2 == size1)) ||
+               error "mirrored file in sync with som disabled, size with som disabled ($size2) and without som disabled ($size1) should agree"
+}
+run_test 44e "basic FLR SOM tests + disable SOM"
+
 test_45() {
        [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs"
 
@@ -3021,6 +3108,23 @@ test_70() {
 }
 run_test 70 "mirror create and split race"
 
+test_100() {
+       local tf=$DIR/$tdir/$tfile
+
+       (( $OST1_VERSION >= $(version_code 2.14.51) )) ||
+               skip "Need OST version at least 2.14.51"
+
+
+       test_mkdir $DIR/$tdir
+
+       $LFS setstripe -N -E1M -c-1 -Eeof -c-1 $tf ||
+               error "setstripe $tf failed"
+
+       FSXNUM=${FSXNUM:-1000}
+       $FSX -p 5 -N $FSXNUM -S 0 -M $tf || error "fsx FLR file $tf failed"
+}
+run_test 100 "flr mode fsx test"
+
 ctrl_file=$(mktemp /tmp/CTRL.XXXXXX)
 lock_file=$(mktemp /var/lock/FLR.XXXXXX)