[Devel] [PATCH vz10 2/3] selftests: bonding: run the LACPDU test in its own netns
Eva Kurchatova
eva.kurchatova at virtuozzo.com
Tue Sep 1 02:39:51 MSK 2026
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 || :
--
2.55.0
More information about the Devel
mailing list