Skip to content

Commit 4d06d37

Browse files
committed
test: fix test_qdisc_tbf regex with iproute2 v6.15
iproute2 v6.15 fixed some rounding errors in the reported stats: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=d947f365602b30657d1b797e7464000d0ab88d5a so the current regex doesn't work anymore. Fix it to check for both old and new values. systemd-networkd-tests.py[523]: FAIL: test_qdisc_tbf (__main__.NetworkdTCTests.test_qdisc_tbf) systemd-networkd-tests.py[523]: ---------------------------------------------------------------------- systemd-networkd-tests.py[523]: Traceback (most recent call last): systemd-networkd-tests.py[523]: File "/usr/lib/systemd/tests/testdata/test-network/systemd-networkd-tests.py", line 5402, in test_qdisc_tbf systemd-networkd-tests.py[523]: self.assertRegex(output, 'rate 1Gbit burst 5000b peakrate 100Gbit minburst 987500b lat 70(.0)?ms') systemd-networkd-tests.py[523]: ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ systemd-networkd-tests.py[523]: AssertionError: Regex didn't match: 'rate 1Gbit burst 5000b peakrate 100Gbit minburst 987500b lat 70(.0)?ms' not found in 'qdisc tbf 35: root refcnt 2 rate 1Gbit burst 5000b peakrate 100Gbit minburst 999200b lat 70ms \nqdisc pfifo 37: parent 35: limit 100000p' (cherry picked from commit f9a85b7) (cherry picked from commit 6e67969b10d111177f72a53f9f7158bf9f14d2a3) (cherry picked from commit 587f84aad9628733d31a9be0ce78f43ba3e1c3d6) (cherry picked from commit 3d68612) (cherry picked from commit ad6db74) (cherry picked from commit f52d795)
1 parent b7c82ff commit 4d06d37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test-network/systemd-networkd-tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3772,7 +3772,7 @@ def test_qdisc_tbf(self):
37723772
output = check_output('tc qdisc show dev dummy98')
37733773
print(output)
37743774
self.assertRegex(output, 'qdisc tbf 35: root')
3775-
self.assertRegex(output, 'rate 1Gbit burst 5000b peakrate 100Gbit minburst 987500b lat 70(.0)?ms')
3775+
self.assertRegex(output, 'rate 1Gbit burst 5000b peakrate 100Gbit minburst (987500b|999200b) lat 70(.0)?ms')
37763776

37773777
@expectedFailureIfModuleIsNotAvailable('sch_teql')
37783778
def test_qdisc_teql(self):

0 commit comments

Comments
 (0)