From: Yu Watanabe Date: Tue, 29 Oct 2019 15:33:19 +0000 (+0900) Subject: test-network: add tests for qdisc X-Git-Tag: v244-rc1~140^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef3c8a92b7332fa9e017afcb5e88f22255eb8d1d;p=thirdparty%2Fsystemd.git test-network: add tests for qdisc --- diff --git a/test/test-network/conf/25-qdisc.network b/test/test-network/conf/25-qdisc.network new file mode 100644 index 00000000000..de8f7243ce8 --- /dev/null +++ b/test/test-network/conf/25-qdisc.network @@ -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 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 1cd623482f2..e9b9fb0d7c1 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -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',