diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-02-24 17:55:11 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-20 13:33:15 +0000 |
commit | 476c4bb7d13b0c092f78da76e858f882a4bacf76 (patch) | |
tree | 9a636c78ee19389900324fb223467ea4b2163e0c /openbsc/tests/vty_test_runner.py | |
parent | ca06e040cc115689fb10394cc566052576a638fc (diff) |
python tests: allow running from separate build dir
The VTY tests assume that $top_builddir == $top_srcdir. Use the script's
location from sys.path[0] to find the correct locations of example configs even
when building in another directory.
Change-Id: I2731f361e3b72d0980968e6cf83594ea450db7c2
Diffstat (limited to 'openbsc/tests/vty_test_runner.py')
-rw-r--r-- | openbsc/tests/vty_test_runner.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 87b9eba97..305c956d7 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -24,10 +24,13 @@ import subprocess import osmopy.obscvty as obscvty import osmopy.osmoutil as osmoutil -sys.path.append("../contrib") +# add $top_srcdir/contrib to find ipa.py +sys.path.append(os.path.join(sys.path[0], '..', 'contrib')) + from ipa import IPA -confpath = '.' +# to be able to find $top_srcdir/doc/... +confpath = os.path.join(sys.path[0], '..') class TestVTYBase(unittest.TestCase): |