Skip to content

Commit eef6ab8

Browse files
pmachatadavem330
authored andcommitted
selftests: mlxsw: qos_dscp_bridge: Fix
There are two problems in this test case: - When indexing in bash associative array, the subscript is interpreted as string, not as a variable name to be expanded. - The keys stored to t0s and t1s are not DSCP values, but priority + base (i.e. the logical DSCP value, not the full bitfield value). In combination these two bugs conspire to make the test just work, except it doesn't really test anything and always passes. Fix the above two problems in obvious manner. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 720516b commit eef6ab8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,13 @@ dscp_ping_test()
217217

218218
for key in ${!t0s[@]}; do
219219
local expect
220-
if ((key == dscp_10 || key == dscp_20)); then
220+
if ((key == prio+10 || key == prio+20)); then
221221
expect=10
222222
else
223223
expect=0
224224
fi
225225

226-
local delta=$((t1s[key] - t0s[key]))
226+
local delta=$((t1s[$key] - t0s[$key]))
227227
((expect == delta))
228228
check_err $? "DSCP $key: Expected to capture $expect packets, got $delta."
229229
done

0 commit comments

Comments
 (0)