Whamcloud - gitweb
LU-14227 tests: Add missing space in sanity-lnet test 21
[fs/lustre-release.git] / lustre / tests / sanity-lnet.sh
index 483e669..5909412 100755 (executable)
@@ -12,10 +12,10 @@ ONLY=${ONLY:-"$*"}
 ALWAYS_EXCEPT="$SANITY_LNET_EXCEPT "
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
-# skip test ARM testing until they are fixed
+# skip the grant tests for ARM until they are fixed
 if [[ $(uname -m) = aarch64 ]]; then
-       # bug number for skipped test: LU-13704 LU-13701 LU-13701 LU-13701
-       ALWAYS_EXCEPT+="               204      205      206      207 "
+       # bug number:    LU-14067
+       ALWAYS_EXCEPT+=" 300"
 fi
 
 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
@@ -849,7 +849,7 @@ peer:
         - nid: 25@gni
 EOF
        append_global_yaml
-       echo"Add peer with nidrange (gni)"
+       echo "Add peer with nidrange (gni)"
        compare_peer_add "21@gni" "[22-25]@gni" || error
        echo "Add peer with nidrange that overlaps primary nid (gni)"
        compare_peer_add "21@gni" "[21-25]@gni"
@@ -1178,6 +1178,63 @@ test_103() {
 }
 run_test 103 "Delete route with multiple gw (tcp)"
 
+test_104() {
+       local tyaml="$TMP/sanity-lnet-$testnum-expected.yaml"
+
+       reinit_dlc || return $?
+
+       # Default value is '3'
+       local val=$($LNETCTL global show | awk '/response_tracking/{print $NF}')
+       [[ $val -ne 3 ]] &&
+               error "Expect 3 found $val"
+
+       echo "Set < 0;  Should fail"
+       do_lnetctl set response_tracking -1 &&
+                error "should have failed $?"
+
+       reinit_dlc || return $?
+       cat <<EOF > $tyaml
+global:
+    response_tracking: -10
+EOF
+       do_lnetctl import < $tyaml &&
+               error "should have failed $?"
+
+       echo "Check valid values; Should succeed"
+       local i
+       for ((i = 0; i < 4; i++)); do
+               reinit_dlc || return $?
+               do_lnetctl set response_tracking $i ||
+                        error "should have succeeded $?"
+               $LNETCTL global show | grep -q "response_tracking: $i" ||
+                       error "Failed to set response_tracking to $i"
+               reinit_dlc || return $?
+               cat <<EOF > $tyaml
+global:
+    response_tracking: $i
+EOF
+               do_lnetctl import < $tyaml ||
+                       error "should have succeeded $?"
+               $LNETCTL global show | grep -q "response_tracking: $i" ||
+                       error "Failed to set response_tracking to $i"
+       done
+
+       reinit_dlc || return $?
+       echo "Set > 3; Should fail"
+       do_lnetctl set response_tracking 4 &&
+                error "should have failed $?"
+
+       reinit_dlc || return $?
+       cat <<EOF > $tyaml
+global:
+    response_tracking: 10
+EOF
+       do_lnetctl import < $tyaml &&
+               error "should have failed $?"
+       return 0
+}
+run_test 104 "Set/check response_tracking param"
+
 ### load lnet in default namespace, configure in target namespace
 
 test_200() {
@@ -1418,7 +1475,7 @@ run_test 205 "Check health and resends for multi-rail local failures"
 
 # See lnet/lnet/lib-msg.c:lnet_health_check()
 LNET_REMOTE_RESEND_STATUSES="remote_dropped"
-LNET_REMOTE_NO_RESEND_STATUSES="remote_error remote_timeout network_timeout"
+LNET_REMOTE_NO_RESEND_STATUSES="remote_error remote_timeout"
 test_206() {
        have_interface "eth0" || skip "Need eth0 interface with ipv4 configured"
        reinit_dlc || return $?
@@ -1586,6 +1643,55 @@ test_208() {
 }
 run_test 208 "Test various kernel ip2nets configurations"
 
+test_209() {
+       have_interface "eth0" || skip "Need eth0 interface with ipv4 configured"
+
+       reinit_dlc || return $?
+       add_net "tcp" "eth0" || return $?
+
+       do_lnetctl discover $($LCTL list_nids | head -n 1) ||
+               error "failed to discover myself"
+
+       echo "Simulate network_timeout w/SR config"
+       lnet_health_pre
+
+       $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e network_timeout
+       do_lnetctl discover $($LCTL list_nids | head -n 1) &&
+               error "Should have failed"
+       $LCTL net_drop_del -a
+
+       lnet_health_post
+
+       check_no_resends || return $?
+       check_no_local_health || return $?
+       check_no_remote_health || return $?
+
+       reinit_dlc || return $?
+       add_net "tcp" "eth0" || return $?
+       add_net "tcp1" "eth0" || return $?
+
+       do_lnetctl discover $($LCTL list_nids | head -n 1) ||
+               error "failed to discover myself"
+
+       echo "Simulate network_timeout w/MR config"
+       lnet_health_pre
+
+       $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e network_timeout
+       $LCTL net_drop_add -s *@tcp1 -d *@tcp1 -m GET -r 1 -e network_timeout
+       do_lnetctl discover $($LCTL list_nids | head -n 1) &&
+               error "Should have failed"
+       $LCTL net_drop_del -a
+
+       lnet_health_post
+
+       check_no_resends || return $?
+       check_local_health || return $?
+       check_remote_health || return $?
+
+       return 0
+}
+run_test 209 "Check health, but not resends, for network timeout"
+
 test_300() {
        # LU-13274
        local header