From: Hangbin Liu <liuhangbin@gmail.com>
To: Geliang Tang <geliang@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Shuah Khan <shuah@kernel.org>,
Geliang Tang <tanggeliang@kylinos.cn>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net] selftests: hsr: Fix "File exists" errors for hsr_ping
Date: Wed, 22 May 2024 11:05:12 +0800 [thread overview]
Message-ID: <Zk1g6CRsvSids1Vs@Laptop-X1> (raw)
In-Reply-To: <db256340b909f8b6f8bb7f9e42dbe71c228993b6.1716280848.git.tanggeliang@kylinos.cn>
On Tue, May 21, 2024 at 04:49:44PM +0800, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> The hsr_ping test reports the following errors:
>
> INFO: preparing interfaces for HSRv0.
> INFO: Initial validation ping.
> INFO: Longer ping test.
> INFO: Cutting one link.
> INFO: Delay the link and drop a few packages.
> INFO: All good.
> INFO: preparing interfaces for HSRv1.
> RTNETLINK answers: File exists
> RTNETLINK answers: File exists
> RTNETLINK answers: File exists
> RTNETLINK answers: File exists
> RTNETLINK answers: File exists
> RTNETLINK answers: File exists
> Error: ipv4: Address already assigned.
> Error: ipv6: address already assigned.
> Error: ipv4: Address already assigned.
> Error: ipv6: address already assigned.
> Error: ipv4: Address already assigned.
> Error: ipv6: address already assigned.
> INFO: Initial validation ping.
>
> That is because the cleanup code for the 2nd round test before
> "setup_hsr_interfaces 1" is removed incorrectly in commit 680fda4f6714
> ("test: hsr: Remove script code already implemented in lib.sh").
>
> This patch fixes it by adding a new helper delete_hsr_interfaces() to
> delete all interfaces before "setup_hsr_interfaces 1".
>
> Fixes: 680fda4f6714 ("test: hsr: Remove script code already implemented in lib.sh")
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> tools/testing/selftests/net/hsr/hsr_ping.sh | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/tools/testing/selftests/net/hsr/hsr_ping.sh b/tools/testing/selftests/net/hsr/hsr_ping.sh
> index 790294c8af83..0be1d5f78dab 100755
> --- a/tools/testing/selftests/net/hsr/hsr_ping.sh
> +++ b/tools/testing/selftests/net/hsr/hsr_ping.sh
> @@ -166,6 +166,14 @@ setup_hsr_interfaces()
> ip -net "$ns3" link set hsr3 up
> }
>
> +delete_hsr_interfaces()
> +{
> + echo "INFO: delete interfaces."
> + ip -net "$ns1" link del ns1eth1
> + ip -net "$ns1" link del ns1eth2
> + ip -net "$ns3" link del ns3eth2
> +}
> +
> check_prerequisites
> setup_ns ns1 ns2 ns3
>
> @@ -174,6 +182,8 @@ trap cleanup_all_ns EXIT
> setup_hsr_interfaces 0
> do_complete_ping_test
>
> +delete_hsr_interfaces
> +
nit: you can also just re-setup the namespaces, which will delete previous ns
and create new one. e.g.
setup_ns ns1 ns2 ns3
> setup_hsr_interfaces 1
> do_complete_ping_test
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
next prev parent reply other threads:[~2024-05-22 3:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 8:49 [PATCH net] selftests: hsr: Fix "File exists" errors for hsr_ping Geliang Tang
2024-05-22 3:05 ` Hangbin Liu [this message]
2024-05-22 10:37 ` Geliang Tang
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=Zk1g6CRsvSids1Vs@Laptop-X1 \
--to=liuhangbin@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geliang@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=tanggeliang@kylinos.cn \
/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