Skip to content

Commit

Permalink
topotests: use the Role field when testing ospf6
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pguibert6WIND authored and fdumontet6WIND committed Dec 1, 2023
1 parent 87bf0d1 commit 6cc8244
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
7 changes: 1 addition & 6 deletions tests/topotests/ospf6_topo1/test_ospf6_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand All @@ -243,7 +242,6 @@ def test_ospfv3_routingTable():


def test_linux_ipv6_kernel_routingTable():

tgen = get_topogen()

if tgen.routers_have_failure():
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -365,7 +362,6 @@ def test_ospfv3_routingTable_write_multiplier():


def test_shutdown_check_stderr():

tgen = get_topogen()

if tgen.routers_have_failure():
Expand Down Expand Up @@ -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"])
Expand Down
3 changes: 1 addition & 2 deletions tests/topotests/ospf6_topo2/test_ospf6_topo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/ospf_topo1/test_ospf_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6cc8244

Please sign in to comment.