From: Hangbin Liu <liuhangbin@gmail.com>
To: Petr Machata <petrm@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, Ido Schimmel <idosch@nvidia.com>,
Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, mlxsw@nvidia.com,
Benjamin Poirier <bpoirier@nvidia.com>
Subject: Re: [PATCH net-next 02/10] selftests: forwarding: lib.sh: Validate NETIFS
Date: Mon, 15 Apr 2024 15:47:21 +0800 [thread overview]
Message-ID: <ZhzbidOT7t27Zdmu@Laptop-X1> (raw)
In-Reply-To: <4a7602678782a1f526bdcc895de437bebc96a695.1712940759.git.petrm@nvidia.com>
On Fri, Apr 12, 2024 at 07:03:05PM +0200, Petr Machata wrote:
> The variable should contain at least NUM_NETIFS interfaces, stored
> as keys named "p$i", for i in `seq $NUM_NETIFS`.
>
> Signed-off-by: Petr Machata <petrm@nvidia.com>
> Reviewed-by: Benjamin Poirier <bpoirier@nvidia.com>
> ---
> tools/testing/selftests/net/forwarding/lib.sh | 22 ++++++++++++++-----
> 1 file changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
> index 658e4e7bf4b9..3cbbc2fd4d7d 100644
> --- a/tools/testing/selftests/net/forwarding/lib.sh
> +++ b/tools/testing/selftests/net/forwarding/lib.sh
> @@ -273,11 +273,6 @@ if [[ "$REQUIRE_MTOOLS" = "yes" ]]; then
> require_command mreceive
> fi
>
> -if [[ ! -v NUM_NETIFS ]]; then
> - echo "SKIP: importer does not define \"NUM_NETIFS\""
> - exit $ksft_skip
> -fi
> -
> ##############################################################################
> # Command line options handling
>
> @@ -296,6 +291,23 @@ done
> ##############################################################################
> # Network interfaces configuration
>
> +if [[ ! -v NUM_NETIFS ]]; then
> + echo "SKIP: importer does not define \"NUM_NETIFS\""
> + exit $ksft_skip
> +fi
> +
> +if (( NUM_NETIFS > ${#NETIFS[@]} )); then
> + echo "SKIP: Importer requires $NUM_NETIFS NETIFS, but only ${#NETIFS[@]} are defined (${NETIFS[@]})"
> + exit $ksft_skip
> +fi
> +
> +for i in $(seq ${#NETIFS[@]}); do
> + if [[ ! ${NETIFS[p$i]} ]]; then
> + echo "SKIP: NETIFS[p$i] not given"
> + exit $ksft_skip
> + fi
> +done
> +
> create_netif_veth()
> {
> local i
> --
> 2.43.0
>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
next prev parent reply other threads:[~2024-04-15 7:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 17:03 [PATCH net-next 00/10] selftests: Assortment of fixes Petr Machata
2024-04-12 17:03 ` [PATCH net-next 01/10] selftests: net: Unify code of busywait() and slowwait() Petr Machata
2024-04-15 7:21 ` Hangbin Liu
2024-04-12 17:03 ` [PATCH net-next 02/10] selftests: forwarding: lib.sh: Validate NETIFS Petr Machata
2024-04-15 7:47 ` Hangbin Liu [this message]
2024-04-12 17:03 ` [PATCH net-next 03/10] selftests: forwarding: bail_on_lldpad() should SKIP Petr Machata
2024-04-15 7:46 ` Hangbin Liu
2024-04-12 17:03 ` [PATCH net-next 04/10] selftests: drivers: hw: Fix ethtool_rmon Petr Machata
2024-04-12 17:03 ` [PATCH net-next 05/10] selftests: drivers: hw: ethtool.sh: Adjust output Petr Machata
2024-04-12 17:03 ` [PATCH net-next 06/10] selftests: drivers: hw: Include tc_common.sh in hw_stats_l3 Petr Machata
2024-04-12 17:03 ` [PATCH net-next 07/10] selftests: mlxsw: ethtool_lanes: Wait for lanes parameter dump explicitly Petr Machata
2024-04-12 17:03 ` [PATCH net-next 08/10] selftests: forwarding: router_mpath_nh: Add a diagram Petr Machata
2024-04-15 8:28 ` Hangbin Liu
2024-04-15 12:39 ` David Ahern
2024-04-12 17:03 ` [PATCH net-next 09/10] selftests: forwarding: router_mpath_nh_res: " Petr Machata
2024-04-15 8:31 ` Hangbin Liu
2024-04-12 17:03 ` [PATCH net-next 10/10] selftests: forwarding: router_nh: " Petr Machata
2024-04-15 8:31 ` Hangbin Liu
2024-04-16 10:20 ` [PATCH net-next 00/10] selftests: Assortment of fixes patchwork-bot+netdevbpf
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=ZhzbidOT7t27Zdmu@Laptop-X1 \
--to=liuhangbin@gmail.com \
--cc=bpoirier@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.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