]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add test for TCPCongestionControlAlgorithm= 24456/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 26 Aug 2022 06:01:30 +0000 (15:01 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 26 Aug 2022 10:47:27 +0000 (19:47 +0900)
test/test-network/conf/25-route-congctl.network [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

diff --git a/test/test-network/conf/25-route-congctl.network b/test/test-network/conf/25-route-congctl.network
new file mode 100644 (file)
index 0000000..f924d73
--- /dev/null
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Match]
+Name=dummy98
+
+[Network]
+IPv6AcceptRA=no
+Address=2001:1234:5:8f63::1/128
+Address=149.10.124.58/28
+
+[Route]
+Destination=2001:1234:5:8fff:ff:ff:ff:ff/128
+TCPCongestionControlAlgorithm=dctcp
+
+[Route]
+Destination=149.10.124.66
+TCPCongestionControlAlgorithm=dctcp
index 284bc3146fba9fb6d9f668eeba1ca9e750db8bd2..1dddd863318cdcaaf66fd6cc1068cc8ed3d56205 100755 (executable)
@@ -2800,6 +2800,24 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
         self.assertRegex(output, '149.10.124.48/28 proto kernel scope link src 149.10.124.58')
         self.assertRegex(output, '149.10.124.66 via inet6 2001:1234:5:8fff:ff:ff:ff:ff proto static')
 
+    @expectedFailureIfModuleIsNotAvailable('tcp_dctcp')
+    def test_route_congctl(self):
+        copy_network_unit('25-route-congctl.network', '12-dummy.netdev')
+        start_networkd()
+        self.wait_online(['dummy98:routable'])
+
+        print('### ip -6 route show dev dummy98 2001:1234:5:8fff:ff:ff:ff:ff')
+        output = check_output('ip -6 route show dev dummy98 2001:1234:5:8fff:ff:ff:ff:ff')
+        print(output)
+        self.assertIn('2001:1234:5:8fff:ff:ff:ff:ff proto static', output)
+        self.assertIn('congctl dctcp', output)
+
+        print('### ip -4 route show dev dummy98 149.10.124.66')
+        output = check_output('ip -4 route show dev dummy98 149.10.124.66')
+        print(output)
+        self.assertIn('149.10.124.66 proto static', output)
+        self.assertIn('congctl dctcp', output)
+
     @expectedFailureIfModuleIsNotAvailable('vrf')
     def test_route_vrf(self):
         copy_network_unit('25-route-vrf.network', '12-dummy.netdev',