On Mon, Apr 14, 2025 at 10:25:33AM -0700, Alok Tiwari wrote:
The selftest "kci_test_bridge_parent_id" fails with the error: "Device can not be enslaved while up" when trying to attach interfaces (`eni10np1`, `eni20np1`) to a bonding device (`test-bond0`) while the interfaces are in the UP state.
Why are they up? The test creates the interfaces and never brings them up.
It's most likely caused by some interface manager in your user space. I suggest fixing that instead.
Failure log: COMMAND: ip link set dev eni10np1 master test-bond0 Error: Device can not be enslaved while up. COMMAND: ip link set dev eni20np1 master test-bond0 Error: Device can not be enslaved while up. FAIL: bridge_parent_id
This behavior aligns with bonding driver requirements, where a slave interface must be in the DOWN state before being enslaved. This was reinforced in upstream commit: 'ec4ffd100ffb ("Revert 'net: rtnetlink: Enslave device before bringing it up'")'.
This patch updates the test to bring interfaces down explicitly before adding them to the bonding device:
I don't see why the test needs to bring them down when it never brought them up to begin with.