]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables-test: Support testing host binaries
authorPhil Sutter <phil@nwl.cc>
Sat, 14 Sep 2019 00:34:36 +0000 (02:34 +0200)
committerPhil Sutter <phil@nwl.cc>
Sun, 15 Sep 2019 11:48:25 +0000 (13:48 +0200)
Introduce --host parameter to run the testsuite against host's binaries
instead of built ones.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Florian Westphal <fw@strlen.de>
iptables-test.py

index dc5f0ead2f0eb084f847326330b8012a6d7622c8..2aac8ef2256dc7b85c93bc4a4c0119d5f6a902bc 100755 (executable)
@@ -314,6 +314,8 @@ def main():
     parser.add_argument('filename', nargs='?',
                         metavar='path/to/file.t',
                         help='Run only this test')
+    parser.add_argument('-H', '--host', action='store_true',
+                        help='Run tests against installed binaries')
     parser.add_argument('-l', '--legacy', action='store_true',
                         help='Test iptables-legacy')
     parser.add_argument('-m', '--missing', action='store_true',
@@ -340,8 +342,10 @@ def main():
         print("You need to be root to run this, sorry")
         return
 
-    os.putenv("XTABLES_LIBDIR", os.path.abspath(EXTENSIONS_PATH))
-    os.putenv("PATH", "%s/iptables:%s" % (os.path.abspath(os.path.curdir), os.getenv("PATH")))
+    if not args.host:
+        os.putenv("XTABLES_LIBDIR", os.path.abspath(EXTENSIONS_PATH))
+        os.putenv("PATH", "%s/iptables:%s" % (os.path.abspath(os.path.curdir),
+                                              os.getenv("PATH")))
 
     test_files = 0
     tests = 0