From ec3a183cfaddd43316f831dfd04f7742f88ab834 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Tue, 11 Jun 2024 11:55:10 -0600 Subject: [PATCH] LU-17440 tests: Fix sanity-lnet/test_226 test_226 is not deleting a route from the remote peer as intended. This is because of two issues. The first issue is that the wrong gateway NID is being provided to do_route_del(). The second issue is that do_route_del() is not correctly quoting the remote command to detect and delete routes. The correct NID is now specified and the quoting in do_route_del() has been fixed. Some additional output was also added so that we can verify via test output that it is working correctly. Test-Parameters: trivial testlist=sanity-lnet Fixes: 2b210f3905 ("LU-17440 lnet: prevent errorneous decref for asym route") Signed-off-by: Chris Horn Change-Id: Ie21a1bdb174cb65ae64134a727d69e1c95a4ddd5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55397 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Gian-Carlo DeFazio Reviewed-by: Frank Sehr Reviewed-by: Oleg Drokin --- lustre/tests/sanity-lnet.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh index f3f4988..e7a1e40 100755 --- a/lustre/tests/sanity-lnet.sh +++ b/lustre/tests/sanity-lnet.sh @@ -1373,12 +1373,13 @@ do_route_del() { local gw=$3 do_nodesv $node \ - 'output="$($LNETCTL route show --net $net --gateway $gw 2>/dev/null)"; \ - if [[ "x${output}x" != "xx" ]]; then \ - $LNETCTL route del --net $net --gateway $gw; \ - else \ - exit 0; \ - fi' + "output=\\\"\\\$($LNETCTL route show --net $net --gateway $gw 2>/dev/null)\\\"; \ + if [[ -n \\\"\\\${output}\\\" ]]; then \ + echo \\\"Delete route to $net via $gw\\\"; \ + $LNETCTL route del --net $net --gateway $gw; \ + else \ + exit 0; \ + fi" } cleanup_router_test() { @@ -3139,8 +3140,7 @@ do_basic_rtr_test() { local router_nids=( ${ROUTER_NIDS[$router]} ) do_route_add $HOSTNAME $REMOTE_NET ${router_nids[0]} || - error "Failed to add route $HOSTNAME -> "\ - "$REMOTE_NET via ${router_nids[0]}" + return $? done for router in ${!ROUTER_INTERFACES[@]}; do @@ -3148,8 +3148,7 @@ do_basic_rtr_test() { for rpeer in ${!RPEER_INTERFACES[@]}; do do_route_add $rpeer $LOCAL_NET ${router_nids[1]} || - error "Failed to add route $rpeer -> "\ - "$LOCAL_NET via ${router_nids[1]}" + return $? done done @@ -3392,7 +3391,7 @@ test_226() { # remove a route from the peer local router_nids=( ${ROUTER_NIDS[${ROUTERS[0]}]} ) - do_route_del $rpeer $LOCAL_NET ${router_nids[0]} + do_route_del $rpeer $LOCAL_NET ${router_nids[1]} # should attempt to use both routes due to round-robin # failure case here is an LBUG on $rpeer -- 1.8.3.1