Skip to content

Commit 5f7efc2

Browse files
yuwatabluca
authored andcommitted
test-network: add test case for issue #37629
(cherry picked from commit b1bed07d84d76f3ab2f11a42fefce2685dbbe685) (cherry picked from commit a11a8221019a3c364e783052e18dcf438fa3dace) (cherry picked from commit 8c2213cf1e2f552ccecf396531e861de4ce77d69)
1 parent 2057199 commit 5f7efc2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/test-network/systemd-networkd-tests.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4444,6 +4444,21 @@ def test_bond_keep_master(self):
44444444
print(output)
44454445
self.assertRegex(output, 'master bond199')
44464446

4447+
# Test case for #37629
4448+
for _ in range(3):
4449+
# When a slave leaved from its master bonding interface, the kernel brings down the slave.
4450+
check_output('ip link set dummy98 nomaster')
4451+
self.wait_online('dummy98:off')
4452+
4453+
# Bring up the interface to check if networkd recognizes the interface has no master now.
4454+
check_output('ip link set dummy98 up')
4455+
self.wait_online('dummy98:carrier')
4456+
4457+
# We need to first bring down the interface to make it join a bonding interface.
4458+
check_output('ip link set dummy98 down')
4459+
check_output('ip link set dummy98 master bond199')
4460+
self.wait_online('dummy98:enslaved')
4461+
44474462
def test_bond_active_slave(self):
44484463
copy_network_unit('23-active-slave.network', '23-bond199.network', '25-bond-active-backup-slave.netdev', '12-dummy.netdev')
44494464
start_networkd()

0 commit comments

Comments
 (0)