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@xxxxxxxxxxxxx> 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@xxxxxxxxx> > > > > --- > > > > 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.