Whamcloud - gitweb
EX-9530 tests: fix issues in backport of LU-13569
authorSerguei Smirnov <ssmirnov@whamcloud.com>
Fri, 26 Apr 2024 21:48:55 +0000 (14:48 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 27 Apr 2024 22:28:21 +0000 (22:28 +0000)
Backport of "LU-13569 tests: Check LNet Health recovery logic"
introduced adding of redundant lnets and drop rules.
Clean this up.

Test-Parameters: trivial testlist=sanity-lnet
Test-Parameters: trivial testlist=sanity-lnet clientversion=EXA6 serverversion=2.15
Fixes: 2b6f7a39 ("LU-13569 tests: Check LNet Health recovery logic")
Signed-off-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Change-Id: I1e2d5d31f77a29504182650be30f9db7087d82cc
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54939
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-lnet.sh

index fa90205..69b0bd9 100755 (executable)
@@ -1691,10 +1691,16 @@ test_204() {
        for hstatus in ${LNET_LOCAL_RESEND_STATUSES} \
                       ${LNET_LOCAL_NO_RESEND_STATUSES}; do
                echo "Simulate $hstatus"
-               $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e ${hstatus}
-               do_lnetctl discover $($LCTL list_nids | head -n 1) &&
+               lnet_health_pre || return $?
+
+               add_health_test_drop_rules ${hstatus}
+               do_lnetctl discover ${RNIDS[0]} &&
                        error "Should have failed"
-               $LCTL net_drop_del -a
+
+               lnet_health_post
+
+               check_no_resends || return $?
+               check_no_local_health || return $?
        done
 
        cleanup_health_test || return $?
@@ -1711,18 +1717,12 @@ test_205() {
 
        local hstatus
        for hstatus in ${LNET_LOCAL_RESEND_STATUSES}; do
-               reinit_dlc || return $?
-               add_net "tcp" "eth0" || return $?
-               add_net "tcp1" "eth0" || return $?
-
                echo "Simulate $hstatus"
-               lnet_health_pre
+               lnet_health_pre || return $?
 
-               $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e ${hstatus}
-               $LCTL net_drop_add -s *@tcp1 -d *@tcp1 -m GET -r 1 -e ${hstatus}
-               do_lnetctl discover $($LCTL list_nids | head -n 1) &&
+               add_health_test_drop_rules ${hstatus}
+               do_lnetctl discover ${RNIDS[0]} &&
                        error "Should have failed"
-               $LCTL net_drop_del -a
 
                lnet_health_post
 
@@ -1731,18 +1731,12 @@ test_205() {
        done
 
        for hstatus in ${LNET_LOCAL_NO_RESEND_STATUSES}; do
-               reinit_dlc || return $?
-               add_net "tcp" "eth0" || return $?
-               add_net "tcp1" "eth0" || return $?
-
                echo "Simulate $hstatus"
                lnet_health_pre || return $?
 
-               $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e ${hstatus}
-               $LCTL net_drop_add -s *@tcp1 -d *@tcp1 -m GET -r 1 -e ${hstatus}
-               do_lnetctl discover $($LCTL list_nids | head -n 1) &&
+               add_health_test_drop_rules ${hstatus}
+               do_lnetctl discover ${RNIDS[0]} &&
                        error "Should have failed"
-               $LCTL net_drop_del -a
 
                lnet_health_post
 
@@ -1766,10 +1760,17 @@ test_206() {
        for hstatus in ${LNET_REMOTE_RESEND_STATUSES} \
                       ${LNET_REMOTE_NO_RESEND_STATUSES}; do
                echo "Simulate $hstatus"
-               $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e ${hstatus}
-               do_lnetctl discover $($LCTL list_nids | head -n 1) &&
+               lnet_health_pre || return $?
+
+               add_health_test_drop_rules ${hstatus}
+               do_lnetctl discover ${RNIDS[0]} &&
                        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 $?
        done
 
        cleanup_health_test || return $?
@@ -1786,20 +1787,13 @@ test_207() {
 
        local hstatus
        for hstatus in ${LNET_REMOTE_RESEND_STATUSES}; do
-               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 $hstatus"
                lnet_health_pre || return $?
-               $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e ${hstatus}
-               $LCTL net_drop_add -s *@tcp1 -d *@tcp1 -m GET -r 1 -e ${hstatus}
-               do_lnetctl discover $($LCTL list_nids | head -n 1) &&
+
+               add_health_test_drop_rules ${hstatus}
+
+               do_lnetctl discover ${RNIDS[0]} &&
                        error "Should have failed"
-               $LCTL net_drop_del -a
 
                lnet_health_post
 
@@ -1810,20 +1804,13 @@ test_207() {
                        error "Unable to reset health rc=$?"
        done
        for hstatus in ${LNET_REMOTE_NO_RESEND_STATUSES}; do
-               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 $hstatus"
                lnet_health_pre || return $?
-               $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e ${hstatus}
-               $LCTL net_drop_add -s *@tcp1 -d *@tcp1 -m GET -r 1 -e ${hstatus}
-               do_lnetctl discover $($LCTL list_nids | head -n 1) &&
+
+               add_health_test_drop_rules ${hstatus}
+
+               do_lnetctl discover ${RNIDS[0]} &&
                        error "Should have failed"
-               $LCTL net_drop_del -a
 
                lnet_health_post