diff options
author | Eric Leblond <eric@regit.org> | 2018-06-19 23:46:56 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-06-20 13:51:41 +0200 |
commit | b1b1237ca07b8f186ad6669e7f98a5d972373f48 (patch) | |
tree | fbc7209bcd8323cd75dce9d34a3b289fd792571c | |
parent | ef72b8912df8d71e351a2b8ddaebea94beeb7628 (diff) |
tests/py: minor cleaning
Move import and use explicit parameter in object creation.
Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rwxr-xr-x | tests/py/nft-test.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index c02294ac..1c736be4 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -19,6 +19,10 @@ import argparse import signal import json +sys.path.insert(0,'../../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" @@ -1328,16 +1332,13 @@ def main(): # Change working directory to repository root os.chdir(TESTS_PATH + "/../..") - sys.path.append('py/') - from nftables import Nftables - if not os.path.exists('src/.libs/libnftables.so'): print "The nftables library does not exist. " \ "You need to build the project." return global nftables - nftables = Nftables('src/.libs/libnftables.so') + nftables = Nftables(sofile = 'src/.libs/libnftables.so') test_files = files_ok = run_total = 0 tests = passed = warnings = errors = 0 |