test-network: add tests for qdisc

This commit is contained in:
Yu Watanabe
2019-10-30 00:33:19 +09:00
parent 4ecdcb07c9
commit ef3c8a92b7
2 changed files with 35 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
[Match]
Name=dummy98
[Network]
IPv6AcceptRA=no
Address=10.1.2.3/16
[TrafficControlQueueingDiscipline]
Parent=root
NetworkEmulatorDelaySec=50ms
NetworkEmulatorDelayJitterSec=10ms
NetworkEmulatorLossRate=20%
NetworkEmulatorPacketLimit=100
[TrafficControlQueueingDiscipline]
Parent=clsact
NetworkEmulatorDelaySec=100ms
NetworkEmulatorDelayJitterSec=13ms
NetworkEmulatorLossRate=20.5%
NetworkEmulatorPacketLimit=200

View File

@@ -1485,15 +1485,16 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
'25-gre-tunnel-remote-any.netdev',
'25-ip6gre-tunnel-remote-any.netdev',
'25-ipv6-address-label-section.network',
'25-link-local-addressing-no.network',
'25-link-local-addressing-yes.network',
'25-link-section-unmanaged.network',
'25-neighbor-section.network',
'25-neighbor-next.network',
'25-neighbor-ipv6.network',
'25-neighbor-ip-dummy.network',
'25-neighbor-ip.network',
'25-nexthop.network',
'25-link-local-addressing-no.network',
'25-link-local-addressing-yes.network',
'25-link-section-unmanaged.network',
'25-qdisc.network',
'25-route-ipv6-src.network',
'25-route-static.network',
'25-gateway-static.network',
@@ -2051,6 +2052,17 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
print(output)
self.assertRegex(output, '192.168.5.1')
def test_qdisc(self):
copy_unit_to_networkd_unit_path('25-qdisc.network', '12-dummy.netdev')
start_networkd()
self.wait_online(['dummy98:routable'])
output = check_output('tc qdisc show dev dummy98')
print(output)
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%')
class NetworkdStateFileTests(unittest.TestCase, Utilities):
links = [
'dummy98',