Skip to content

Commit 6ef8df6

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) (cherry picked from commit 5f7efc2)
1 parent 936aa69 commit 6ef8df6

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
@@ -4113,6 +4113,21 @@ def test_bond_keep_master(self):
41134113
print(output)
41144114
self.assertRegex(output, 'master bond199')
41154115

4116+
# Test case for #37629
4117+
for _ in range(3):
4118+
# When a slave leaved from its master bonding interface, the kernel brings down the slave.
4119+
check_output('ip link set dummy98 nomaster')
4120+
self.wait_online('dummy98:off')
4121+
4122+
# Bring up the interface to check if networkd recognizes the interface has no master now.
4123+
check_output('ip link set dummy98 up')
4124+
self.wait_online('dummy98:carrier')
4125+
4126+
# We need to first bring down the interface to make it join a bonding interface.
4127+
check_output('ip link set dummy98 down')
4128+
check_output('ip link set dummy98 master bond199')
4129+
self.wait_online('dummy98:enslaved')
4130+
41164131
def test_bond_active_slave(self):
41174132
copy_network_unit('23-active-slave.network', '23-bond199.network', '25-bond-active-backup-slave.netdev', '12-dummy.netdev')
41184133
start_networkd()

0 commit comments

Comments
 (0)