Message ID | 20180621144747.24241-1-eric@regit.org |
---|---|
State | Accepted |
Delegated to: | Pablo Neira |
Headers | show |
Series | [nft] tests/py: fix import when run from other directory | expand |
Applied, thanks Eric. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index 1c736be..e4367ad 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
Signed-off-by: Eric Leblond <eric@regit.org> --- tests/py/nft-test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)