]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add test case for issue #31165 31172/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 2 Feb 2024 02:20:25 +0000 (11:20 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 9 Feb 2024 05:15:17 +0000 (14:15 +0900)
src/network/networkd-setlink.c
test/test-network/systemd-networkd-tests.py

index 4c4e0d1cd97c23a1f45733709e2ae65c648dd9b4..eb65429a783ff0b6d31b5931baf8cbb1dc5d7f78 100644 (file)
@@ -1046,6 +1046,8 @@ static int link_up_or_down(Link *link, bool up, Request *req) {
         assert(link->manager->rtnl);
         assert(req);
 
+        /* The log message is checked in the test. Please also update test_bond_active_slave() in
+         * test/test-network/systemd-networkd-tests.py. when the log message below is modified. */
         log_link_debug(link, "Bringing link %s", up_or_down(up));
 
         r = sd_rtnl_message_new_link(link->manager->rtnl, &m, RTM_SETLINK, link->ifindex);
index 1700732e343acc3e68b6b79b47a596c0292f34b8..11c3839bdba1403bae91eec28a69f9c117a553bd 100755 (executable)
@@ -4597,6 +4597,12 @@ class NetworkdBondTests(unittest.TestCase, Utilities):
         print(output)
         self.assertIn('active_slave dummy98', output)
 
+        # test case for issue #31165.
+        since = datetime.datetime.now()
+        networkctl_reconfigure('dummy98')
+        self.wait_online(['dummy98:enslaved', 'bond199:degraded'])
+        self.assertNotIn('dummy98: Bringing link down', read_networkd_log(since=since))
+
     def test_bond_primary_slave(self):
         copy_network_unit('23-primary-slave.network', '23-bond199.network', '25-bond-active-backup-slave.netdev', '12-dummy.netdev')
         start_networkd()