Skip to content

Commit 059b18e

Browse files
daniellertsdavem330
authored andcommitted
selftests: mlxsw: Return correct error code in resource scale tests
Currently, the resource scale test checks a few cases, when the error code resets between the cases. So for example, if one case fails and the consecutive case passes, the error code eventually will fit the last test and will be 0. Save a new return code that will hold the 'or' return codes of all the cases, so the final return code will consider all the cases. Signed-off-by: Danielle Ratson <danieller@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1f1c921 commit 059b18e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ trap cleanup EXIT
3030

3131
ALL_TESTS="router tc_flower mirror_gre tc_police port"
3232
for current_test in ${TESTS:-$ALL_TESTS}; do
33+
RET_FIN=0
3334
source ${current_test}_scale.sh
3435

3536
num_netifs_var=${current_test^^}_NUM_NETIFS
@@ -48,8 +49,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
4849
else
4950
log_test "'$current_test' overflow $target"
5051
fi
52+
RET_FIN=$(( RET_FIN || RET ))
5153
done
5254
done
5355
current_test=""
5456

55-
exit "$RET"
57+
exit "$RET_FIN"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ trap cleanup EXIT
2424

2525
ALL_TESTS="router tc_flower mirror_gre tc_police port"
2626
for current_test in ${TESTS:-$ALL_TESTS}; do
27+
RET_FIN=0
2728
source ${current_test}_scale.sh
2829

2930
num_netifs_var=${current_test^^}_NUM_NETIFS
@@ -50,8 +51,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
5051
log_test "'$current_test' [$profile] overflow $target"
5152
fi
5253
done
54+
RET_FIN=$(( RET_FIN || RET ))
5355
done
5456
done
5557
current_test=""
5658

57-
exit "$RET"
59+
exit "$RET_FIN"

0 commit comments

Comments
 (0)