Skip to content

Commit 196f9bc

Browse files
Amit Cohenkuba-moo
authored andcommitted
selftests: mlxsw: resource_scale: Fix return value
The test runs several test cases and is supposed to return an error in case at least one of them failed. Currently, the check of the return value of each test case is in the wrong place, which can result in the wrong return value. For example: # TESTS='tc_police' ./resource_scale.sh TEST: 'tc_police' [default] 968 [FAIL] tc police offload count failed Error: mlxsw_spectrum: Failed to allocate policer index. We have an error talking to the kernel Command failed /tmp/tmp.i7Oc5HwmXY:969 TEST: 'tc_police' [default] overflow 969 [ OK ] ... TEST: 'tc_police' [ipv4_max] overflow 969 [ OK ] $ echo $? 0 Fix this by moving the check to be done after each test case. Fixes: 059b18e ("selftests: mlxsw: Return correct error code in resource scale test") Signed-off-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent dc97520 commit 196f9bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
5050
else
5151
log_test "'$current_test' [$profile] overflow $target"
5252
fi
53+
RET_FIN=$(( RET_FIN || RET ))
5354
done
54-
RET_FIN=$(( RET_FIN || RET ))
5555
done
5656
done
5757
current_test=""

0 commit comments

Comments
 (0)