diff options
author | Eric Leblond <eric@regit.org> | 2018-06-21 16:47:47 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-06-21 18:26:36 +0200 |
commit | b94e51f2d61657e1165ee64eccb3b237e624985d (patch) | |
tree | 43f77c8e01ff83b57372f55fd893e5850c10464a /tests | |
parent | b1b1237ca07b8f186ad6669e7f98a5d972373f48 (diff) |
tests/py: fix import when run from other directory
Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/py/nft-test.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index 1c736be4..e4367adc 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -19,11 +19,11 @@ import argparse import signal import json -sys.path.insert(0,'../../py/') +TESTS_PATH = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, os.path.join(TESTS_PATH, '../../py/')) from nftables import Nftables -TESTS_PATH = os.path.dirname(os.path.abspath(__file__)) TESTS_DIRECTORY = ["any", "arp", "bridge", "inet", "ip", "ip6"] LOGFILE = "/tmp/nftables-test.log" log_file = None |