[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMy_GT8NkEMXFnZ73gLyfN3sxo3-Et6ScJLd80qh07zRuQdH=Q@mail.gmail.com>
Date: Wed, 15 Mar 2023 17:11:44 +0800
From: Po-Hsu Lin <po-hsu.lin@...onical.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
netdev@...r.kernel.org, idosch@...lanox.com,
danieller@...lanox.com, petrm@...lanox.com, shuah@...nel.org,
pabeni@...hat.com, edumazet@...gle.com, davem@...emloft.net
Subject: Re: [PATCHv2] selftests: net: devlink_port_split.py: skip test if no
suitable device available
On Sat, Mar 11, 2023 at 8:05 AM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Tue, 7 Mar 2023 23:00:30 +0800 Po-Hsu Lin wrote:
> > def main(cmdline=None):
> > + test_ran = False
>
> Could you move this variable init right before the
>
> for port in ports.if_names:
>
> line, and call it something like found_max_lanes ?
>
> > parser = make_parser()
> > args = parser.parse_args(cmdline)
> >
> > @@ -240,12 +264,9 @@ def main(cmdline=None):
> > stdout, stderr = run_command(cmd)
> > assert stderr == ""
> >
> > + validate_devlink_output(json.loads(stdout))
> > devs = json.loads(stdout)['dev']
> > - if devs:
> > - dev = list(devs.keys())[0]
> > - else:
> > - print("no devlink device was found, test skipped")
> > - sys.exit(KSFT_SKIP)
> > + dev = list(devs.keys())[0]
> >
> > cmd = "devlink dev show %s" % dev
> > stdout, stderr = run_command(cmd)
> > @@ -277,6 +298,11 @@ def main(cmdline=None):
> > split_splittable_port(port, lane, max_lanes, dev)
> >
> > lane //= 2
> > + test_ran = True
> > +
> > + if not test_ran:
> > + print("Test not started, no suitable device for the test")
>
> Then change the message to
>
> f"Test not started, no port of device {dev} reports max_lanes"
>
Sure,
will update this in V3
Thanks for the feedback!
> > + sys.exit(KSFT_SKIP)
> >
Powered by blists - more mailing lists