mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
test-network: add tests for qdisc
This commit is contained in:
20
test/test-network/conf/25-qdisc.network
Normal file
20
test/test-network/conf/25-qdisc.network
Normal 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
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user