]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: add "save_config" parameter to kill_router_daemons()
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 5 Jul 2021 14:43:02 +0000 (11:43 -0300)
Using "write memory" to save the daemons' configurations before
restarting them can cause log files to stop working correctly. Add
a new "save_config" to the kill_router_daemons() function to prevent
that from happening when saving the configurations isn't necessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
tests/topotests/lib/common_config.py

index 9e38608631597f0cec893a312a3a1e71b3951b64..2230fd756f8fa857e9999b2cbb524cb51849a767 100644 (file)
@@ -365,7 +365,7 @@ def create_common_configuration(
     return True
 
 
-def kill_router_daemons(tgen, router, daemons):
+def kill_router_daemons(tgen, router, daemons, save_config=True):
     """
     Router's current config would be saved to /etc/frr/ for each daemon
     and daemon would be killed forcefully using SIGKILL.
@@ -379,9 +379,10 @@ def kill_router_daemons(tgen, router, daemons):
     try:
         router_list = tgen.routers()
 
-        # Saving router config to /etc/frr, which will be loaded to router
-        # when it starts
-        router_list[router].vtysh_cmd("write memory")
+        if save_config:
+            # Saving router config to /etc/frr, which will be loaded to router
+            # when it starts
+            router_list[router].vtysh_cmd("write memory")
 
         # Kill Daemons
         result = router_list[router].killDaemons(daemons)