mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-25 06:03:40 +03:00
test-network: add tests for ETS
This commit is contained in:
parent
d474aa51bf
commit
b753e8358c
20
test/test-network/conf/25-qdisc-ets.network
Normal file
20
test/test-network/conf/25-qdisc-ets.network
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[Match]
|
||||||
|
Name=dummy98
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
IPv6AcceptRA=no
|
||||||
|
Address=10.1.2.3/16
|
||||||
|
|
||||||
|
[EnhancedTransmissionSelection]
|
||||||
|
Parent=root
|
||||||
|
Handle=3a
|
||||||
|
Bands=10
|
||||||
|
StrictBands=3
|
||||||
|
QuantumBytes=2 4 6
|
||||||
|
QuantumBytes=
|
||||||
|
QuantumBytes=1 2 3
|
||||||
|
QuantumBytes=4 5
|
||||||
|
PriorityMap=8 7 6 5
|
||||||
|
PriorityMap=
|
||||||
|
PriorityMap=3 4 5
|
||||||
|
PriorityMap=6 7
|
@ -194,6 +194,18 @@ def expectedFailureIfHHFIsNotAvailable():
|
|||||||
|
|
||||||
return f
|
return f
|
||||||
|
|
||||||
|
def expectedFailureIfETSIsNotAvailable():
|
||||||
|
def f(func):
|
||||||
|
call('ip link add dummy98 type dummy', stderr=subprocess.DEVNULL)
|
||||||
|
rc = call('tc qdisc add dev dummy98 parent root ets bands 10', 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
|
||||||
|
|
||||||
@ -1673,6 +1685,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-drr.network',
|
'25-qdisc-drr.network',
|
||||||
|
'25-qdisc-ets.network',
|
||||||
'25-qdisc-hhf.network',
|
'25-qdisc-hhf.network',
|
||||||
'25-qdisc-ingress-netem-compat.network',
|
'25-qdisc-ingress-netem-compat.network',
|
||||||
'25-qdisc-pie.network',
|
'25-qdisc-pie.network',
|
||||||
@ -2480,6 +2493,19 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
|||||||
self.assertRegex(output, 'qdisc hhf 3a: root')
|
self.assertRegex(output, 'qdisc hhf 3a: root')
|
||||||
self.assertRegex(output, 'limit 1022p')
|
self.assertRegex(output, 'limit 1022p')
|
||||||
|
|
||||||
|
@expectedFailureIfETSIsNotAvailable()
|
||||||
|
def test_qdisc_ets(self):
|
||||||
|
copy_unit_to_networkd_unit_path('25-qdisc-ets.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 ets 3a: root')
|
||||||
|
self.assertRegex(output, 'bands 10 strict 3')
|
||||||
|
self.assertRegex(output, 'quanta 1 2 3 4 5')
|
||||||
|
self.assertRegex(output, 'priomap 3 4 5 6 7')
|
||||||
|
|
||||||
class NetworkdStateFileTests(unittest.TestCase, Utilities):
|
class NetworkdStateFileTests(unittest.TestCase, Utilities):
|
||||||
links = [
|
links = [
|
||||||
'dummy98',
|
'dummy98',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user