Re: [PATCH nft v8]tests: py: add netns feature

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

 



On Tue, Jun 18, 2019 at 10:36 PM shekhar sharma <shekhar250198@xxxxxxxxx> wrote:
>
> Hi Eric!
> On Tue, Jun 18, 2019 at 8:17 PM Eric Garver <eric@xxxxxxxxxxx> wrote:
> >
> > On Mon, Jun 17, 2019 at 07:45:58PM +0530, Shekhar Sharma wrote:
> > > This patch adds the netns feature to the 'nft-test.py' file.
> > >
> > >
> > > Signed-off-by: Shekhar Sharma <shekhar250198@xxxxxxxxx>
> > > ---
> > > The version history of the patch is :
> > > v1: add the netns feature
> > > v2: use format() method to simplify print statements.
> > > v3: updated the shebang
> > > v4: resent the same with small changes
> > > v5&v6: resent with small changes
> > > v7: netns commands changed for passing the netns name via netns argument.
> > > v8: correct typo error
> > >
> > >  tests/py/nft-test.py | 140 +++++++++++++++++++++++++++++++------------
> > >  1 file changed, 101 insertions(+), 39 deletions(-)
> > >
> > > diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
> > > index 09d00dba..bf5e64c0 100755
> > > --- a/tests/py/nft-test.py
> > > +++ b/tests/py/nft-test.py
> > [..]
> > > @@ -1359,6 +1417,13 @@ def main():
> > >                          dest='enable_schema',
> > >                          help='verify json input/output against schema')
> > >
> > > +    parser.add_argument('-N', '--netns', action='store_true',
> > > +                        help='Test namespace path')
> >
> > AFAICS, this new option is not being used - it's not passed to
> > run_test_file() or other functions. Will that be done in a follow up
> > patch?
> >
>
> True. I just saw that '-N', '-V' are also not added in the lines below
> this as in
> debug_option= args.debug
> i need to add that as well and then use it in the functions.
> I think that will be covered in another patch.
>
> > > +
> > > +    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
> > [..]
> > > @@ -1434,18 +1499,15 @@ 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)
> > > +                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 "%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("{} error, {} warning".format(errors, warnings))
> > >
> >
> > Please drop this hunk. It was already addressed in your patch "[PATCH
> > nft v7 1/2]tests:py: conversion to  python3". As such this patch doesn't
> > apply on top of your previous patch.
>
I forgot to add the netns argument in one of the statements in the
previous version (as suggested by jones) so i corrected that in this.
Sorry i forgot to mention this in the last mail :-).



> Ok. Will re-post the patch with out this bit.
>
> Thanks!
> Shekhar



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux