diff mbox series

[net,v2] selftests: hsr: Fix "File exists" errors for hsr_ping

Message ID 6485d3005f467758d49f0f313c8c009759ba6b05.1716374462.git.tanggeliang@kylinos.cn
State New
Headers show
Series [net,v2] selftests: hsr: Fix "File exists" errors for hsr_ping | expand

Commit Message

Geliang Tang May 22, 2024, 10:45 a.m. UTC
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 re-setup the namespaces using

	setup_ns ns1 ns2 ns3

command before "setup_hsr_interfaces 1". It deletes previous namespaces
and create new ones.

Fixes: 680fda4f6714 ("test: hsr: Remove script code already implemented in lib.sh")
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
v2:
 - re-setup the namespaces as Hangbin suggested.
---
 tools/testing/selftests/net/hsr/hsr_ping.sh | 2 ++
 1 file changed, 2 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org May 27, 2024, 9:50 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 22 May 2024 18:45:04 +0800 you 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.
> 
> [...]

Here is the summary with links:
  - [net,v2] selftests: hsr: Fix "File exists" errors for hsr_ping
    https://git.kernel.org/netdev/net/c/21a22ed618d0

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/hsr/hsr_ping.sh b/tools/testing/selftests/net/hsr/hsr_ping.sh
index 790294c8af83..3684b813b0f6 100755
--- a/tools/testing/selftests/net/hsr/hsr_ping.sh
+++ b/tools/testing/selftests/net/hsr/hsr_ping.sh
@@ -174,6 +174,8 @@  trap cleanup_all_ns EXIT
 setup_hsr_interfaces 0
 do_complete_ping_test
 
+setup_ns ns1 ns2 ns3
+
 setup_hsr_interfaces 1
 do_complete_ping_test