From a1b8727ccd40f78481100d2bfe3d60f53b8d4029 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 INFO. Note that in case the configuration syntax is invalid, exabgp does not log into the file and exits at startup. You can check a configuration syntax by running: > exabgp 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 f58a6668b6..a0ef752f91 100644 --- a/tests/topotests/lib/topogen.py +++ b/tests/topotests/lib/topogen.py @@ -1210,7 +1210,17 @@ class TopoExaBGP(TopoHost): 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=INFO " + 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 = "" -- 2.39.5