]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Add `exit` stanzas to pre-generated config
authorDonald Sharp <sharpd@nvidia.com>
Mon, 22 May 2023 12:25:38 +0000 (08:25 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 22 May 2023 14:52:54 +0000 (10:52 -0400)
A bunch of tests rely on pre-generated config from
json files.  These tests were not putting `exit` stanzas
and a bunch of the tests as a result are silently failing
to configure properly at all, as commands were being sent
to the wrong daemons.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests/topotests/lib/bgp.py
tests/topotests/lib/common_config.py
tests/topotests/lib/ospf.py

index c58da996d7bf88b21932c7e988c11fec19437216..0bd9408c28f58a72fe3ae13ab8ac7faffd28d9a9 100644 (file)
@@ -529,6 +529,7 @@ def __create_bgp_unicast_neighbor(
 
             config_data.extend(neigh_addr_data)
 
+    config_data.append("exit")
     logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
     return config_data
 
index 67afe8739f12d4d1b0a9187ab919a82c6c768851..a85b86668cb449454aba95636d91e1f1d081f9de 100644 (file)
@@ -2186,6 +2186,7 @@ def create_interfaces_cfg(tgen, topo, build=False):
                     interface_data += _create_interfaces_ospf_cfg(
                         "ospf6", c_data, data, ospf_keywords + ["area"]
                     )
+                interface_data.append("exit")
             if interface_data:
                 interface_data_dict[c_router] = interface_data
 
index ffe81fbd99cade52d8c6d6a36aca58a8cd5ac582..5486e904df74c453093874a0ebd7ec010723663e 100644 (file)
@@ -337,6 +337,7 @@ def __create_ospf_global(tgen, input_dict, router, build, load_config, ospf):
                 cmd = "no {}".format(cmd)
             config_data.append(cmd)
 
+    config_data.append("exit")
     logger.debug("Exiting lib API: create_ospf_global()")
 
     return config_data