From 3f777fdd3b2d28a60854737f64315843a7e5a9a8 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Wed, 14 Jun 2023 15:19:15 +0200 Subject: [PATCH] topotests: log exabgp by default Log exabgp by default in /tmp/topotests///exabgp.log Level is DEBUG. Signed-off-by: Louis Scalbert --- tests/topotests/lib/topogen.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py index 6ddd223e25db..721982501dbb 100644 --- a/tests/topotests/lib/topogen.py +++ b/tests/topotests/lib/topogen.py @@ -1192,7 +1192,17 @@ def start(self, peer_dir, env_file=None): self.run("chmod a+x /etc/exabgp/*.py") self.run("chown -R exabgp:exabgp /etc/exabgp") - output = self.run(exacmd + " -e /etc/exabgp/exabgp.env /etc/exabgp/exabgp.cfg") + log_dir = os.path.join(self.logdir, self.name) + self.run("chmod 777 {}".format(log_dir)) + + log_file = os.path.join(log_dir, "exabgp.log") + + env_cmd = "env exabgp.log.level=DEBUG " + env_cmd += "exabgp.log.destination={} ".format(log_file) + + output = self.run( + env_cmd + exacmd + " -e /etc/exabgp/exabgp.env /etc/exabgp/exabgp.cfg " + ) if output is None or len(output) == 0: output = ""