Whamcloud - gitweb
LU-17440 tests: Fix sanity-lnet/test_226 97/55397/4
authorChris Horn <chris.horn@hpe.com>
Tue, 11 Jun 2024 17:55:10 +0000 (11:55 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Jun 2024 03:24:30 +0000 (03:24 +0000)
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 <chris.horn@hpe.com>
Change-Id: Ie21a1bdb174cb65ae64134a727d69e1c95a4ddd5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55397
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Gian-Carlo DeFazio <defazio1@llnl.gov>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-lnet.sh

index f3f4988..e7a1e40 100755 (executable)
@@ -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