From 6cc8244350152e20c941c770f25b6830477f3c33 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Wed, 29 Nov 2023 14:28:08 +0100 Subject: [PATCH] topotests: use the Role field when testing ospf6 To handle the future change of naming in the ospf6 state, align the ospf6 tests with the new 'Role' nickname instead of the old 'state' value. Signed-off-by: Philippe Guibert --- tests/topotests/ospf6_topo1/test_ospf6_topo1.py | 7 +------ tests/topotests/ospf6_topo2/test_ospf6_topo2.py | 3 +-- tests/topotests/ospf_topo1/test_ospf_topo1.py | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/topotests/ospf6_topo1/test_ospf6_topo1.py b/tests/topotests/ospf6_topo1/test_ospf6_topo1.py index 5649757010c3..f4b5e721703f 100644 --- a/tests/topotests/ospf6_topo1/test_ospf6_topo1.py +++ b/tests/topotests/ospf6_topo1/test_ospf6_topo1.py @@ -174,7 +174,7 @@ def expect_neighbor_full(router, neighbor): topotest.router_json_cmp, tgen.gears[router], "show ipv6 ospf6 neighbor json", - {"neighbors": [{"neighborId": neighbor, "state": "Full"}]}, + {"neighbors": [{"neighborId": neighbor, "role": "Full"}]}, ) _, result = topotest.run_and_expect(test_func, None, count=130, wait=1) assertmsg = '"{}" convergence failure'.format(router) @@ -220,7 +220,6 @@ def compare_show_ipv6(rname, expected): def test_ospfv3_routingTable(): - tgen = get_topogen() if tgen.routers_have_failure(): pytest.skip("skipped because of router(s) failure") @@ -243,7 +242,6 @@ def test_ospfv3_routingTable(): def test_linux_ipv6_kernel_routingTable(): - tgen = get_topogen() if tgen.routers_have_failure(): @@ -335,7 +333,6 @@ def test_linux_ipv6_kernel_routingTable(): def test_ospfv3_routingTable_write_multiplier(): - tgen = get_topogen() if tgen.routers_have_failure(): pytest.skip("skipped because of router(s) failure") @@ -365,7 +362,6 @@ def test_ospfv3_routingTable_write_multiplier(): def test_shutdown_check_stderr(): - tgen = get_topogen() if tgen.routers_have_failure(): @@ -413,7 +409,6 @@ def test_shutdown_check_memleak(): if __name__ == "__main__": - # To suppress tracebacks, either use the following pytest call or # add "--tb=no" to cli # retval = pytest.main(["-s", "--tb=no"]) diff --git a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py index f95f7bbe5e8b..07624fcac4a8 100644 --- a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py +++ b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py @@ -129,7 +129,6 @@ def setup_module(mod): router_list = tgen.routers() for rname, router in router_list.items(): - daemon_file = "{}/{}/zebra.conf".format(CWD, rname) if os.path.isfile(daemon_file): router.load_config(TopoRouter.RD_ZEBRA, daemon_file) @@ -157,7 +156,7 @@ def expect_neighbor_full(router, neighbor): topotest.router_json_cmp, tgen.gears[router], "show ipv6 ospf6 neighbor json", - {"neighbors": [{"neighborId": neighbor, "state": "Full"}]}, + {"neighbors": [{"neighborId": neighbor, "role": "Full"}]}, ) _, result = topotest.run_and_expect(test_func, None, count=130, wait=1) assertmsg = '"{}" convergence failure'.format(router) diff --git a/tests/topotests/ospf_topo1/test_ospf_topo1.py b/tests/topotests/ospf_topo1/test_ospf_topo1.py index a079f5698ff1..53c31a4a6494 100644 --- a/tests/topotests/ospf_topo1/test_ospf_topo1.py +++ b/tests/topotests/ospf_topo1/test_ospf_topo1.py @@ -154,7 +154,7 @@ def expect_ospfv3_neighbor_full(router, neighbor): topotest.router_json_cmp, tgen.gears[router], "show ipv6 ospf6 neighbor json", - {"neighbors": [{"neighborId": neighbor, "state": "Full"}]}, + {"neighbors": [{"neighborId": neighbor, "Role": "Full"}]}, ) _, result = topotest.run_and_expect(test_func, None, count=130, wait=1) assertmsg = '"{}" convergence failure'.format(router)