Whamcloud - gitweb
LU-2934 lnet: Add LNet Router Priority parameter
[fs/lustre-release.git] / lustre / tests / sanity.sh
index b799cac..fcf5f72 100644 (file)
@@ -638,6 +638,9 @@ test_17n() {
 run_test 17n "run e2fsck against master/slave MDT which contains remote dir"
 
 test_17o() {
+       [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.3.64) ]] &&
+               skip "Need MDS version at least 2.3.64" && return
+
        local WDIR=$DIR/${tdir}o
        local mdt_index
        local mdtdevname
@@ -9203,6 +9206,17 @@ changelog_chmask()
        fi
 }
 
+changelog_extract_field() {
+       local mdt=$1
+       local cltype=$2
+       local file=$3
+       local identifier=$4
+
+       $LFS changelog $mdt | gawk "/$cltype.*$file$/ {
+               print gensub(/^.* "$identifier'(\[[^\]]*\]).*$/,"\\1",1)}' |
+               tail -1
+}
+
 test_160() {
        [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
@@ -9248,14 +9262,14 @@ test_160() {
 
        # verify contents
        echo "verifying target fid"
-       fidc=$($LFS changelog $MDT0|awk '/CREAT.*timestamp$/{print $6}'|tail -1)
+       fidc=$(changelog_extract_field $MDT0 "CREAT" "timestamp" "t=")
        fidf=$($LFS path2fid $DIR/$tdir/pics/zach/timestamp)
-       [ "$fidc" == "t=$fidf" ] ||
+       [ "$fidc" == "$fidf" ] ||
                err17935 "fid in changelog $fidc != file fid $fidf"
        echo "verifying parent fid"
-       fidc=$($LFS changelog $MDT0|awk '/CREAT.*timestamp$/{print $7}'|tail -1)
+       fidc=$(changelog_extract_field $MDT0 "CREAT" "timestamp" "p=")
        fidf=$($LFS path2fid $DIR/$tdir/pics/zach)
-       [ "$fidc" == "p=$fidf" ] ||
+       [ "$fidc" == "$fidf" ] ||
                err17935 "pfid in changelog $fidc != dir fid $fidf"
 
        USER_REC1=$($GET_CL_USERS | awk "\$1 == \"$USER\" {print \$2}")
@@ -9727,6 +9741,9 @@ test_182() {
 run_test 182 "Disable MDC RPCs semaphore wouldn't crash client ================"
 
 test_183() { # LU-2275
+       [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.3.56) ]] &&
+               skip "Need MDS version at least 2.3.56" && return
+
        [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
        mkdir -p $DIR/$tdir || error "creating dir $DIR/$tdir"
        echo aaa > $DIR/$tdir/$tfile
@@ -10662,12 +10679,13 @@ test_215() { # for bugs 18102, 21079, 21517
 
        # /proc/sys/lnet/routes should look like this:
        # Routing disabled/enabled
-       # net hops state router
-       # where net is a string like tcp0, hops >= 0, state is up/down,
+       # net hops priority state router
+       # where net is a string like tcp0, hops > 0, priority >= 0,
+       # state is up/down,
        # router is a string like 192.168.1.1@tcp2
        L1="^Routing (disabled|enabled)$"
-       L2="^net +hops +state +router$"
-       BR="^$NET +$N +(up|down) +$NID$"
+       L2="^net +hops +priority +state +router$"
+       BR="^$NET +$N +(0|1) +(up|down) +$NID$"
        create_lnet_proc_files "routes"
        check_lnet_proc_entry "routes.out" "/proc/sys/lnet/routes" "$BR" "$L1" "$L2"
        check_lnet_proc_entry "routes.sys" "lnet.routes" "$BR" "$L1" "$L2"
@@ -11407,6 +11425,29 @@ test_233() {
 }
 run_test 233 "checking that OBF of the FS root succeeds"
 
+test_234() {
+       local p="$TMP/sanityN-$TESTNAME.parameters"
+       save_lustre_params client "llite.*.xattr_cache" > $p
+       lctl set_param llite.*.xattr_cache 1 ||
+               { skip "xattr cache is not supported"; return 0; }
+
+       mkdir -p $DIR/$tdir || error "mkdir failed"
+       touch $DIR/$tdir/$tfile || error "touch failed"
+       # OBD_FAIL_LLITE_XATTR_ENOMEM
+       $LCTL set_param fail_loc=0x1405
+       setfattr -n user.attr -v value $DIR/$tdir/$tfile &&
+               error "setfattr should have failed with ENOMEM"
+       # attr pre-2.4.44-7 had a bug with rc
+       getfattr -n user.attr $DIR/$tdir/$tfile &&
+               error "getfattr should have failed with ENOMEM"
+       $LCTL set_param fail_loc=0x0
+       rm -rf $DIR/$tdir
+
+       restore_lustre_params < $p
+       rm -f $p
+}
+run_test 234 "xattr cache should not crash on ENOMEM"
+
 #
 # tests that do cleanup/setup should be run at the end
 #