From: Yu Watanabe Date: Tue, 27 May 2025 14:31:48 +0000 (+0900) Subject: test-network: add test case for issue #37629 X-Git-Tag: v256.17~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c2213cf1e2f552ccecf396531e861de4ce77d69;p=thirdparty%2Fsystemd.git test-network: add test case for issue #37629 (cherry picked from commit b1bed07d84d76f3ab2f11a42fefce2685dbbe685) (cherry picked from commit a11a8221019a3c364e783052e18dcf438fa3dace) --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 2ddfeba6619..b6262a6f556 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -4913,6 +4913,21 @@ class NetworkdBondTests(unittest.TestCase, Utilities): print(output) self.assertRegex(output, 'master bond199') + # Test case for #37629 + for _ in range(3): + # When a slave leaved from its master bonding interface, the kernel brings down the slave. + check_output('ip link set dummy98 nomaster') + self.wait_online('dummy98:off') + + # Bring up the interface to check if networkd recognizes the interface has no master now. + check_output('ip link set dummy98 up') + self.wait_online('dummy98:carrier') + + # We need to first bring down the interface to make it join a bonding interface. + check_output('ip link set dummy98 down') + check_output('ip link set dummy98 master bond199') + self.wait_online('dummy98:enslaved') + def test_bond_active_slave(self): copy_network_unit('23-active-slave.network', '23-bond199.network', '25-bond-active-backup-slave.netdev', '12-dummy.netdev') start_networkd()