From 2ee7e54b9e8c15ec1169a10ca0b266c0716071e7 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 8 Jun 2020 17:38:50 +0900 Subject: [PATCH] test-network: add tests for HTB settings --- test/test-network/conf/25-qdisc-clsact-and-htb.network | 6 ++++++ test/test-network/systemd-networkd-tests.py | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/test-network/conf/25-qdisc-clsact-and-htb.network b/test/test-network/conf/25-qdisc-clsact-and-htb.network index 0d6815710cc..f18e2f76d95 100644 --- a/test/test-network/conf/25-qdisc-clsact-and-htb.network +++ b/test/test-network/conf/25-qdisc-clsact-and-htb.network @@ -12,13 +12,19 @@ Parent=clsact Parent=root Handle=0002 DefaultClass=30 +RateToQuantum=20 [HierarchyTokenBucketClass] Parent=root ClassId=0002:0030 Priority=1 +QuantumBytes=4000 +MTUBytes=1700 +OverheadBytes=100 Rate=1M +BufferBytes=123456 CeilRate=0.5M +CeilBufferBytes=123457 [NetworkEmulator] Parent=2:30 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index b6d1de52235..c783ada33a1 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -2407,7 +2407,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, 'qdisc pfifo_fast 3c: parent 2:3c') - output = check_output('tc class show dev dummy98') + output = check_output('tc -d class show dev dummy98') print(output) self.assertRegex(output, 'class htb 2:30 root leaf 30:') self.assertRegex(output, 'class htb 2:31 root leaf 31:') @@ -2422,7 +2422,9 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, 'class htb 2:3a root leaf 3a:') self.assertRegex(output, 'class htb 2:3b root leaf 3b:') self.assertRegex(output, 'class htb 2:3c root leaf 3c:') - self.assertRegex(output, 'prio 1 rate 1Mbit ceil 500Kbit') + self.assertRegex(output, 'prio 1 quantum 4000 rate 1Mbit overhead 100 ceil 500Kbit') + self.assertRegex(output, 'burst 123456') + self.assertRegex(output, 'cburst 123457') def test_qdisc2(self): copy_unit_to_networkd_unit_path('25-qdisc-drr.network', '12-dummy.netdev', -- 2.47.3