test-network: add test case for TBF
This commit is contained in:
parent
f1dba55565
commit
1b628c4f64
12
test/test-network/conf/25-qdisc-tbf.network
Normal file
12
test/test-network/conf/25-qdisc-tbf.network
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Match]
|
||||||
|
Name=test1
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
IPv6AcceptRA=no
|
||||||
|
Address=10.1.2.4/16
|
||||||
|
|
||||||
|
[TrafficControlQueueingDiscipline]
|
||||||
|
Parent=root
|
||||||
|
TokenBufferFilterRate=0.5M
|
||||||
|
TokenBufferFilterBurst=5K
|
||||||
|
TokenBufferFilterLatencySec=70msec
|
|
@ -1498,7 +1498,8 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
||||||
'25-neighbor-ip-dummy.network',
|
'25-neighbor-ip-dummy.network',
|
||||||
'25-neighbor-ip.network',
|
'25-neighbor-ip.network',
|
||||||
'25-nexthop.network',
|
'25-nexthop.network',
|
||||||
'25-qdisc.network',
|
'25-qdisc-netem.network',
|
||||||
|
'25-qdisc-tbf.network',
|
||||||
'25-route-ipv6-src.network',
|
'25-route-ipv6-src.network',
|
||||||
'25-route-static.network',
|
'25-route-static.network',
|
||||||
'25-gateway-static.network',
|
'25-gateway-static.network',
|
||||||
|
@ -2057,15 +2058,19 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
||||||
self.assertRegex(output, '192.168.5.1')
|
self.assertRegex(output, '192.168.5.1')
|
||||||
|
|
||||||
def test_qdisc(self):
|
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.network', '11-dummy.netdev')
|
||||||
start_networkd()
|
start_networkd()
|
||||||
|
|
||||||
self.wait_online(['dummy98:routable'])
|
self.wait_online(['dummy98:routable', 'test1:routable'])
|
||||||
|
|
||||||
output = check_output('tc qdisc show dev dummy98')
|
output = check_output('tc qdisc show dev dummy98')
|
||||||
print(output)
|
print(output)
|
||||||
self.assertRegex(output, 'limit 100 delay 50.0ms 10.0ms loss 20%')
|
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%')
|
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, 'rate 500Kbit burst 5000b lat 70.0ms')
|
||||||
|
|
||||||
class NetworkdStateFileTests(unittest.TestCase, Utilities):
|
class NetworkdStateFileTests(unittest.TestCase, Utilities):
|
||||||
links = [
|
links = [
|
||||||
|
|
Loading…
Reference in a new issue