summaryrefslogtreecommitdiffstats
path: root/xlate-test.py
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-04-28 00:26:27 +0200
committerFlorian Westphal <fw@strlen.de>2018-05-04 23:24:00 +0200
commite9aeecf5956462f3a1b6cb21ea70280845948325 (patch)
treee0cac2bcfc4c002267c109dc1520d1192bf83779 /xlate-test.py
parent0ab58e397ca613a1996cb9767e221f71e752812e (diff)
xlate-test: use locally installed xlate tools
same as iptables-test: use the translate tools in the current working directory, not the system-wide ones. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'xlate-test.py')
-rwxr-xr-xxlate-test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlate-test.py b/xlate-test.py
index 0b371dfd..803c5b7a 100755
--- a/xlate-test.py
+++ b/xlate-test.py
@@ -40,7 +40,7 @@ def run_test(name, payload):
for line in payload:
if line.startswith(keywords):
tests += 1
- process = Popen(shlex.split(line), stdout=PIPE, stderr=PIPE)
+ process = Popen([ os.path.abspath(os.path.curdir) + "/iptables/xtables-compat-multi" ] + shlex.split(line), stdout=PIPE, stderr=PIPE)
(output, error) = process.communicate()
if process.returncode == 0:
translation = output.decode("utf-8").rstrip(" \n")
@@ -86,6 +86,8 @@ def load_test_files():
print("%d test files, %d tests, %d tests passed, %d tests failed, %d errors" % (test_files, total_tests, total_passed, total_failed, total_error))
def main():
+ os.putenv("XTABLES_LIBDIR", os.path.abspath("extensions"))
+ os.putenv("PATH", "%s/iptables:%s" % (os.path.abspath(os.path.curdir), os.getenv("PATH")))
if args.test:
if not args.test.endswith(".txlate"):
args.test += ".txlate"