From 432b60d1949689e4ecff6cacc6bd6a59df8f0b56 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 14:08:51 +0200 Subject: [PATCH] tests: fix nhc1 route check after nhs1 down After setting down nhs1, the test is checking that nhc1 routing table matches routes in nhc1/nhrp_route.json. It is incorrect because it checks that the NHRP route to nhs1 is still present but it should have disappeared. Signed-off-by: Louis Scalbert --- .../nhc1/nhrp_route_nhs1_down.json | 49 +++++++++++++++++++ .../nhrp_redundancy/test_nhrp_redundancy.py | 6 +-- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json new file mode 100644 index 0000000000..a8fd1934d6 --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json @@ -0,0 +1,49 @@ +{ + "176.16.1.1\/32": null, + "176.16.1.2\/32": [ + { + "prefix": "176.16.1.2\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhc1-gre0", + "active": true + } + ] + } + ], + "176.16.1.3\/32": [ + { + "prefix": "176.16.1.3\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhc1-gre0", + "active": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py index 891a3cb8c3..441bd56adf 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py @@ -200,7 +200,7 @@ def test_protocols_convergence(): # Check NHRP cache on servers and clients for rname, router in router_list.items(): - if 'nh' not in rname: + if "nh" not in rname: continue json_file = "{}/{}/nhrp_cache.json".format(CWD, router.name) @@ -219,7 +219,7 @@ def test_protocols_convergence(): # Check NHRP IPV4 routes on servers and clients logger.info("Checking IPv4 routes for convergence") for rname, router in router_list.items(): - if 'nh' not in rname: + if "nh" not in rname: continue json_file = "{}/{}/nhrp_route.json".format(CWD, router.name) @@ -381,7 +381,7 @@ def test_redundancy_shortcut(): logger.info("Check Ping IPv4 from host to nhc2 via shortcut OK") # Now verify shortcut is purged with lack of traffic - json_file = "{}/{}/nhrp_route.json".format(CWD, nhc1.name) + json_file = "{}/{}/nhrp_route_nhs1_down.json".format(CWD, nhc1.name) assertmsg = "No nhrp_route file found" assert os.path.isfile(json_file), assertmsg -- 2.39.5