]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add tests for ETS 16106/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 9 Jun 2020 08:24:04 +0000 (17:24 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 18 Jun 2020 16:10:51 +0000 (01:10 +0900)
test/test-network/conf/25-qdisc-ets.network [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

diff --git a/test/test-network/conf/25-qdisc-ets.network b/test/test-network/conf/25-qdisc-ets.network
new file mode 100644 (file)
index 0000000..a8c6b68
--- /dev/null
@@ -0,0 +1,20 @@
+[Match]
+Name=dummy98
+
+[Network]
+IPv6AcceptRA=no
+Address=10.1.2.3/16
+
+[EnhancedTransmissionSelection]
+Parent=root
+Handle=3a
+Bands=10
+StrictBands=3
+QuantumBytes=2 4 6
+QuantumBytes=
+QuantumBytes=1 2 3
+QuantumBytes=4 5
+PriorityMap=8 7 6 5
+PriorityMap=
+PriorityMap=3 4 5
+PriorityMap=6 7
index b6d1de52235cb52571b917613c96244efd230f26..f059bc90f1c628e32c6999797f3c7d899cf9486c 100755 (executable)
@@ -194,6 +194,18 @@ def expectedFailureIfHHFIsNotAvailable():
 
     return f
 
+def expectedFailureIfETSIsNotAvailable():
+    def f(func):
+        call('ip link add dummy98 type dummy', stderr=subprocess.DEVNULL)
+        rc = call('tc qdisc add dev dummy98 parent root ets bands 10', stderr=subprocess.DEVNULL)
+        call('ip link del dummy98', stderr=subprocess.DEVNULL)
+        if rc == 0:
+            return func
+        else:
+            return unittest.expectedFailure(func)
+
+    return f
+
 def setUpModule():
     global running_units
 
@@ -1673,6 +1685,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
         '25-qdisc-cake.network',
         '25-qdisc-clsact-and-htb.network',
         '25-qdisc-drr.network',
+        '25-qdisc-ets.network',
         '25-qdisc-hhf.network',
         '25-qdisc-ingress-netem-compat.network',
         '25-qdisc-pie.network',
@@ -2480,6 +2493,19 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
         self.assertRegex(output, 'qdisc hhf 3a: root')
         self.assertRegex(output, 'limit 1022p')
 
+    @expectedFailureIfETSIsNotAvailable()
+    def test_qdisc_ets(self):
+        copy_unit_to_networkd_unit_path('25-qdisc-ets.network', '12-dummy.netdev')
+        start_networkd()
+        self.wait_online(['dummy98:routable'])
+
+        output = check_output('tc qdisc show dev dummy98')
+        print(output)
+        self.assertRegex(output, 'qdisc ets 3a: root')
+        self.assertRegex(output, 'bands 10 strict 3')
+        self.assertRegex(output, 'quanta 1 2 3 4 5')
+        self.assertRegex(output, 'priomap 3 4 5 6 7')
+
 class NetworkdStateFileTests(unittest.TestCase, Utilities):
     links = [
         'dummy98',