From e396a4f0c66521ea87b4a3e4cacef81e3cf8fcb8 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 16 May 2023 16:46:35 -0400 Subject: [PATCH 1/2] tests: Clean up commands that do nothing Recently clear commands were added to the tests that do nothing because they are using the wrong way to input the command. Since these do nothing remove them: 2023-05-16 16:39:07,072.072 DEBUG: topolog.r0: Router(r0): cmd_status("['/bin/bash', '-c', 'clear ip ospf neighbor']", pre_cmd: "['/usr/bin/nsenter', '--mount=/proc/4157893/ns/mnt', '--net=/proc/4157893/ns/net', '--uts=/proc/4157893/ns/uts', '-F', '--wd=/tmp/topotests/ospf_basic_functionality.test_ospf_asbr_summary_topo1/r0']" use_pty: False kwargs: {'stdout': -1, 'stderr': -2, 'encoding': 'utf-8', 'shell': False, 'stdin': None, 'env': {'LANG': 'en_US.UTF-8', 'LS_COLO) 2023-05-16 16:39:07,120.120 WARNING: topolog.r0: Router(r0): proc failed: rc 1 pid 4161077 args: /usr/bin/nsenter --mount=/proc/4157893/ns/mnt --net=/proc/4157893/ns/net --uts=/proc/4157893/ns/uts -F --wd=/tmp/topotests/ospf_basic_functionality.test_ospf_asbr_summary_topo1/r0 /bin/bash -c clear ip ospf neighbor stdout: Usage: clear [options] Options: -T TERM use this instead of $TERM -V print curses-version -x do not try to clear scrollback stderr: *empty* Signed-off-by: Donald Sharp --- .../ospf_basic_functionality/test_ospf_asbr_summary_topo1.py | 4 ---- .../test_ospfv3_asbr_summary_topo1.py | 4 ---- 2 files changed, 8 deletions(-) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py index cf7d95b65a..0531e81d44 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py @@ -1579,10 +1579,6 @@ def test_ospf_type5_summary_tc45_p0(request): result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) - # clear neighbor state on both routers to avoid stale state - tgen.net["r0"].cmd("clear ip ospf neighbor") - tgen.net["r1"].cmd("clear ip ospf neighbor") - ospf_covergence = verify_ospf_neighbor(tgen, topo) assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_asbr_summary_topo1.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_asbr_summary_topo1.py index 8cc0ed6090..49c25ab8f6 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_asbr_summary_topo1.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_asbr_summary_topo1.py @@ -1428,10 +1428,6 @@ def ospfv3_type5_summary_tc45_p0(request): result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) - # restart interface state machine on both routers to avoid stale state - tgen.net["r0"].cmd("clear ipv6 ospf6 interface") - tgen.net["r1"].cmd("clear ipv6 ospf6 interface") - ospf_covergence = verify_ospf6_neighbor(tgen, topo) assert ospf_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf_covergence From 244d5d0a1644528a8bb7f1e7d96fe0f3479d0138 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 17 May 2023 07:56:27 -0400 Subject: [PATCH 2/2] tests: Change order of config files Our CI test system is configuring interfaces like this: int A router ospfX router-id Z.Y.M.Q On sufficiently loaded systems, the router-id might not be respected because the interface A neighbor might have come up by the time the router-id command is read in. This is a problem for our topotests in that the tests expect neighbors to be formed with certain router-id, but the FRR code has stored the new router-id but not accepted it's use since a neighbor relationship has formed. Modify the ci test system code to put the 'router ospfX' commands before the interface commands, thus forcing the router-id to be read in *before* any possibility that the neighbor can have come up. Also, I've filed issue #13452 to address the ordering of commands with regards to router-id in our ospf protocols. Once that is done this should be backed out, to return to a more natural ordering of commands. Signed-off-by: Donald Sharp --- tests/topotests/lib/topojson.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/topotests/lib/topojson.py b/tests/topotests/lib/topojson.py index 53e6945bee..ad6dddc76b 100644 --- a/tests/topotests/lib/topojson.py +++ b/tests/topotests/lib/topojson.py @@ -316,6 +316,7 @@ def build_config_from_json(tgen, topo=None, save_bkup=True): func_dict = OrderedDict( [ ("vrfs", create_vrf_cfg), + ("ospf", create_router_ospf), ("links", create_interfaces_cfg), ("static_routes", create_static_routes), ("prefix_lists", create_prefix_lists), @@ -325,7 +326,6 @@ def build_config_from_json(tgen, topo=None, save_bkup=True): ("igmp", create_igmp_config), ("mld", create_mld_config), ("bgp", create_router_bgp), - ("ospf", create_router_ospf), ] )