summaryrefslogtreecommitdiffstats
path: root/iptables-test.py
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-09-14 02:34:36 +0200
committerPhil Sutter <phil@nwl.cc>2019-09-15 13:48:25 +0200
commit1b5d762c1865e425ee22a7453bdb62bd5154fee7 (patch)
treec8fb53c02122c93317cb2e2f87f48a4fafae9c40 /iptables-test.py
parente1ccd979e6849748578fad76475c688bdd16df0d (diff)
iptables-test: Support testing host binaries
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>
Diffstat (limited to 'iptables-test.py')
-rwxr-xr-xiptables-test.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/iptables-test.py b/iptables-test.py
index dc5f0ead..2aac8ef2 100755
--- a/iptables-test.py
+++ b/iptables-test.py
@@ -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