Commit e8604196 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

selftests: mlxsw: Reduce test run time

Instead of iterating over all the available trap policers, only perform
the tests with three policers: The first, the last and the one in the
middle of the range. On a Spectrum-3 system, this reduces the run time
from almost an hour to a few minutes.
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 535ac9a5
...@@ -272,13 +272,17 @@ __rate_test() ...@@ -272,13 +272,17 @@ __rate_test()
rate_test() rate_test()
{ {
local id local last_policer=$(devlink -j -p trap policer show |
jq '[.[]["'$DEVLINK_DEV'"][].policer] | max')
for id in $(devlink_trap_policer_ids_get); do log_info "Running rate test for policer 1"
echo __rate_test 1
log_info "Running rate test for policer $id"
__rate_test $id log_info "Running rate test for policer $((last_policer / 2))"
done __rate_test $((last_policer / 2))
log_info "Running rate test for policer $last_policer"
__rate_test $last_policer
} }
__burst_test() __burst_test()
...@@ -342,13 +346,17 @@ __burst_test() ...@@ -342,13 +346,17 @@ __burst_test()
burst_test() burst_test()
{ {
local id local last_policer=$(devlink -j -p trap policer show |
jq '[.[]["'$DEVLINK_DEV'"][].policer] | max')
log_info "Running burst test for policer 1"
__burst_test 1
log_info "Running burst test for policer $((last_policer / 2))"
__burst_test $((last_policer / 2))
for id in $(devlink_trap_policer_ids_get); do log_info "Running burst test for policer $last_policer"
echo __burst_test $last_policer
log_info "Running burst size test for policer $id"
__burst_test $id
done
} }
trap cleanup EXIT trap cleanup EXIT
......
...@@ -563,12 +563,6 @@ devlink_trap_group_policer_get() ...@@ -563,12 +563,6 @@ devlink_trap_group_policer_get()
| jq '.[][][]["policer"]' | jq '.[][][]["policer"]'
} }
devlink_trap_policer_ids_get()
{
devlink -j -p trap policer show \
| jq '.[]["'$DEVLINK_DEV'"][]["policer"]'
}
devlink_port_by_netdev() devlink_port_by_netdev()
{ {
local if_name=$1 local if_name=$1
......
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