]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: Add tests for the new operational data added recently
authorDonald Sharp <sharpd@nvidia.com>
Sat, 8 Mar 2025 03:19:01 +0000 (22:19 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Sat, 8 Mar 2025 03:24:42 +0000 (22:24 -0500)
ip-forwarding, ipv6-forwarding and mpls-forwarding were
not being looked at/tested for existence in the query
of frr.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests/topotests/zebra_operational_data/test_zebra_operational.py

index c4ab5be973385a749a7cf901ae87a31159f2fd30..fccb442df7eded00916e522e16a6993a0179b62d 100644 (file)
@@ -56,6 +56,17 @@ def test_zebra_operationalr(tgen):
     logger.info("Ensuring that the max-multipath value is returned")
     assert "max-multipath" in output["frr-zebra:zebra"].keys()
 
+    logger.info("Checking IP forwarding states")
+    state = output["frr-zebra:zebra"]["state"]
+    assert "ip-forwarding" in state.keys(), "IPv4 forwarding state not found"
+    assert "ipv6-forwarding" in state.keys(), "IPv6 forwarding state not found"
+    assert "mpls-forwarding" in state.keys(), "MPLS forwarding state not found"
+    
+    # Verify the values are boolean
+    assert isinstance(state["ip-forwarding"], bool), "IPv4 forwarding state should be boolean"
+    assert isinstance(state["ipv6-forwarding"], bool), "IPv6 forwarding state should be boolean"
+    assert isinstance(state["mpls-forwarding"], bool), "MPLS forwarding state should be boolean"
+
 
 if __name__ == "__main__":
     # To suppress tracebacks, either use the following pytest call or add "--tb=no" to cli