From: Donald Sharp Date: Sat, 8 Mar 2025 03:19:01 +0000 (-0500) Subject: tests: Add tests for the new operational data added recently X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=0f6b8e53f2af9cd5330b2bfdceca4baad2f8999d;p=mirror%2Ffrr.git tests: Add tests for the new operational data added recently 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 --- diff --git a/tests/topotests/zebra_operational_data/test_zebra_operational.py b/tests/topotests/zebra_operational_data/test_zebra_operational.py index c4ab5be973..fccb442df7 100644 --- a/tests/topotests/zebra_operational_data/test_zebra_operational.py +++ b/tests/topotests/zebra_operational_data/test_zebra_operational.py @@ -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