lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 22 May 2024 18:37:07 +0800
From: Geliang Tang <geliang@...nel.org>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>,  Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
 <pabeni@...hat.com>, Shuah Khan <shuah@...nel.org>,  Geliang Tang
 <tanggeliang@...inos.cn>, netdev@...r.kernel.org,
 linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net] selftests: hsr: Fix "File exists" errors for
 hsr_ping

On Wed, 2024-05-22 at 11:05 +0800, Hangbin Liu wrote:
> On Tue, May 21, 2024 at 04:49:44PM +0800, Geliang Tang wrote:
> > From: Geliang Tang <tanggeliang@...inos.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@...inos.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

Thanks Hangbin, "re-setup" is much better.

> 
> >  setup_hsr_interfaces 1
> >  do_complete_ping_test
> 
> 
> Reviewed-by: Hangbin Liu <liuhangbin@...il.com>

I'll send a v2, with your Reviewed-by tag.

-Geliang


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ