Commit eef6ab8b authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

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: default avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 720516b1
......@@ -217,13 +217,13 @@ dscp_ping_test()
for key in ${!t0s[@]}; do
local expect
if ((key == dscp_10 || key == dscp_20)); then
if ((key == prio+10 || key == prio+20)); then
expect=10
else
expect=0
fi
local delta=$((t1s[key] - t0s[key]))
local delta=$((t1s[$key] - t0s[$key]))
((expect == delta))
check_err $? "DSCP $key: Expected to capture $expect packets, got $delta."
done
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment