Commit dfa40b7
tests: Fix QoS tests for tc rounding behavior change.
The tc command from iproute2 changed its rounding behavior in commit
d947f365602b ("tc: Fix rounding in tc_calc_xmittime and tc_calc_xmitsize.").
This caused the "QoS - basic configuration", "QoS - 64bit" and
"Ingress Policing - 64-bit" tests to fail because they were matching exact
burst and cburst values in tc output.
For consistency and as a proactive measure in case of further changes to
tc, the following tests are also updated, although they are currently not
directly affected:
"offloads - set ingress_policing_rate and ingress_policing_burst - offloads disabled"
"offloads - set ingress_policing_rate and ingress_policing_burst - offloads enabled"
The rounding fix means that burst and cburst values may differ slightly
from previous versions. For example, values that were previously 750000
might now be 749999 or similar variations.
To maintain compatibility with both old and new versions of tc, the test
assertions now use pattern matching with dots that:
- Matches the most significant digit of the value
- Uses dots to match any character for remaining digits
- Maintains the correct total number of digits
- Preserves the unit suffix (e.g., 'b' for bytes)
For example, '375000b' now matches '3.....b' which accepts any 6-digit
value starting with 3, allowing for rounding differences while still
validating the general magnitude is correct.
This follows the same approach as the related OVN patch:
https://mail.openvswitch.org/pipermail/ovs-dev/2025-December/428593.html
Reported-at: https://launchpad.net/bugs/2129005
Assisted-by: claude-sonnet-4.5, GitHub Copilot CLI
Signed-off-by: Frode Nordahl <fnordahl@ubuntu.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>1 parent c682d7c commit dfa40b7
2 files changed
+12
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
109 | 110 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 111 | + | |
| 112 | + | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
| 130 | + | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 132 | + | |
| 133 | + | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3242 | 3242 | | |
3243 | 3243 | | |
3244 | 3244 | | |
3245 | | - | |
3246 | | - | |
| 3245 | + | |
| 3246 | + | |
3247 | 3247 | | |
3248 | 3248 | | |
3249 | 3249 | | |
| |||
3273 | 3273 | | |
3274 | 3274 | | |
3275 | 3275 | | |
3276 | | - | |
| 3276 | + | |
3277 | 3277 | | |
3278 | 3278 | | |
3279 | 3279 | | |
| |||
3290 | 3290 | | |
3291 | 3291 | | |
3292 | 3292 | | |
| 3293 | + | |
3293 | 3294 | | |
3294 | | - | |
3295 | | - | |
3296 | | - | |
| 3295 | + | |
| 3296 | + | |
3297 | 3297 | | |
3298 | 3298 | | |
3299 | 3299 | | |
| |||
0 commit comments