]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/test-network/systemd-networkd-tests.py
test-network: add test case for IFB
[thirdparty/systemd.git] / test / test-network / systemd-networkd-tests.py
index ab6e11e0e527dbbe022298832913cee1c288c427..aa29221e8571ddae520553ab26e84169dfa67985 100755 (executable)
@@ -556,6 +556,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
         'gretun97',
         'gretun98',
         'gretun99',
+        'ifb99',
         'ip6gretap98',
         'ip6gretap99',
         'ip6gretun96',
@@ -633,6 +634,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
         '25-gre-tunnel-local-any.netdev',
         '25-gre-tunnel-remote-any.netdev',
         '25-gre-tunnel.netdev',
+        '25-ifb.netdev',
         '25-ip6gretap-tunnel-local-any.netdev',
         '25-ip6gretap-tunnel.netdev',
         '25-ip6gre-tunnel-any-any.netdev',
@@ -1379,6 +1381,13 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
 
         self.wait_online(['nlmon99:carrier'])
 
+    @expectedFailureIfModuleIsNotAvailable('ifb')
+    def test_ifb(self):
+        copy_unit_to_networkd_unit_path('25-ifb.netdev', 'netdev-link-local-addressing-yes.network')
+        start_networkd()
+
+        self.wait_online(['ifb99:degraded'])
+
 class NetworkdL2TPTests(unittest.TestCase, Utilities):
 
     links =[
@@ -1498,7 +1507,8 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
         '25-neighbor-ip-dummy.network',
         '25-neighbor-ip.network',
         '25-nexthop.network',
-        '25-qdisc.network',
+        '25-qdisc-netem.network',
+        '25-qdisc-tbf-and-sfq.network',
         '25-route-ipv6-src.network',
         '25-route-static.network',
         '25-gateway-static.network',
@@ -2057,15 +2067,23 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
         self.assertRegex(output, '192.168.5.1')
 
     def test_qdisc(self):
-        copy_unit_to_networkd_unit_path('25-qdisc.network', '12-dummy.netdev')
+        copy_unit_to_networkd_unit_path('25-qdisc-netem.network', '12-dummy.netdev',
+                                        '25-qdisc-tbf-and-sfq.network', '11-dummy.netdev')
         start_networkd()
 
-        self.wait_online(['dummy98:routable'])
+        self.wait_online(['dummy98:routable', 'test1:routable'])
 
         output = check_output('tc qdisc show dev dummy98')
         print(output)
+        self.assertRegex(output, 'qdisc netem')
         self.assertRegex(output, 'limit 100 delay 50.0ms  10.0ms loss 20%')
         self.assertRegex(output, 'limit 200 delay 100.0ms  13.0ms loss 20.5%')
+        output = check_output('tc qdisc show dev test1')
+        print(output)
+        self.assertRegex(output, 'qdisc tbf')
+        self.assertRegex(output, 'rate 500Kbit burst 5000b lat 70.0ms')
+        self.assertRegex(output, 'qdisc sfq')
+        self.assertRegex(output, 'perturb 5sec')
 
 class NetworkdStateFileTests(unittest.TestCase, Utilities):
     links = [