All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nft v7 1/2]tests:py: conversion to  python3
@ 2019-06-14 14:31 Shekhar Sharma
  2019-06-18 14:31 ` Eric Garver
  0 siblings, 1 reply; 11+ messages in thread
From: Shekhar Sharma @ 2019-06-14 14:31 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Shekhar Sharma

This patch converts the 'nft-test.py' file to run on both python 2 and python3.

Signed-off-by: Shekhar Sharma <shekhar250198@gmail.com>
---
The version hystory of this patch is:
v1:conversion to py3 by changing the print statements.
v2:add the '__future__' package for compatibility with py2 and py3.
v3:solves the 'version' problem in argparse by adding a new argument.
v4:uses .format() method to make print statements clearer.
v5:updated the shebang and corrected the sequence of import statements.
v6:resent the same with small changes
v7:resent with small changes

 tests/py/nft-test.py | 44 +++++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 09d00dba..f80517e6 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
 #
 # (C) 2014 by Ana Rey Botello <anarey@gmail.com>
 #
@@ -13,6 +13,7 @@
 # Thanks to the Outreach Program for Women (OPW) for sponsoring this test
 # infrastructure.
 
+from __future__ import print_function
 import sys
 import os
 import argparse
@@ -1016,9 +1017,9 @@ def execute_cmd(cmd, filename, lineno, stdout_log=False, debug=False):
     :param debug: temporarily set these debug flags
     '''
     global log_file
-    print >> log_file, "command: %s" % cmd
+    print("command: {}".format(cmd), file=log_file)
     if debug_option:
-        print cmd
+        print(cmd)
 
     if debug:
         debug_old = nftables.get_debug()
@@ -1212,7 +1213,7 @@ def run_test_file(filename, force_all_family_option, specific_file):
         sys.stdout.flush()
 
         if signal_received == 1:
-            print "\nSignal received. Cleaning up and Exitting..."
+            print("\nSignal received. Cleaning up and Exitting...")
             cleanup_on_exit()
             sys.exit(0)
 
@@ -1319,13 +1320,13 @@ def run_test_file(filename, force_all_family_option, specific_file):
 
     if specific_file:
         if force_all_family_option:
-            print print_result_all(filename, tests, total_warning, total_error,
-                                   total_unit_run)
+            print(print_result_all(filename, tests, total_warning, total_error,
+                                   total_unit_run))
         else:
-            print print_result(filename, tests, total_warning, total_error)
+            print(print_result(filename, tests, total_warning, total_error))
     else:
         if tests == passed and tests > 0:
-            print filename + ": " + Colors.GREEN + "OK" + Colors.ENDC
+            print(filename + ": " + Colors.GREEN + "OK" + Colors.ENDC)
 
     f.close()
     del table_list[:]
@@ -1336,7 +1337,7 @@ def run_test_file(filename, force_all_family_option, specific_file):
 
 
 def main():
-    parser = argparse.ArgumentParser(description='Run nft tests', version='1.0')
+    parser = argparse.ArgumentParser(description='Run nft tests')
 
     parser.add_argument('filenames', nargs='*', metavar='path/to/file.t',
                         help='Run only these tests')
@@ -1359,6 +1360,10 @@ def main():
                         dest='enable_schema',
                         help='verify json input/output against schema')
 
+    parser.add_argument('-v', '--version', action='version',
+                        version='1.0',
+                        help='Print the version information')
+
     args = parser.parse_args()
     global debug_option, need_fix_option, enable_json_option, enable_json_schema
     debug_option = args.debug
@@ -1372,15 +1377,15 @@ def main():
     signal.signal(signal.SIGTERM, signal_handler)
 
     if os.getuid() != 0:
-        print "You need to be root to run this, sorry"
+        print("You need to be root to run this, sorry")
         return
 
     # Change working directory to repository root
     os.chdir(TESTS_PATH + "/../..")
 
     if not os.path.exists('src/.libs/libnftables.so'):
-        print "The nftables library does not exist. " \
-              "You need to build the project."
+        print("The nftables library does not exist. "
+              "You need to build the project.")
         return
 
     if args.enable_schema and not args.enable_json:
@@ -1434,19 +1439,16 @@ def main():
             run_total += file_unit_run
 
     if test_files == 0:
-        print "No test files to run"
+        print("No test files to run")
     else:
         if not specific_file:
             if force_all_family_option:
-                print "%d test files, %d files passed, %d unit tests, " \
-                      "%d total executed, %d error, %d warning" \
-                      % (test_files, files_ok, tests, run_total, errors,
-                         warnings)
-            else:
-                print "%d test files, %d files passed, %d unit tests, " \
-                      "%d error, %d warning" \
-                      % (test_files, files_ok, tests, errors, warnings)
+                print("{} test files, {} files passed, {} unit tests, ".format(test_files,files_ok,tests))
+                print("{} total executed, {} error, {} warning".format(run_total, errors, warnings))
 
+            else:
+                print("{} test files, {} files passed, {} unit tests, ".format(test_files,files_ok,tests))
+                print("{} error, {} warning".format(errors, warnings))
 
 if __name__ == '__main__':
     main()
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH nft v7 1/2]tests:py: conversion to  python3
  2019-06-14 14:31 [PATCH nft v7 1/2]tests:py: conversion to python3 Shekhar Sharma
@ 2019-06-18 14:31 ` Eric Garver
  2019-06-18 16:16   ` Pablo Neira Ayuso
  2019-06-18 17:12   ` [PATCH nft v7 1/2]tests:py: conversion to python3 shekhar sharma
  0 siblings, 2 replies; 11+ messages in thread
From: Eric Garver @ 2019-06-18 14:31 UTC (permalink / raw)
  To: Shekhar Sharma; +Cc: netfilter-devel

On Fri, Jun 14, 2019 at 08:01:44PM +0530, Shekhar Sharma wrote:
> This patch converts the 'nft-test.py' file to run on both python 2 and python3.
> 
> Signed-off-by: Shekhar Sharma <shekhar250198@gmail.com>
> ---
> The version hystory of this patch is:
> v1:conversion to py3 by changing the print statements.
> v2:add the '__future__' package for compatibility with py2 and py3.
> v3:solves the 'version' problem in argparse by adding a new argument.
> v4:uses .format() method to make print statements clearer.
> v5:updated the shebang and corrected the sequence of import statements.
> v6:resent the same with small changes
> v7:resent with small changes

"with small changes" is not helpful. In the future please list what was
actually changed so reviewers know what to focus on.

Patch looks good though.

Acked-by: Eric Garver <eric@garver.life>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH nft v7 1/2]tests:py: conversion to  python3
  2019-06-18 14:31 ` Eric Garver
@ 2019-06-18 16:16   ` Pablo Neira Ayuso
  2019-06-18 17:29     ` shekhar sharma
  2019-06-18 17:12   ` [PATCH nft v7 1/2]tests:py: conversion to python3 shekhar sharma
  1 sibling, 1 reply; 11+ messages in thread
From: Pablo Neira Ayuso @ 2019-06-18 16:16 UTC (permalink / raw)
  To: Eric Garver, Shekhar Sharma, netfilter-devel

On Tue, Jun 18, 2019 at 10:31:06AM -0400, Eric Garver wrote:
> On Fri, Jun 14, 2019 at 08:01:44PM +0530, Shekhar Sharma wrote:
> > This patch converts the 'nft-test.py' file to run on both python 2 and python3.
> > 
> > Signed-off-by: Shekhar Sharma <shekhar250198@gmail.com>
> > ---
> > The version hystory of this patch is:
> > v1:conversion to py3 by changing the print statements.
> > v2:add the '__future__' package for compatibility with py2 and py3.
> > v3:solves the 'version' problem in argparse by adding a new argument.
> > v4:uses .format() method to make print statements clearer.
> > v5:updated the shebang and corrected the sequence of import statements.
> > v6:resent the same with small changes
> > v7:resent with small changes

I apply this patch, then, from the nftables/tests/py/ folder I run:

# python3 nft-test.py

I get:

INFO: Log will be available at /tmp/nftables-test.log
Traceback (most recent call last):
  File "nft-test.py", line 1454, in <module>
    main()
  File "nft-test.py", line 1422, in main
    result = run_test_file(filename, force_all_family_option, specific_file)
  File "nft-test.py", line 1290, in run_test_file
    filename_path)
  File "nft-test.py", line 774, in rule_add
    payload_log = os.tmpfile()
AttributeError: module 'os' has no attribute 'tmpfile'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH nft v7 1/2]tests:py: conversion to python3
  2019-06-18 14:31 ` Eric Garver
  2019-06-18 16:16   ` Pablo Neira Ayuso
@ 2019-06-18 17:12   ` shekhar sharma
  1 sibling, 0 replies; 11+ messages in thread
From: shekhar sharma @ 2019-06-18 17:12 UTC (permalink / raw)
  To: Eric Garver, Shekhar Sharma, Netfilter Development Mailing list

On Tue, Jun 18, 2019 at 8:01 PM Eric Garver <eric@garver.life> wrote:
>
> On Fri, Jun 14, 2019 at 08:01:44PM +0530, Shekhar Sharma wrote:
> > This patch converts the 'nft-test.py' file to run on both python 2 and python3.
> >
> > Signed-off-by: Shekhar Sharma <shekhar250198@gmail.com>
> > ---
> > The version hystory of this patch is:
> > v1:conversion to py3 by changing the print statements.
> > v2:add the '__future__' package for compatibility with py2 and py3.
> > v3:solves the 'version' problem in argparse by adding a new argument.
> > v4:uses .format() method to make print statements clearer.
> > v5:updated the shebang and corrected the sequence of import statements.
> > v6:resent the same with small changes
> > v7:resent with small changes
>
> "with small changes" is not helpful. In the future please list what was
> actually changed so reviewers know what to focus on.
>
Sorry, will be more specific next time. :-)

> Patch looks good though.
>
> Acked-by: Eric Garver <eric@garver.life>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH nft v7 1/2]tests:py: conversion to python3
  2019-06-18 16:16   ` Pablo Neira Ayuso
@ 2019-06-18 17:29     ` shekhar sharma
  2019-06-18 17:34       ` Pablo Neira Ayuso
  0 siblings, 1 reply; 11+ messages in thread
From: shekhar sharma @ 2019-06-18 17:29 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Eric Garver, Netfilter Development Mailing list

Hi Pablo!

On Tue, Jun 18, 2019 at 9:46 PM Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>
> On Tue, Jun 18, 2019 at 10:31:06AM -0400, Eric Garver wrote:
> > On Fri, Jun 14, 2019 at 08:01:44PM +0530, Shekhar Sharma wrote:
> > > This patch converts the 'nft-test.py' file to run on both python 2 and python3.
> > >
> > > Signed-off-by: Shekhar Sharma <shekhar250198@gmail.com>
> > > ---
> > > The version hystory of this patch is:
> > > v1:conversion to py3 by changing the print statements.
> > > v2:add the '__future__' package for compatibility with py2 and py3.
> > > v3:solves the 'version' problem in argparse by adding a new argument.
> > > v4:uses .format() method to make print statements clearer.
> > > v5:updated the shebang and corrected the sequence of import statements.
> > > v6:resent the same with small changes
> > > v7:resent with small changes
>
> I apply this patch, then, from the nftables/tests/py/ folder I run:
>
> # python3 nft-test.py
>
> I get:
>
> INFO: Log will be available at /tmp/nftables-test.log
> Traceback (most recent call last):
>   File "nft-test.py", line 1454, in <module>
>     main()
>   File "nft-test.py", line 1422, in main
>     result = run_test_file(filename, force_all_family_option, specific_file)
>   File "nft-test.py", line 1290, in run_test_file
>     filename_path)
>   File "nft-test.py", line 774, in rule_add
>     payload_log = os.tmpfile()
> AttributeError: module 'os' has no attribute 'tmpfile'

I do not know why this error is occurring but may i suggest
you to try the v8 of the netns patch, (as it is a continuation of this patch),
if that works, we will know that there is some problem in this patch
specifically.

Thanks!
Shekhar

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH nft v7 1/2]tests:py: conversion to python3
  2019-06-18 17:29     ` shekhar sharma
@ 2019-06-18 17:34       ` Pablo Neira Ayuso
  2019-06-18 17:36         ` shekhar sharma
  0 siblings, 1 reply; 11+ messages in thread
From: Pablo Neira Ayuso @ 2019-06-18 17:34 UTC (permalink / raw)
  To: shekhar sharma; +Cc: Eric Garver, Netfilter Development Mailing list

On Tue, Jun 18, 2019 at 10:59:53PM +0530, shekhar sharma wrote:
> Hi Pablo!
> 
> On Tue, Jun 18, 2019 at 9:46 PM Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> >
> > On Tue, Jun 18, 2019 at 10:31:06AM -0400, Eric Garver wrote:
> > > On Fri, Jun 14, 2019 at 08:01:44PM +0530, Shekhar Sharma wrote:
> > > > This patch converts the 'nft-test.py' file to run on both python 2 and python3.
> > > >
> > > > Signed-off-by: Shekhar Sharma <shekhar250198@gmail.com>
> > > > ---
> > > > The version hystory of this patch is:
> > > > v1:conversion to py3 by changing the print statements.
> > > > v2:add the '__future__' package for compatibility with py2 and py3.
> > > > v3:solves the 'version' problem in argparse by adding a new argument.
> > > > v4:uses .format() method to make print statements clearer.
> > > > v5:updated the shebang and corrected the sequence of import statements.
> > > > v6:resent the same with small changes
> > > > v7:resent with small changes
> >
> > I apply this patch, then, from the nftables/tests/py/ folder I run:
> >
> > # python3 nft-test.py
> >
> > I get:
> >
> > INFO: Log will be available at /tmp/nftables-test.log
> > Traceback (most recent call last):
> >   File "nft-test.py", line 1454, in <module>
> >     main()
> >   File "nft-test.py", line 1422, in main
> >     result = run_test_file(filename, force_all_family_option, specific_file)
> >   File "nft-test.py", line 1290, in run_test_file
> >     filename_path)
> >   File "nft-test.py", line 774, in rule_add
> >     payload_log = os.tmpfile()
> > AttributeError: module 'os' has no attribute 'tmpfile'
> 
> I do not know why this error is occurring but may i suggest
> you to try the v8 of the netns patch, (as it is a continuation of this patch),
> if that works, we will know that there is some problem in this patch
> specifically.

Still the same problem with v8:

    Date:   Mon Jun 17 19:45:58 2019 +0530

    tests: py: add netns feature

    This patch adds the netns feature to the 'nft-test.py' file.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH nft v7 1/2]tests:py: conversion to python3
  2019-06-18 17:34       ` Pablo Neira Ayuso
@ 2019-06-18 17:36         ` shekhar sharma
  2019-06-18 18:21           ` [PATCH nft] nft-test.py: use tempfile module Eric Garver
  0 siblings, 1 reply; 11+ messages in thread
From: shekhar sharma @ 2019-06-18 17:36 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Eric Garver, Netfilter Development Mailing list

On Tue, Jun 18, 2019 at 11:04 PM Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>
> On Tue, Jun 18, 2019 at 10:59:53PM +0530, shekhar sharma wrote:
> > Hi Pablo!
> >
> > On Tue, Jun 18, 2019 at 9:46 PM Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > >
> > > On Tue, Jun 18, 2019 at 10:31:06AM -0400, Eric Garver wrote:
> > > > On Fri, Jun 14, 2019 at 08:01:44PM +0530, Shekhar Sharma wrote:
> > > > > This patch converts the 'nft-test.py' file to run on both python 2 and python3.
> > > > >
> > > > > Signed-off-by: Shekhar Sharma <shekhar250198@gmail.com>
> > > > > ---
> > > > > The version hystory of this patch is:
> > > > > v1:conversion to py3 by changing the print statements.
> > > > > v2:add the '__future__' package for compatibility with py2 and py3.
> > > > > v3:solves the 'version' problem in argparse by adding a new argument.
> > > > > v4:uses .format() method to make print statements clearer.
> > > > > v5:updated the shebang and corrected the sequence of import statements.
> > > > > v6:resent the same with small changes
> > > > > v7:resent with small changes
> > >
> > > I apply this patch, then, from the nftables/tests/py/ folder I run:
> > >
> > > # python3 nft-test.py
> > >
> > > I get:
> > >
> > > INFO: Log will be available at /tmp/nftables-test.log
> > > Traceback (most recent call last):
> > >   File "nft-test.py", line 1454, in <module>
> > >     main()
> > >   File "nft-test.py", line 1422, in main
> > >     result = run_test_file(filename, force_all_family_option, specific_file)
> > >   File "nft-test.py", line 1290, in run_test_file
> > >     filename_path)
> > >   File "nft-test.py", line 774, in rule_add
> > >     payload_log = os.tmpfile()
> > > AttributeError: module 'os' has no attribute 'tmpfile'
> >
> > I do not know why this error is occurring but may i suggest
> > you to try the v8 of the netns patch, (as it is a continuation of this patch),
> > if that works, we will know that there is some problem in this patch
> > specifically.
>
> Still the same problem with v8:
>
>     Date:   Mon Jun 17 19:45:58 2019 +0530
>
>     tests: py: add netns feature
>
>     This patch adds the netns feature to the 'nft-test.py' file.

Ok. I am trying to find out why this is happening.

Shekhar

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH nft] nft-test.py: use tempfile module
  2019-06-18 17:36         ` shekhar sharma
@ 2019-06-18 18:21           ` Eric Garver
  2019-06-18 18:35             ` shekhar sharma
  2019-06-19 10:39             ` Pablo Neira Ayuso
  0 siblings, 2 replies; 11+ messages in thread
From: Eric Garver @ 2019-06-18 18:21 UTC (permalink / raw)
  To: Pablo Neira Ayuso, shekhar sharma; +Cc: netfilter-devel

os.tmpfile() is not in python3.
---
 tests/py/nft-test.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index f80517e67bfd..4da6fa650f6d 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -20,6 +20,7 @@ import argparse
 import signal
 import json
 import traceback
+import tempfile
 
 TESTS_PATH = os.path.dirname(os.path.abspath(__file__))
 sys.path.insert(0, os.path.join(TESTS_PATH, '../../py/'))
@@ -771,7 +772,7 @@ def rule_add(rule, filename, lineno, force_all_family_option, filename_path):
             unit_tests += 1
             table_flush(table, filename, lineno)
 
-            payload_log = os.tmpfile()
+            payload_log = tempfile.TemporaryFile(mode="w+")
 
             # Add rule and check return code
             cmd = "add rule %s %s %s" % (table, chain, rule[0])
@@ -911,7 +912,7 @@ def rule_add(rule, filename, lineno, force_all_family_option, filename_path):
                               gotf.name, 1)
 
             table_flush(table, filename, lineno)
-            payload_log = os.tmpfile()
+            payload_log = tempfile.TemporaryFile(mode="w+")
 
             # Add rule in JSON format
             cmd = json.dumps({ "nftables": [{ "add": { "rule": {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH nft] nft-test.py: use tempfile module
  2019-06-18 18:21           ` [PATCH nft] nft-test.py: use tempfile module Eric Garver
@ 2019-06-18 18:35             ` shekhar sharma
  2019-06-19 10:39             ` Pablo Neira Ayuso
  1 sibling, 0 replies; 11+ messages in thread
From: shekhar sharma @ 2019-06-18 18:35 UTC (permalink / raw)
  To: Eric Garver; +Cc: Pablo Neira Ayuso, Netfilter Development Mailing list

Hi Eric!

On Tue, Jun 18, 2019 at 11:51 PM Eric Garver <eric@garver.life> wrote:
>
> os.tmpfile() is not in python3.
>
Did not know that. It should resolve the problem. Thanks!

---
>  tests/py/nft-test.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
> index f80517e67bfd..4da6fa650f6d 100755
> --- a/tests/py/nft-test.py
> +++ b/tests/py/nft-test.py
> @@ -20,6 +20,7 @@ import argparse
>  import signal
>  import json
>  import traceback
> +import tempfile
>
>  TESTS_PATH = os.path.dirname(os.path.abspath(__file__))
>  sys.path.insert(0, os.path.join(TESTS_PATH, '../../py/'))
> @@ -771,7 +772,7 @@ def rule_add(rule, filename, lineno, force_all_family_option, filename_path):
>              unit_tests += 1
>              table_flush(table, filename, lineno)
>
> -            payload_log = os.tmpfile()
> +            payload_log = tempfile.TemporaryFile(mode="w+")
>
>              # Add rule and check return code
>              cmd = "add rule %s %s %s" % (table, chain, rule[0])
> @@ -911,7 +912,7 @@ def rule_add(rule, filename, lineno, force_all_family_option, filename_path):
>                                gotf.name, 1)
>
>              table_flush(table, filename, lineno)
> -            payload_log = os.tmpfile()
> +            payload_log = tempfile.TemporaryFile(mode="w+")
>
>              # Add rule in JSON format
>              cmd = json.dumps({ "nftables": [{ "add": { "rule": {
> --
> 2.20.1
>


Shekhar

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH nft] nft-test.py: use tempfile module
  2019-06-18 18:21           ` [PATCH nft] nft-test.py: use tempfile module Eric Garver
  2019-06-18 18:35             ` shekhar sharma
@ 2019-06-19 10:39             ` Pablo Neira Ayuso
  2019-06-19 12:52               ` Eric Garver
  1 sibling, 1 reply; 11+ messages in thread
From: Pablo Neira Ayuso @ 2019-06-19 10:39 UTC (permalink / raw)
  To: Eric Garver; +Cc: shekhar sharma, netfilter-devel

On Tue, Jun 18, 2019 at 02:21:27PM -0400, Eric Garver wrote:
> os.tmpfile() is not in python3.

If I apply:

https://patchwork.ozlabs.org/patch/1116034/

and this patch, it's getting better, but still I hit one problem:

# python3 nft-test.py
INFO: Log will be available at /tmp/nftables-test.log
any/fwd.t: OK
any/rt.t: OK
any/queue.t: OK
any/dup.t: OK
any/log.t: OK
Traceback (most recent call last):
  File "nft-test.py", line 1455, in <module>
    main()
  File "nft-test.py", line 1423, in main
    result = run_test_file(filename, force_all_family_option,
specific_file)
  File "nft-test.py", line 1291, in run_test_file
    filename_path)
  File "nft-test.py", line 846, in rule_add
    rule_output.rstrip()) != 0:
  File "nft-test.py", line 495, in set_check_element
    if (cmp(rule1[:pos1], rule2[:pos2]) != 0):
NameError: name 'cmp' is not defined

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH nft] nft-test.py: use tempfile module
  2019-06-19 10:39             ` Pablo Neira Ayuso
@ 2019-06-19 12:52               ` Eric Garver
  0 siblings, 0 replies; 11+ messages in thread
From: Eric Garver @ 2019-06-19 12:52 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: shekhar sharma, netfilter-devel

On Wed, Jun 19, 2019 at 12:39:44PM +0200, Pablo Neira Ayuso wrote:
> On Tue, Jun 18, 2019 at 02:21:27PM -0400, Eric Garver wrote:
> > os.tmpfile() is not in python3.
> 
> If I apply:
> 
> https://patchwork.ozlabs.org/patch/1116034/
> 
> and this patch, it's getting better, but still I hit one problem:
> 
> # python3 nft-test.py
> INFO: Log will be available at /tmp/nftables-test.log
> any/fwd.t: OK
> any/rt.t: OK
> any/queue.t: OK
> any/dup.t: OK
> any/log.t: OK
> Traceback (most recent call last):
>   File "nft-test.py", line 1455, in <module>
>     main()
>   File "nft-test.py", line 1423, in main
>     result = run_test_file(filename, force_all_family_option,
> specific_file)
>   File "nft-test.py", line 1291, in run_test_file
>     filename_path)
>   File "nft-test.py", line 846, in rule_add
>     rule_output.rstrip()) != 0:
>   File "nft-test.py", line 495, in set_check_element
>     if (cmp(rule1[:pos1], rule2[:pos2]) != 0):
> NameError: name 'cmp' is not defined

I will post a short series today to address this as well.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-06-19 12:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 14:31 [PATCH nft v7 1/2]tests:py: conversion to python3 Shekhar Sharma
2019-06-18 14:31 ` Eric Garver
2019-06-18 16:16   ` Pablo Neira Ayuso
2019-06-18 17:29     ` shekhar sharma
2019-06-18 17:34       ` Pablo Neira Ayuso
2019-06-18 17:36         ` shekhar sharma
2019-06-18 18:21           ` [PATCH nft] nft-test.py: use tempfile module Eric Garver
2019-06-18 18:35             ` shekhar sharma
2019-06-19 10:39             ` Pablo Neira Ayuso
2019-06-19 12:52               ` Eric Garver
2019-06-18 17:12   ` [PATCH nft v7 1/2]tests:py: conversion to python3 shekhar sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.