]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add test case for issue #37629
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 27 May 2025 14:31:48 +0000 (23:31 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 25 Jun 2025 12:36:10 +0000 (13:36 +0100)
(cherry picked from commit b1bed07d84d76f3ab2f11a42fefce2685dbbe685)

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

index 3e3f070c0c8f67c3ffef5d5441efe0d3e4d4435c..a41f5c738307b2ac1d303b0d050f85033ddd6a1c 100755 (executable)
@@ -5583,6 +5583,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()