diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-02-17 21:03:12 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-03-02 15:59:37 +0900 |
commit | f6c6af3811689c40073e3baf4eb6cfbb67afc45f (patch) | |
tree | a919efb823578466c09c556a7a7f5ef944ed05a3 /test | |
parent | ad8352f4ffa97488854bafadad36397b056c68b6 (diff) | |
download | systemd-f6c6af3811689c40073e3baf4eb6cfbb67afc45f.tar.gz |
test-network: add a test case for CAKE
Diffstat (limited to 'test')
-rw-r--r-- | test/test-network/conf/25-qdisc-cake.network | 12 | ||||
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 25 |
2 files changed, 37 insertions, 0 deletions
diff --git a/test/test-network/conf/25-qdisc-cake.network b/test/test-network/conf/25-qdisc-cake.network new file mode 100644 index 0000000000..b713245dbc --- /dev/null +++ b/test/test-network/conf/25-qdisc-cake.network @@ -0,0 +1,12 @@ +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[CAKE] +Parent=root +Handle=3a +Overhead=128 +Bandwidth=500M diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 3d26a87bae..9d39bfb920 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -156,6 +156,18 @@ def expectedFailureIfAlternativeNameIsNotAvailable(): return f +def expectedFailureIfCAKEIsNotAvailable(): + def f(func): + call('ip link add dummy98 type dummy', stderr=subprocess.DEVNULL) + rc = call('tc qdisc add dev dummy98 parent root cake', 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 @@ -1620,6 +1632,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): '25-neighbor-ip-dummy.network', '25-neighbor-ip.network', '25-nexthop.network', + '25-qdisc-cake.network', '25-qdisc-clsact-and-htb.network', '25-qdisc-ingress-netem-compat.network', '25-route-ipv6-src.network', @@ -2316,6 +2329,18 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, 'class htb 2:39 root leaf 39:') self.assertRegex(output, 'prio 1 rate 1Mbit ceil 500Kbit') + @expectedFailureIfCAKEIsNotAvailable() + def test_qdisc_cake(self): + copy_unit_to_networkd_unit_path('25-qdisc-cake.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 cake 3a: root') + self.assertRegex(output, 'bandwidth 500Mbit') + self.assertRegex(output, 'overhead 128') + class NetworkdStateFileTests(unittest.TestCase, Utilities): links = [ 'dummy98', |