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]
Message-ID: <5dfcfc03f62f80a498b9281e31f9e40ae1e35a34.camel@redhat.com>
Date: Thu, 01 Feb 2024 13:31:49 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Ido Schimmel <idosch@...dia.com>
Cc: netdev@...r.kernel.org, linux-kselftest@...r.kernel.org, 
 davem@...emloft.net, kuba@...nel.org, edumazet@...gle.com,
 shuah@...nel.org,  razor@...ckwall.org
Subject: Re: [PATCH net-next] selftests: net: Fix bridge backup port test
 flakiness

On Thu, 2024-02-01 at 13:16 +0200, Ido Schimmel wrote:
> On Thu, Feb 01, 2024 at 10:34:52AM +0100, Paolo Abeni wrote:
> > What about adding an helper alike wait_local_port_listen(), checking
> > for bridge link status in short intervals, to likely reduce the overall
> > wait time?
> 
> What about the below?
> 
> diff --git a/tools/testing/selftests/net/test_bridge_backup_port.sh b/tools/testing/selftests/net/test_bridge_backup_port.sh
> index 70a7d87ba2d2..1b3f89e2b86e 100755
> --- a/tools/testing/selftests/net/test_bridge_backup_port.sh
> +++ b/tools/testing/selftests/net/test_bridge_backup_port.sh
> @@ -124,6 +124,16 @@ tc_check_packets()
>  	[[ $pkts == $count ]]
>  }
>  
> +bridge_link_check()
> +{
> +	local ns=$1; shift
> +	local dev=$1; shift
> +	local state=$1; shift
> +
> +	bridge -n $ns -d -j link show dev $dev | \
> +		jq -e ".[][\"state\"] == \"$state\"" &> /dev/null
> +}

I was wondering more about a sleeping loop, something alike:

wait_bridge_link()
{	
	for i in $(seq 10); do
		if bridge_link_check $1 $2 $3; then
			break
		fi
		sleep 0.1
	done
}

but no strong preference


Cheers,

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ