linux-samsung-r9q2/tools/testing/selftests/drivers/net/mlxsw/spectrum
Amit Cohen 196f9bc050 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: 059b18e21c ("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>
2022-03-03 08:14:01 -08:00
..
devlink_lib_spectrum.sh selftests: mlxsw: Add helpers for skipping selftests 2021-10-25 14:10:11 +01:00
devlink_resources.sh selftests: forwarding: devlink_lib: Avoid double sourcing of lib.sh 2019-03-28 17:20:52 -07:00
mirror_gre_scale.sh selftests: mlxsw: Generalize the parameters of mirror_gre test 2019-10-18 10:05:37 -07:00
port_scale.sh selftests: mlxsw: Add a scale test for physical ports 2021-01-22 20:42:13 -08:00
q_in_vni_veto.sh selftests: mlxsw: Add Q-in-VNI veto tests 2020-12-08 15:45:57 -08:00
resource_scale.sh selftests: mlxsw: resource_scale: Fix return value 2022-03-03 08:14:01 -08:00
rif_mac_profile_scale.sh selftests: mlxsw: Add a scale test for RIF MAC profiles 2021-10-26 13:35:58 +01:00
router_scale.sh selftests: mlxsw: Add target for router test on spectrum 2018-06-30 22:06:15 +09:00
tc_flower_scale.sh selftests: mlxsw: Add target for tc flower test on spectrum 2018-06-30 22:06:15 +09:00
tc_police_scale.sh selftests: mlxsw: Add scale test for tc-police 2020-07-15 18:10:00 -07:00
vxlan_flooding_ipv6.sh selftests: mlxsw: spectrum: Add a test for VxLAN flooding with IPv6 2021-12-23 11:24:01 +00:00