From: Jakub Kicinski <kuba@kernel.org>
To: Po-Hsu Lin <po-hsu.lin@canonical.com>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
netdev@vger.kernel.org, idosch@mellanox.com,
danieller@mellanox.com, petrm@mellanox.com, shuah@kernel.org,
pabeni@redhat.com, edumazet@google.com, davem@davemloft.net
Subject: Re: [PATCHv2] selftests: net: devlink_port_split.py: skip test if no suitable device available
Date: Fri, 10 Mar 2023 16:05:41 -0800 [thread overview]
Message-ID: <20230310160541.5ec7722a@kernel.org> (raw)
In-Reply-To: <20230307150030.527726-1-po-hsu.lin@canonical.com>
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"
> + sys.exit(KSFT_SKIP)
>
next prev parent reply other threads:[~2023-03-11 0:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 15:00 [PATCHv2] selftests: net: devlink_port_split.py: skip test if no suitable device available Po-Hsu Lin
2023-03-08 1:02 ` Jakub Kicinski
2023-03-08 10:02 ` Po-Hsu Lin
2023-03-08 9:31 ` Jiri Pirko
2023-03-08 10:21 ` Po-Hsu Lin
2023-03-08 11:41 ` Jiri Pirko
2023-03-08 14:37 ` Po-Hsu Lin
2023-03-08 18:24 ` Jiri Pirko
2023-03-09 15:44 ` Po-Hsu Lin
2023-03-10 8:32 ` Jiri Pirko
2023-03-11 0:05 ` Jakub Kicinski [this message]
2023-03-15 9:11 ` Po-Hsu Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230310160541.5ec7722a@kernel.org \
--to=kuba@kernel.org \
--cc=danieller@mellanox.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@mellanox.com \
--cc=po-hsu.lin@canonical.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).