Whamcloud - gitweb
LU-12350 tests: Do not use background failover
[fs/lustre-release.git] / lustre / tests / sanity-flr.sh
index 74cad1a..33732e3 100644 (file)
@@ -17,6 +17,7 @@ LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
+get_lustre_env
 init_logging
 
 [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.56) ]] ||
@@ -674,6 +675,9 @@ test_0g() {
 run_test 0g "lfs mirror create flags support"
 
 test_0h() {
+       [ $MDS1_VERSION -lt $(version_code 2.11.57) ] &&
+               skip "Need MDS version at least 2.11.57"
+
        local td=$DIR/$tdir
        local tf=$td/$tfile
        local ids
@@ -1060,10 +1064,8 @@ test_33() {
        start_osts 1
 
        # read file again with ost2 failed
-       $LCTL set_param ldlm.namespaces.lustre-*-osc-[-0-9a-f]*.lru_size=clear
-
-       fail ost2 &
-       sleep 1
+       stop_osts 2
+       drop_client_cache
 
        # check size, glimpse should work
        $CHECKSTAT -t file -s $fsize $DIR/$tfile ||
@@ -1074,7 +1076,7 @@ test_33() {
        [[ "$rs" == "ost1" ]] ||
                error "file content error: expected: \"ost1\", actual: \"$rs\""
 
-       wait_osc_import_state client ost2 FULL
+       start_osts 2
 }
 run_test 33 "read can choose available mirror to read"
 
@@ -1270,6 +1272,9 @@ create_files_37() {
 
 test_37()
 {
+       [ $MDS1_VERSION -lt $(version_code 2.11.57) ] &&
+               skip "Need MDS version at least 2.11.57"
+
        local tf=$DIR/$tfile
        local tf2=$DIR/$tfile-2
        local tf3=$DIR/$tfile-3
@@ -1320,21 +1325,15 @@ test_37()
 
        local osts=$(comma_list $(osts_nodes))
 
-       # define OBD_FAIL_OST_SKIP_LV_CHECK     0x241
-       do_nodes $osts lctl set_param fail_loc=0x241
-
-       mirror_io copy -i ${mirror_array[0]} \
-               -t $(echo ${mirror_array[@]:1} | tr ' ' ',') $tf ||
-                       error "mirror copy error"
-
-       do_nodes $osts lctl set_param fail_loc=0
+       $LFS mirror copy -i ${mirror_array[0]} -o-1 $tf ||
+               error "mirror copy error"
 
        # verify copying is successful by checking checksums
        remount_client $MOUNT
        for i in ${mirror_array[@]}; do
                sum=$($LFS mirror read -N $i $tf | md5sum)
                [ "$sum" = "${checksums[1]}" ] ||
-                       error "$i: mismatch checksum after copy"
+                       error "$i: mismatch checksum after copy \'$sum\'"
        done
 
        rm -f $tf
@@ -1813,7 +1812,7 @@ test_44() {
 run_test 44 "lfs mirror split check"
 
 test_45() {
-       [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return
+       [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs"
 
        local file=$DIR/$tdir/$tfile
        local dir=$DIR/$tdir/$dir
@@ -1825,16 +1824,14 @@ test_45() {
                -N -E3m -S1m -Eeof -N -E8m -Eeof $file ||
                        error "Create $file failed"
 
-       echo "getstripe --yaml $file"
-       $LFS getstripe --yaml $file > $temp || error "getstripe $file failed"
-       echo "setstripe --yaml=$temp $file.2"
-       $LFS setstripe --yaml=$temp $file.2 || error "setstripe $file.2 failed"
+       verify_yaml_layout $file $file.copy $temp "1. FLR file"
+       rm -f $file $file.copy
 
-       echo "compare layout"
-       local layout1=$(get_layout_param $file)
-       local layout2=$(get_layout_param $file.2)
-       [ "$layout1" == "$layout2" ] ||
-               error "FLR file $file/$file.2 layouts are not equal"
+       $LFS setstripe -N -E1m -S1m -c2 -o0,1 -E2m -Eeof -N -E4m -Eeof \
+               -N -E3m -S1m -Eeof -N -E8m --flags=prefer -Eeof $file ||
+                       error "Create $file failed"
+
+       verify_yaml_layout $file $file.copy $temp "2. FLR file with flags"
 }
 run_test 45 "Verify setstripe/getstripe with YAML with FLR file"
 
@@ -1981,6 +1978,9 @@ test_47() {
 run_test 47 "Verify mirror obj alloc"
 
 test_48() {
+       [ $MDS1_VERSION -lt $(version_code 2.11.55) ] &&
+               skip "Need MDS version at least 2.11.55"
+
        local tf=$DIR/$tfile
 
        rm -f $tf
@@ -2254,7 +2254,9 @@ test_202() {
 run_test 202 "lfs setstripe --add-component wide striping"
 
 test_203() {
-       [[ $OSTCOUNT -lt 2 ]] && skip "need >= 2 OSTs" && return
+       [ $MDS1_VERSION -lt $(version_code 2.11.55) ] &&
+               skip "Need MDS version at least 2.11.55"
+       [[ $OSTCOUNT -lt 2 ]] && skip "need >= 2 OSTs"
 
        local tf=$DIR/$tfile