]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: fix nhc1 route check after nhs1 down
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 30 Aug 2024 12:08:51 +0000 (14:08 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Fri, 30 Aug 2024 14:24:52 +0000 (16:24 +0200)
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 <louis.scalbert@6wind.com>
tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json [new file with mode: 0644]
tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py

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 (file)
index 0000000..a8fd193
--- /dev/null
@@ -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
index 891a3cb8c37fc1623000fc0c7a2d63ca8ac99d25..441bd56adf6ee082d731d1b899e88bd34fe7ce32 100644 (file)
@@ -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