From 2159152d9fc9148f9ecf861539b090f6461bf2d2 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Mon, 2 Dec 2019 23:23:16 +0100 Subject: [PATCH] topojson: use empty vtysh.conf for frr-reload.py Signed-off-by: David Lamparter --- tests/topotests/lib/common_config.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index 9f2fef52ea..fc7581b1f2 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -28,6 +28,7 @@ from subprocess import PIPE as SUB_PIPE from subprocess import Popen from functools import wraps from re import search as re_search +from tempfile import mkdtemp import StringIO import os @@ -276,11 +277,19 @@ def reset_config_on_routers(tgen, routerName=None): run_cfg_file = "{}/{}/frr.sav".format(TMPDIR, rname) init_cfg_file = "{}/{}/frr_json_initial.conf".format(TMPDIR, rname) - command = "/usr/lib/frr/frr-reload.py --input {} --test {} > {}". \ - format(run_cfg_file, init_cfg_file, dname) + + tempdir = mkdtemp() + with open(os.path.join(tempdir, 'vtysh.conf'), 'w') as fd: + pass + + command = "/usr/lib/frr/frr-reload.py --confdir {} --input {} --test {} > {}". \ + format(tempdir, run_cfg_file, init_cfg_file, dname) result = call(command, shell=True, stderr=SUB_STDOUT, stdout=SUB_PIPE) + os.unlink(os.path.join(tempdir, 'vtysh.conf')) + os.rmdir(tempdir) + # Assert if command fail if result > 0: logger.error("Delta file creation failed. Command executed %s", -- 2.39.5