[Devel] [PATCH vz10 2/3] selftests: bonding: run the LACPDU test in its own netns

Konstantin Khorenko khorenko at virtuozzo.com
Thu Sep 24 15:58:41 MSK 2026


Committed to branch-rh10-6.12.0-211.52.1.22.x.vz10-ovz, will be released in rh10-6.12.0-211.52.1.22.3.vz10

ca28e6fa4bad



selftests: bonding: run the LACPDU test in its own netns
The test builds its bond in whatever namespace it is started in. Where
NetworkManager runs, it brings the fresh veths up before the test gets
to enslave them, and bonding refuses:
  Error: Device can not be enslaved while up.
Commit be809424659c ("selftests: bonding: do not set port down before
adding to bond") took the explicit link down out, as a veth is down when
it is created, so nothing sets it down again.
Run the test in a namespace of its own instead, the way nft_audit.sh and
nft_concat_range.sh already do, where nothing else manages the devices.
https://virtuozzo.atlassian.net/browse/VSTOR-139651
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
Link: http://lore.virtuozzo.com/20260831234036.1649006-2-eva.kurchatova@virtuozzo.com

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 9/1/26 01:39, Eva Kurchatova wrote:
> The test builds its bond in whatever namespace it is started in. Where
> NetworkManager runs, it brings the fresh veths up before the test gets
> to enslave them, and bonding refuses:
> 
>   Error: Device can not be enslaved while up.
> 
> Commit be809424659c ("selftests: bonding: do not set port down before
> adding to bond") took the explicit link down out, as a veth is down when
> it is created, so nothing sets it down again.
> 
> Run the test in a namespace of its own instead, the way nft_audit.sh and
> nft_concat_range.sh already do, where nothing else manages the devices.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-139651
> Feature: fix selftests
> Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
> ---
>  .../selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh  | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/tools/testing/selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh b/tools/testing/selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh
> index 1ec7f59db7f4..7310eeccc3f8 100755
> --- a/tools/testing/selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh
> +++ b/tools/testing/selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh
> @@ -19,6 +19,12 @@
>  #    |veth1 | |veth2 |
>  #    +------+ +------+
>  #
> +# The test builds its devices in whatever namespace it is started in,
> +# where NetworkManager brings them up before they can be enslaved:
> +#   Error: Device can not be enslaved while up.
> +# Run in a fresh network namespace, like the netfilter tests do.
> +[ "${1}" != "run" ] && { unshare -n "${0}" run; exit $?; }
> +
>  # We use veths instead of physical interfaces
>  REQUIRE_MZ=no
>  NUM_NETIFS=0
> @@ -26,6 +32,7 @@ lib_dir=$(dirname "$0")
>  source "$lib_dir"/../../../net/forwarding/lib.sh
>  
>  set -e
> +
>  cleanup() {
>  	ip link del fab-br0 >/dev/null 2>&1 || :
>  	ip link del fbond  >/dev/null 2>&1 || :



More information about the Devel mailing list