]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: properly locate files in builddir
authorDavid Lamparter <equinox@diac24.net>
Sat, 18 Aug 2018 03:00:54 +0000 (05:00 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sat, 8 Sep 2018 19:30:19 +0000 (21:30 +0200)
test_cli.refout is written by configure into the build directory, thus
we need a little special glue to find it correctly.

Signed-off-by: David Lamparter <equinox@diac24.net>
tests/helpers/python/frrtest.py
tests/lib/cli/test_cli.py

index da9e447fc0a78929d6672f5cce701ddf2172bd16..60bee5c88c710a458cb02b8f81184e9a2beaf0e7 100644 (file)
@@ -176,8 +176,14 @@ class TestRefOut(object):
         basedir = os.path.dirname(inspect.getsourcefile(type(self)))
         program = os.path.join(basedir, self.program)
 
-        refin = program + '.in'
-        refout = program + '.refout'
+        if getattr(self, 'built_refin', False):
+            refin = binpath(program) + '.in'
+        else:
+            refin = program + '.in'
+        if getattr(self, 'built_refout', False):
+            refout = binpath(program) + '.refout'
+        else:
+            refout = program + '.refout'
 
         intext = ''
         if os.path.exists(refin):
index e3c31c2d91fb4d78b8b97d165c63081b3b7fcf56..7371db283ac3a3d3a2bd7aae01d287044e54f349 100644 (file)
@@ -2,3 +2,4 @@ import frrtest
 
 class TestCli(frrtest.TestRefOut):
     program = './test_cli'
+    built_refout = True