From: Paolo Abeni <pabeni@redhat.com>
To: Lukasz Majewski <lukma@denx.de>, netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>, Eric Dumazet <edumazet@google.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Tristram.Ha@microchip.com,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Ravi Gunasekaran <r-gunasekaran@ti.com>,
Simon Horman <horms@kernel.org>,
Nikita Zhandarovich <n.zhandarovich@fintech.ru>,
Murali Karicheri <m-karicheri2@ti.com>,
Jiri Pirko <jiri@resnulli.us>,
Dan Carpenter <dan.carpenter@linaro.org>,
Ziyang Xuan <william.xuanziyang@huawei.com>,
Shigeru Yoshida <syoshida@redhat.com>,
"Ricardo B. Marliere" <ricardo@marliere.net>,
linux-kernel@vger.kernel.org
Subject: Re: [net-next PATCH v5 2/4] test: hsr: Move common code to hsr_common.sh file
Date: Thu, 18 Apr 2024 10:41:36 +0200 [thread overview]
Message-ID: <90c5d1b6747d7699ebec50168672f1c435269e7f.camel@redhat.com> (raw)
In-Reply-To: <20240415124928.1263240-3-lukma@denx.de>
On Mon, 2024-04-15 at 14:49 +0200, Lukasz Majewski wrote:
> Some of the code already present in the hsr_ping.sh test program can be
> moved to a separate script file, so it can be reused by other HSR
> functionality (like HSR-SAN) tests.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> tools/testing/selftests/net/hsr/hsr_common.sh | 96 +++++++++++++++++++
> tools/testing/selftests/net/hsr/hsr_ping.sh | 93 +-----------------
> 2 files changed, 99 insertions(+), 90 deletions(-)
> create mode 100644 tools/testing/selftests/net/hsr/hsr_common.sh
>
> diff --git a/tools/testing/selftests/net/hsr/hsr_common.sh b/tools/testing/selftests/net/hsr/hsr_common.sh
> new file mode 100644
> index 000000000000..822165391573
> --- /dev/null
> +++ b/tools/testing/selftests/net/hsr/hsr_common.sh
> @@ -0,0 +1,96 @@
> +# SPDX-License-Identifier: GPL-2.0
> +# Common code for HSR testing scripts
> +
> +ret=0
> +ksft_skip=4
> +
> +sec=$(date +%s)
> +rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)
> +ns1="ns1-$rndh"
> +ns2="ns2-$rndh"
> +ns3="ns3-$rndh"
Since you are touching the initialization code, please move it to using
the lib.sh helpers. The above will become:
setup_ns ns1 ns2 ns3
> +
> +cleanup()
> +{
> + local netns
> + for netns in "$ns1" "$ns2" "$ns3" ;do
> + ip netns del $netns
> + done
> +}
And this:
cleanup_all_ns
Thanks,
Paolo
next prev parent reply other threads:[~2024-04-18 8:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 12:49 [net-next PATCH v5 0/4] net: hsr: Add support for HSR-SAN (RedBOX) Lukasz Majewski
2024-04-15 12:49 ` [net-next PATCH v5 1/4] net: hsr: Provide RedBox support (HSR-SAN) Lukasz Majewski
2024-04-16 10:21 ` Casper Andersson
2024-04-16 13:03 ` Lukasz Majewski
2024-04-18 13:35 ` Casper Andersson
2024-04-18 15:37 ` Lukasz Majewski
2024-04-19 9:01 ` Casper Andersson
2024-04-19 10:42 ` Lukasz Majewski
2024-04-19 13:49 ` Casper Andersson
2024-04-19 14:05 ` Lukasz Majewski
2024-04-29 9:32 ` Lukasz Majewski
2024-04-18 8:47 ` Paolo Abeni
2024-04-18 10:53 ` Lukasz Majewski
2024-04-19 10:31 ` Casper Andersson
2024-04-15 12:49 ` [net-next PATCH v5 2/4] test: hsr: Move common code to hsr_common.sh file Lukasz Majewski
2024-04-18 8:41 ` Paolo Abeni [this message]
2024-04-18 8:45 ` Paolo Abeni
2024-04-15 12:49 ` [net-next PATCH v5 3/4] test: hsr: Extract version agnostic information from ping command output Lukasz Majewski
2024-04-15 12:49 ` [net-next PATCH v5 4/4] test: hsr: Add test for HSR RedBOX (HSR-SAN) mode of operation Lukasz Majewski
2024-04-18 8:43 ` Paolo Abeni
2024-04-15 13:07 ` [net-next PATCH v5 0/4] net: hsr: Add support for HSR-SAN (RedBOX) Lukasz Majewski
2024-04-18 8:49 ` Paolo Abeni
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=90c5d1b6747d7699ebec50168672f1c435269e7f.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=Tristram.Ha@microchip.com \
--cc=andrew@lunn.ch \
--cc=bigeasy@linutronix.de \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukma@denx.de \
--cc=m-karicheri2@ti.com \
--cc=n.zhandarovich@fintech.ru \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=olteanv@gmail.com \
--cc=r-gunasekaran@ti.com \
--cc=ricardo@marliere.net \
--cc=syoshida@redhat.com \
--cc=william.xuanziyang@huawei.com \
/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).