mirror of
https://github.com/torvalds/linux.git
synced 2026-05-21 21:37:25 +02:00
selftests: mlxsw: resource_scale: Update scale target after test setup
The scale of each resource is tested in the following manner: 1. The scale target is queried. 2. The test setup is prepared. 3. The test is invoked. In some cases, the occupancy of a resource changes as part of the second step, requiring the test to return a scale target that takes this change into account. Make this more robust by re-querying the scale target after the second step. Another possible solution is to swap the first and second steps, but when a test needs to be skipped (i.e., scale target is zero), the setup would have been in vain. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e386a527fc
commit
d3ffeb2dba
|
|
@ -38,6 +38,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
|
|||
target=$(${current_test}_get_target "$should_fail")
|
||||
${current_test}_setup_prepare
|
||||
setup_wait $num_netifs
|
||||
# Update target in case occupancy of a certain resource changed
|
||||
# following the test setup.
|
||||
target=$(${current_test}_get_target "$should_fail")
|
||||
${current_test}_test "$target" "$should_fail"
|
||||
${current_test}_cleanup
|
||||
devlink_reload
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
|
|||
target=$(${current_test}_get_target "$should_fail")
|
||||
${current_test}_setup_prepare
|
||||
setup_wait $num_netifs
|
||||
# Update target in case occupancy of a certain resource
|
||||
# changed following the test setup.
|
||||
target=$(${current_test}_get_target "$should_fail")
|
||||
${current_test}_test "$target" "$should_fail"
|
||||
${current_test}_cleanup
|
||||
if [[ "$should_fail" -eq 0 ]]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user