]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/py: minor cleaning
authorEric Leblond <eric@regit.org>
Tue, 19 Jun 2018 21:46:56 +0000 (23:46 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 20 Jun 2018 11:51:41 +0000 (13:51 +0200)
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>
tests/py/nft-test.py

index c02294ac545629f4afc1feb0f375d03b98c89aac..1c736be40a4143d13b57597e1f738a9959ccad39 100755 (executable)
@@ -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