mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-27 14:03:43 +03:00
test-network: add test case for PIE
This commit is contained in:
parent
bde4ae88c8
commit
be94e591fb
11
test/test-network/conf/25-qdisc-pie.network
Normal file
11
test/test-network/conf/25-qdisc-pie.network
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Match]
|
||||||
|
Name=dummy98
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
IPv6AcceptRA=no
|
||||||
|
Address=10.1.2.3/16
|
||||||
|
|
||||||
|
[PIE]
|
||||||
|
Parent=root
|
||||||
|
Handle=3a
|
||||||
|
PacketLimit=200000
|
@ -169,6 +169,18 @@ def expectedFailureIfCAKEIsNotAvailable():
|
|||||||
|
|
||||||
return f
|
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():
|
def setUpModule():
|
||||||
global running_units
|
global running_units
|
||||||
|
|
||||||
@ -1636,6 +1648,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
|||||||
'25-qdisc-cake.network',
|
'25-qdisc-cake.network',
|
||||||
'25-qdisc-clsact-and-htb.network',
|
'25-qdisc-clsact-and-htb.network',
|
||||||
'25-qdisc-ingress-netem-compat.network',
|
'25-qdisc-ingress-netem-compat.network',
|
||||||
|
'25-qdisc-pie.network',
|
||||||
'25-route-ipv6-src.network',
|
'25-route-ipv6-src.network',
|
||||||
'25-route-static.network',
|
'25-route-static.network',
|
||||||
'25-route-vrf.network',
|
'25-route-vrf.network',
|
||||||
@ -2342,6 +2355,17 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
|||||||
self.assertRegex(output, 'bandwidth 500Mbit')
|
self.assertRegex(output, 'bandwidth 500Mbit')
|
||||||
self.assertRegex(output, 'overhead 128')
|
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):
|
class NetworkdStateFileTests(unittest.TestCase, Utilities):
|
||||||
links = [
|
links = [
|
||||||
'dummy98',
|
'dummy98',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user