]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Fix logging output directory for older tests
authorMartin Winter <mwinter@opensourcerouting.org>
Fri, 27 Nov 2020 02:16:55 +0000 (03:16 +0100)
committerMartin Winter <mwinter@opensourcerouting.org>
Fri, 27 Nov 2020 18:45:15 +0000 (19:45 +0100)
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
tests/topotests/lib/topotest.py

index 29471c00fcb12fa680304eb60da1b978eb1ebf0b..7047c52b187c7b8c9a455d8e937d74603582dd91 100644 (file)
@@ -1065,7 +1065,7 @@ class Router(Node):
         if self.logdir is None:
             cur_test = os.environ["PYTEST_CURRENT_TEST"]
             self.logdir = "/tmp/topotests/" + cur_test[
-                0 : cur_test.find(".py")
+                cur_test.find("/")+1 : cur_test.find(".py")
             ].replace("/", ".")
 
         # If the logdir is not created, then create it and set the
@@ -1380,6 +1380,7 @@ class Router(Node):
 
         # Starts actual daemons without init (ie restart)
         # cd to per node directory
+        self.cmd("install -d {}/{}".format(self.logdir, self.name))
         self.cmd("cd {}/{}".format(self.logdir, self.name))
         self.cmd("umask 000")