diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-03-11 14:48:10 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-03-12 07:34:46 +0100 |
commit | be94e591fb9518638c3ece2ea21ac94ce97d28fd (patch) | |
tree | de98dba5a63874de4fe0f63d8489acdb50beb3c9 /test | |
parent | network: tc- introduce PIE (diff) | |
download | systemd-be94e591fb9518638c3ece2ea21ac94ce97d28fd.tar.xz systemd-be94e591fb9518638c3ece2ea21ac94ce97d28fd.zip |
test-network: add test case for PIE
Diffstat (limited to 'test')
-rw-r--r-- | test/test-network/conf/25-qdisc-pie.network | 11 | ||||
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 24 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/test-network/conf/25-qdisc-pie.network b/test/test-network/conf/25-qdisc-pie.network new file mode 100644 index 0000000000..d41ceba3ef --- /dev/null +++ b/test/test-network/conf/25-qdisc-pie.network @@ -0,0 +1,11 @@ +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Address=10.1.2.3/16 + +[PIE] +Parent=root +Handle=3a +PacketLimit=200000 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index fb0048b3e6..e5f75296b9 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -169,6 +169,18 @@ def expectedFailureIfCAKEIsNotAvailable(): return f +def expectedFailureIfPIEIsNotAvailable(): + def f(func): + call('ip link add dummy98 type dummy', stderr=subprocess.DEVNULL) + rc = call('tc qdisc add dev dummy98 parent root pie', stderr=subprocess.DEVNULL) + call('ip link del dummy98', stderr=subprocess.DEVNULL) + if rc == 0: + return func + else: + return unittest.expectedFailure(func) + + return f + def setUpModule(): global running_units @@ -1636,6 +1648,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): '25-qdisc-cake.network', '25-qdisc-clsact-and-htb.network', '25-qdisc-ingress-netem-compat.network', + '25-qdisc-pie.network', '25-route-ipv6-src.network', '25-route-static.network', '25-route-vrf.network', @@ -2342,6 +2355,17 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, 'bandwidth 500Mbit') self.assertRegex(output, 'overhead 128') + @expectedFailureIfPIEIsNotAvailable() + def test_qdisc_pie(self): + copy_unit_to_networkd_unit_path('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') + class NetworkdStateFileTests(unittest.TestCase, Utilities): links = [ 'dummy98', |