From b43cd5fea3ea8eebf15e1429762b6ca97ab46228 Mon Sep 17 00:00:00 2001 From: Serguei Smirnov Date: Fri, 26 Apr 2024 14:48:55 -0700 Subject: [PATCH] EX-9530 tests: fix issues in backport of LU-13569 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 Change-Id: I1e2d5d31f77a29504182650be30f9db7087d82cc Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54939 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/tests/sanity-lnet.sh | 77 +++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 45 deletions(-) diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh index fa90205..69b0bd9 100755 --- a/lustre/tests/sanity-lnet.sh +++ b/lustre/tests/sanity-lnet.sh @@ -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 -- 1.8.3.1