[PATCH iptables] xlate-test: use locally installed xlate tools

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



same as iptables-test: use the translate tools in the current working
directory, not the system-wide ones.

Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
---
 xlate-test.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xlate-test.py b/xlate-test.py
index 0b371dfd8793..803c5b7a2ab4 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"
-- 
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux