From 4c7d13f4b2180ae03c63814f4793b099722daaaf Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 6 Aug 2022 11:22:06 +0900 Subject: [PATCH] test-network: split test_qdisc() and test_qdisc2() And check module availability in each tests. This also sorts qdisc tests. --- .../conf/25-qdisc-clsact-and-htb.network | 204 ------------ .../test-network/conf/25-qdisc-clsact.network | 10 + test/test-network/conf/25-qdisc-codel.network | 16 + test/test-network/conf/25-qdisc-fq.network | 20 ++ .../conf/25-qdisc-fq_codel.network | 19 ++ test/test-network/conf/25-qdisc-gred.network | 14 + .../conf/25-qdisc-htb-fifo.network | 65 ++++ .../conf/25-qdisc-ingress.network | 10 + ....network => 25-qdisc-netem-compat.network} | 3 - test/test-network/conf/25-qdisc-netem.network | 15 + test/test-network/conf/25-qdisc-qfq.network | 4 +- test/test-network/conf/25-qdisc-sfb.network | 12 + test/test-network/conf/25-qdisc-sfq.network | 12 + test/test-network/conf/25-qdisc-tbf.network | 16 + test/test-network/conf/25-qdisc-teql.network | 12 + test/test-network/systemd-networkd-tests.py | 307 +++++++++++------- 16 files changed, 418 insertions(+), 321 deletions(-) delete mode 100644 test/test-network/conf/25-qdisc-clsact-and-htb.network create mode 100644 test/test-network/conf/25-qdisc-clsact.network create mode 100644 test/test-network/conf/25-qdisc-codel.network create mode 100644 test/test-network/conf/25-qdisc-fq.network create mode 100644 test/test-network/conf/25-qdisc-fq_codel.network create mode 100644 test/test-network/conf/25-qdisc-gred.network create mode 100644 test/test-network/conf/25-qdisc-htb-fifo.network create mode 100644 test/test-network/conf/25-qdisc-ingress.network rename test/test-network/conf/{25-qdisc-ingress-netem-compat.network => 25-qdisc-netem-compat.network} (84%) create mode 100644 test/test-network/conf/25-qdisc-netem.network create mode 100644 test/test-network/conf/25-qdisc-sfb.network create mode 100644 test/test-network/conf/25-qdisc-sfq.network create mode 100644 test/test-network/conf/25-qdisc-tbf.network create mode 100644 test/test-network/conf/25-qdisc-teql.network diff --git a/test/test-network/conf/25-qdisc-clsact-and-htb.network b/test/test-network/conf/25-qdisc-clsact-and-htb.network deleted file mode 100644 index c91666d3232..00000000000 --- a/test/test-network/conf/25-qdisc-clsact-and-htb.network +++ /dev/null @@ -1,204 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Match] -Name=dummy98 - -[Network] -IPv6AcceptRA=no -Address=10.1.2.3/16 - -[QDisc] -Parent=clsact - -[HierarchyTokenBucket] -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 -Handle=0030 -DelaySec=50ms -DelayJitterSec=10ms -LossRate=20% -PacketLimit=100 - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:0031 -Priority=1 -Rate=1M -CeilRate=0.5M - -[TrivialLinkEqualizer] -Parent=2:31 -Handle=0031 -Id=1 - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:0032 -Priority=1 -Rate=1M -CeilRate=0.5M - -[FairQueueing] -Parent=2:32 -Handle=0032 -PacketLimit=1000 -FlowLimit=200 -QuantumBytes=1500 -InitialQuantumBytes=13000 -MaximumRate=1M -Buckets=512 -OrphanMask=511 -Pacing=yes -CEThresholdSec=100ms - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:0033 -Priority=1 -Rate=1M -CeilRate=0.5M - -[ControlledDelay] -Parent=2:33 -Handle=0033 -PacketLimit=2000 -TargetSec=10ms -IntervalSec=50ms -ECN=yes -CEThresholdSec=100ms - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:0034 -Priority=1 -Rate=1M -CeilRate=0.5M - -[FairQueueingControlledDelay] -Parent=2:34 -Handle=0034 -PacketLimit=20480 -MemoryLimitBytes=64M -Flows=2048 -TargetSec=10ms -IntervalSec=200ms -QuantumBytes=1400 -ECN=yes -CEThresholdSec=100ms - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:0035 -Priority=1 -Rate=1M -CeilRate=0.5M - -[TokenBucketFilter] -Parent=2:35 -Handle=0035 -Rate=1G -BurstBytes=5000 -LatencySec=70msec -PeakRate=100G -MTUBytes=1000000 - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:0036 -Priority=1 -Rate=1M -CeilRate=0.5M - -[StochasticFairnessQueueing] -Parent=2:36 -Handle=0036 -PerturbPeriodSec=5sec - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:0037 -Priority=1 -Rate=1M -CeilRate=0.5M - -[PFIFO] -Parent=2:37 -Handle=0037 -PacketLimit=100000 - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:0038 -Priority=1 -Rate=1M -CeilRate=0.5M - -[GenericRandomEarlyDetection] -Parent=2:38 -Handle=0038 -VirtualQueues=12 -DefaultVirtualQueue=10 -GenericRIO=yes - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:0039 -Priority=1 -Rate=1M -CeilRate=0.5M - -[StochasticFairBlue] -Parent=2:39 -Handle=0039 -PacketLimit=200000 - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:003a -Priority=1 -Rate=1M -CeilRate=0.5M - -[BFIFO] -Parent=2:3a -Handle=003a -LimitBytes=1000000 - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:003b -Priority=1 -Rate=1M -CeilRate=0.5M - -[PFIFOHeadDrop] -Parent=2:3b -Handle=003b -PacketLimit=1023 - -[HierarchyTokenBucketClass] -Parent=root -ClassId=0002:003c -Priority=1 -Rate=1M -CeilRate=0.5M - -[PFIFOFast] -Parent=2:3c -Handle=003c diff --git a/test/test-network/conf/25-qdisc-clsact.network b/test/test-network/conf/25-qdisc-clsact.network new file mode 100644 index 00000000000..8a1661878be --- /dev/null +++ b/test/test-network/conf/25-qdisc-clsact.network @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[QDisc] +Parent=clsact diff --git a/test/test-network/conf/25-qdisc-codel.network b/test/test-network/conf/25-qdisc-codel.network new file mode 100644 index 00000000000..a332fa8ebf1 --- /dev/null +++ b/test/test-network/conf/25-qdisc-codel.network @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[ControlledDelay] +Parent=root +Handle=0033 +PacketLimit=2000 +TargetSec=10ms +IntervalSec=50ms +ECN=yes +CEThresholdSec=100ms diff --git a/test/test-network/conf/25-qdisc-fq.network b/test/test-network/conf/25-qdisc-fq.network new file mode 100644 index 00000000000..5539a642f6b --- /dev/null +++ b/test/test-network/conf/25-qdisc-fq.network @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[FairQueueing] +Parent=root +Handle=0032 +PacketLimit=1000 +FlowLimit=200 +QuantumBytes=1500 +InitialQuantumBytes=13000 +MaximumRate=1M +Buckets=512 +OrphanMask=511 +Pacing=yes +CEThresholdSec=100ms diff --git a/test/test-network/conf/25-qdisc-fq_codel.network b/test/test-network/conf/25-qdisc-fq_codel.network new file mode 100644 index 00000000000..0e7d62db496 --- /dev/null +++ b/test/test-network/conf/25-qdisc-fq_codel.network @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[FairQueueingControlledDelay] +Parent=root +Handle=0034 +PacketLimit=20480 +MemoryLimitBytes=64M +Flows=2048 +TargetSec=10ms +IntervalSec=200ms +QuantumBytes=1400 +ECN=yes +CEThresholdSec=100ms diff --git a/test/test-network/conf/25-qdisc-gred.network b/test/test-network/conf/25-qdisc-gred.network new file mode 100644 index 00000000000..a49955f1656 --- /dev/null +++ b/test/test-network/conf/25-qdisc-gred.network @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[GenericRandomEarlyDetection] +Parent=root +Handle=0038 +VirtualQueues=12 +DefaultVirtualQueue=10 +GenericRIO=yes diff --git a/test/test-network/conf/25-qdisc-htb-fifo.network b/test/test-network/conf/25-qdisc-htb-fifo.network new file mode 100644 index 00000000000..1e092a9e02f --- /dev/null +++ b/test/test-network/conf/25-qdisc-htb-fifo.network @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[HierarchyTokenBucket] +Parent=root +Handle=0002 +DefaultClass=30 +RateToQuantum=20 + +[HierarchyTokenBucketClass] +Parent=root +ClassId=0002:0037 +Priority=1 +Rate=1M +CeilRate=0.5M +QuantumBytes=4000 +MTUBytes=1700 +OverheadBytes=100 +BufferBytes=123456 +CeilBufferBytes=123457 + +[PFIFO] +Parent=2:37 +Handle=0037 +PacketLimit=100000 + +[HierarchyTokenBucketClass] +Parent=root +ClassId=0002:003a +Priority=1 +Rate=1M +CeilRate=0.5M + +[BFIFO] +Parent=2:3a +Handle=003a +LimitBytes=1000000 + +[HierarchyTokenBucketClass] +Parent=root +ClassId=0002:003b +Priority=1 +Rate=1M +CeilRate=0.5M + +[PFIFOHeadDrop] +Parent=2:3b +Handle=003b +PacketLimit=1023 + +[HierarchyTokenBucketClass] +Parent=root +ClassId=0002:003c +Priority=1 +Rate=1M +CeilRate=0.5M + +[PFIFOFast] +Parent=2:3c +Handle=003c diff --git a/test/test-network/conf/25-qdisc-ingress.network b/test/test-network/conf/25-qdisc-ingress.network new file mode 100644 index 00000000000..6fb5fef77dc --- /dev/null +++ b/test/test-network/conf/25-qdisc-ingress.network @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=test1 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.4/16 + +[QDisc] +Parent=ingress diff --git a/test/test-network/conf/25-qdisc-ingress-netem-compat.network b/test/test-network/conf/25-qdisc-netem-compat.network similarity index 84% rename from test/test-network/conf/25-qdisc-ingress-netem-compat.network rename to test/test-network/conf/25-qdisc-netem-compat.network index d895f7f34fe..15e0f7f3676 100644 --- a/test/test-network/conf/25-qdisc-ingress-netem-compat.network +++ b/test/test-network/conf/25-qdisc-netem-compat.network @@ -12,6 +12,3 @@ NetworkEmulatorDelaySec=50ms NetworkEmulatorDelayJitterSec=10ms NetworkEmulatorLossRate=20% NetworkEmulatorPacketLimit=100 - -[TrafficControlQueueingDiscipline] -Parent=ingress diff --git a/test/test-network/conf/25-qdisc-netem.network b/test/test-network/conf/25-qdisc-netem.network new file mode 100644 index 00000000000..9848788235e --- /dev/null +++ b/test/test-network/conf/25-qdisc-netem.network @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[NetworkEmulator] +Parent=root +Handle=0030 +DelaySec=50ms +DelayJitterSec=10ms +LossRate=20% +PacketLimit=100 diff --git a/test/test-network/conf/25-qdisc-qfq.network b/test/test-network/conf/25-qdisc-qfq.network index 1c8dbc2461d..b09e99c4f26 100644 --- a/test/test-network/conf/25-qdisc-qfq.network +++ b/test/test-network/conf/25-qdisc-qfq.network @@ -1,10 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Match] -Name=test1 +Name=dummy98 [Network] IPv6AcceptRA=no -Address=10.1.2.4/16 +Address=10.1.2.3/16 [QuickFairQueueing] Parent=root diff --git a/test/test-network/conf/25-qdisc-sfb.network b/test/test-network/conf/25-qdisc-sfb.network new file mode 100644 index 00000000000..bfcda007a60 --- /dev/null +++ b/test/test-network/conf/25-qdisc-sfb.network @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[StochasticFairBlue] +Parent=root +Handle=0039 +PacketLimit=200000 diff --git a/test/test-network/conf/25-qdisc-sfq.network b/test/test-network/conf/25-qdisc-sfq.network new file mode 100644 index 00000000000..263cd6dfbe7 --- /dev/null +++ b/test/test-network/conf/25-qdisc-sfq.network @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[StochasticFairnessQueueing] +Parent=root +Handle=0036 +PerturbPeriodSec=5sec diff --git a/test/test-network/conf/25-qdisc-tbf.network b/test/test-network/conf/25-qdisc-tbf.network new file mode 100644 index 00000000000..c5f28fb63cf --- /dev/null +++ b/test/test-network/conf/25-qdisc-tbf.network @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[TokenBucketFilter] +Parent=root +Handle=0035 +Rate=1G +BurstBytes=5000 +LatencySec=70msec +PeakRate=100G +MTUBytes=1000000 diff --git a/test/test-network/conf/25-qdisc-teql.network b/test/test-network/conf/25-qdisc-teql.network new file mode 100644 index 00000000000..ed7e21fd9a4 --- /dev/null +++ b/test/test-network/conf/25-qdisc-teql.network @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[TrivialLinkEqualizer] +Parent=root +Handle=0031 +Id=1 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 33029396265..209f5a565cb 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -3220,108 +3220,6 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): print(output) self.assertEqual(output, '') - def test_qdisc(self): - copy_network_unit('25-qdisc-clsact-and-htb.network', '12-dummy.netdev', - '25-qdisc-ingress-netem-compat.network', '11-dummy.netdev') - check_output('modprobe sch_teql max_equalizers=2') - start_networkd() - self.wait_online(['dummy98:routable', 'test1:routable']) - - output = check_output('tc qdisc show dev test1') - print(output) - self.assertRegex(output, 'qdisc netem') - self.assertRegex(output, 'limit 100 delay 50(.0)?ms 10(.0)?ms loss 20%') - self.assertRegex(output, 'qdisc ingress') - - output = check_output('tc qdisc show dev dummy98') - print(output) - self.assertRegex(output, 'qdisc clsact') - - self.assertRegex(output, 'qdisc htb 2: root') - self.assertRegex(output, r'default (0x30|30)') - - self.assertRegex(output, 'qdisc netem 30: parent 2:30') - self.assertRegex(output, 'limit 100 delay 50(.0)?ms 10(.0)?ms loss 20%') - self.assertRegex(output, 'qdisc fq_codel') - self.assertRegex(output, 'limit 20480p flows 2048 quantum 1400 target 10(.0)?ms ce_threshold 100(.0)?ms interval 200(.0)?ms memory_limit 64Mb ecn') - - self.assertRegex(output, 'qdisc teql1 31: parent 2:31') - - self.assertRegex(output, 'qdisc fq 32: parent 2:32') - self.assertRegex(output, 'limit 1000p flow_limit 200p buckets 512 orphan_mask 511') - self.assertRegex(output, 'quantum 1500') - self.assertRegex(output, 'initial_quantum 13000') - self.assertRegex(output, 'maxrate 1Mbit') - - self.assertRegex(output, 'qdisc codel 33: parent 2:33') - self.assertRegex(output, 'limit 2000p target 10(.0)?ms ce_threshold 100(.0)?ms interval 50(.0)?ms ecn') - - self.assertRegex(output, 'qdisc fq_codel 34: parent 2:34') - self.assertRegex(output, 'limit 20480p flows 2048 quantum 1400 target 10(.0)?ms ce_threshold 100(.0)?ms interval 200(.0)?ms memory_limit 64Mb ecn') - - self.assertRegex(output, 'qdisc tbf 35: parent 2:35') - self.assertRegex(output, 'rate 1Gbit burst 5000b peakrate 100Gbit minburst 987500b lat 70(.0)?ms') - - self.assertRegex(output, 'qdisc sfq 36: parent 2:36') - self.assertRegex(output, 'perturb 5sec') - - self.assertRegex(output, 'qdisc pfifo 37: parent 2:37') - self.assertRegex(output, 'limit 100000p') - - self.assertRegex(output, 'qdisc gred 38: parent 2:38') - self.assertRegex(output, 'vqs 12 default 10 grio') - - self.assertRegex(output, 'qdisc sfb 39: parent 2:39') - self.assertRegex(output, 'limit 200000') - - self.assertRegex(output, 'qdisc bfifo 3a: parent 2:3a') - self.assertRegex(output, 'limit 1000000') - - self.assertRegex(output, 'qdisc pfifo_head_drop 3b: parent 2:3b') - self.assertRegex(output, 'limit 1023p') - - self.assertRegex(output, 'qdisc pfifo_fast 3c: parent 2:3c') - - 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:') - self.assertRegex(output, 'class htb 2:32 root leaf 32:') - self.assertRegex(output, 'class htb 2:33 root leaf 33:') - self.assertRegex(output, 'class htb 2:34 root leaf 34:') - self.assertRegex(output, 'class htb 2:35 root leaf 35:') - self.assertRegex(output, 'class htb 2:36 root leaf 36:') - self.assertRegex(output, 'class htb 2:37 root leaf 37:') - self.assertRegex(output, 'class htb 2:38 root leaf 38:') - self.assertRegex(output, 'class htb 2:39 root leaf 39:') - 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 quantum 4000 rate 1Mbit overhead 100 ceil 500Kbit') - self.assertRegex(output, 'burst 123456') - self.assertRegex(output, 'cburst 123457') - - def test_qdisc2(self): - copy_network_unit('25-qdisc-drr.network', '12-dummy.netdev', - '25-qdisc-qfq.network', '11-dummy.netdev') - start_networkd() - self.wait_online(['dummy98:routable', 'test1:routable']) - - output = check_output('tc qdisc show dev dummy98') - print(output) - self.assertRegex(output, 'qdisc drr 2: root') - output = check_output('tc class show dev dummy98') - print(output) - self.assertRegex(output, 'class drr 2:30 root quantum 2000b') - - output = check_output('tc qdisc show dev test1') - print(output) - self.assertRegex(output, 'qdisc qfq 2: root') - output = check_output('tc class show dev test1') - print(output) - self.assertRegex(output, 'class qfq 2:30 root weight 2 maxpkt 16000') - self.assertRegex(output, 'class qfq 2:31 root weight 10 maxpkt 8000') - @expectedFailureIfModuleIsNotAvailable('sch_cake') def test_qdisc_cake(self): copy_network_unit('25-qdisc-cake.network', '12-dummy.netdev') @@ -3344,27 +3242,29 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertIn('mpu 20', output) self.assertIn('fwmark 0xff00', output) - @expectedFailureIfModuleIsNotAvailable('sch_pie') - def test_qdisc_pie(self): - copy_network_unit('25-qdisc-pie.network', '12-dummy.netdev') + @expectedFailureIfModuleIsNotAvailable('sch_codel') + def test_qdisc_codel(self): + copy_network_unit('25-qdisc-codel.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 pie 3a: root') - self.assertRegex(output, 'limit 200000') + self.assertRegex(output, 'qdisc codel 33: root') + self.assertRegex(output, 'limit 2000p target 10(.0)?ms ce_threshold 100(.0)?ms interval 50(.0)?ms ecn') - @expectedFailureIfModuleIsNotAvailable('sch_hhf') - def test_qdisc_hhf(self): - copy_network_unit('25-qdisc-hhf.network', '12-dummy.netdev') + @expectedFailureIfModuleIsNotAvailable('sch_drr') + def test_qdisc_drr(self): + copy_network_unit('25-qdisc-drr.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 hhf 3a: root') - self.assertRegex(output, 'limit 1022p') + self.assertRegex(output, 'qdisc drr 2: root') + output = check_output('tc class show dev dummy98') + print(output) + self.assertRegex(output, 'class drr 2:30 root quantum 2000b') @expectedFailureIfModuleIsNotAvailable('sch_ets') def test_qdisc_ets(self): @@ -3380,6 +3280,31 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, 'quanta 1 2 3 4 5') self.assertRegex(output, 'priomap 3 4 5 6 7') + @expectedFailureIfModuleIsNotAvailable('sch_fq') + def test_qdisc_fq(self): + copy_network_unit('25-qdisc-fq.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 fq 32: root') + self.assertRegex(output, 'limit 1000p flow_limit 200p buckets 512 orphan_mask 511') + self.assertRegex(output, 'quantum 1500') + self.assertRegex(output, 'initial_quantum 13000') + self.assertRegex(output, 'maxrate 1Mbit') + + @expectedFailureIfModuleIsNotAvailable('sch_fq_codel') + def test_qdisc_fq_codel(self): + copy_network_unit('25-qdisc-fq_codel.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 fq_codel 34: root') + self.assertRegex(output, 'limit 20480p flows 2048 quantum 1400 target 10(.0)?ms ce_threshold 100(.0)?ms interval 200(.0)?ms memory_limit 64Mb ecn') + @expectedFailureIfModuleIsNotAvailable('sch_fq_pie') def test_qdisc_fq_pie(self): copy_network_unit('25-qdisc-fq_pie.network', '12-dummy.netdev') @@ -3392,6 +3317,164 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, 'qdisc fq_pie 3a: root') self.assertRegex(output, 'limit 200000p') + @expectedFailureIfModuleIsNotAvailable('sch_gred') + def test_qdisc_gred(self): + copy_network_unit('25-qdisc-gred.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 gred 38: root') + self.assertRegex(output, 'vqs 12 default 10 grio') + + @expectedFailureIfModuleIsNotAvailable('sch_hhf') + def test_qdisc_hhf(self): + copy_network_unit('25-qdisc-hhf.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 hhf 3a: root') + self.assertRegex(output, 'limit 1022p') + + @expectedFailureIfModuleIsNotAvailable('sch_htb') + def test_qdisc_htb_fifo(self): + copy_network_unit('25-qdisc-htb-fifo.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 htb 2: root') + self.assertRegex(output, r'default (0x30|30)') + + self.assertRegex(output, 'qdisc pfifo 37: parent 2:37') + self.assertRegex(output, 'limit 100000p') + + self.assertRegex(output, 'qdisc bfifo 3a: parent 2:3a') + self.assertRegex(output, 'limit 1000000') + + self.assertRegex(output, 'qdisc pfifo_head_drop 3b: parent 2:3b') + self.assertRegex(output, 'limit 1023p') + + self.assertRegex(output, 'qdisc pfifo_fast 3c: parent 2:3c') + + output = check_output('tc -d class show dev dummy98') + print(output) + self.assertRegex(output, 'class htb 2:37 root leaf 37:') + 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 quantum 4000 rate 1Mbit overhead 100 ceil 500Kbit') + self.assertRegex(output, 'burst 123456') + self.assertRegex(output, 'cburst 123457') + + @expectedFailureIfModuleIsNotAvailable('sch_ingress') + def test_qdisc_ingress(self): + copy_network_unit('25-qdisc-clsact.network', '12-dummy.netdev', + '25-qdisc-ingress.network', '11-dummy.netdev') + start_networkd() + self.wait_online(['dummy98:routable', 'test1:routable']) + + output = check_output('tc qdisc show dev dummy98') + print(output) + self.assertRegex(output, 'qdisc clsact') + + output = check_output('tc qdisc show dev test1') + print(output) + self.assertRegex(output, 'qdisc ingress') + + @expectedFailureIfModuleIsNotAvailable('sch_netem') + def test_qdisc_netem(self): + copy_network_unit('25-qdisc-netem.network', '12-dummy.netdev', + '25-qdisc-netem-compat.network', '11-dummy.netdev') + start_networkd() + self.wait_online(['dummy98:routable', 'test1:routable']) + + output = check_output('tc qdisc show dev dummy98') + print(output) + self.assertRegex(output, 'qdisc netem 30: root') + self.assertRegex(output, 'limit 100 delay 50(.0)?ms 10(.0)?ms loss 20%') + + output = check_output('tc qdisc show dev test1') + print(output) + self.assertRegex(output, 'qdisc netem [0-9a-f]*: root') + self.assertRegex(output, 'limit 100 delay 50(.0)?ms 10(.0)?ms loss 20%') + + @expectedFailureIfModuleIsNotAvailable('sch_pie') + def test_qdisc_pie(self): + copy_network_unit('25-qdisc-pie.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 pie 3a: root') + self.assertRegex(output, 'limit 200000') + + @expectedFailureIfModuleIsNotAvailable('sch_qfq') + def test_qdisc_qfq(self): + copy_network_unit('25-qdisc-qfq.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 qfq 2: root') + output = check_output('tc class show dev dummy98') + print(output) + self.assertRegex(output, 'class qfq 2:30 root weight 2 maxpkt 16000') + self.assertRegex(output, 'class qfq 2:31 root weight 10 maxpkt 8000') + + @expectedFailureIfModuleIsNotAvailable('sch_sfb') + def test_qdisc_sfb(self): + copy_network_unit('25-qdisc-sfb.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 sfb 39: root') + self.assertRegex(output, 'limit 200000') + + @expectedFailureIfModuleIsNotAvailable('sch_sfq') + def test_qdisc_sfq(self): + copy_network_unit('25-qdisc-sfq.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 sfq 36: root') + self.assertRegex(output, 'perturb 5sec') + + @expectedFailureIfModuleIsNotAvailable('sch_tbf') + def test_qdisc_tbf(self): + copy_network_unit('25-qdisc-tbf.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 tbf 35: root') + self.assertRegex(output, 'rate 1Gbit burst 5000b peakrate 100Gbit minburst 987500b lat 70(.0)?ms') + + @expectedFailureIfModuleIsNotAvailable('sch_teql') + def test_qdisc_teql(self): + call_quiet('rmmod sch_teql') + + copy_network_unit('25-qdisc-teql.network', '12-dummy.netdev') + start_networkd() + self.wait_links('dummy98') + check_output('modprobe sch_teql max_equalizers=2') + self.wait_online(['dummy98:routable']) + + output = check_output('tc qdisc show dev dummy98') + print(output) + self.assertRegex(output, 'qdisc teql1 31: root') + def test_wait_online_ipv4(self): copy_network_unit('25-veth.netdev', '25-dhcp-server-with-ipv6-prefix.network', '25-dhcp-client-ipv4-ipv6ra-prefix-client-with-delay.network') start_networkd()