From: Renato Westphal Date: Mon, 31 May 2021 13:27:51 +0000 (-0300) Subject: tests: add "save_config" parameter to kill_router_daemons() X-Git-Tag: base_8.1~332^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5957a1a11ff748f357bd87ab401f228ea0f36391;p=matthieu%2Ffrr.git tests: add "save_config" parameter to kill_router_daemons() 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 --- diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index 9e38608631..2230fd756f 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -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)