Commit 059b18e2 authored by Danielle Ratson's avatar Danielle Ratson Committed by David S. Miller

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: default avatarDanielle Ratson <danieller@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1f1c9213
...@@ -30,6 +30,7 @@ trap cleanup EXIT ...@@ -30,6 +30,7 @@ trap cleanup EXIT
ALL_TESTS="router tc_flower mirror_gre tc_police port" ALL_TESTS="router tc_flower mirror_gre tc_police port"
for current_test in ${TESTS:-$ALL_TESTS}; do for current_test in ${TESTS:-$ALL_TESTS}; do
RET_FIN=0
source ${current_test}_scale.sh source ${current_test}_scale.sh
num_netifs_var=${current_test^^}_NUM_NETIFS num_netifs_var=${current_test^^}_NUM_NETIFS
...@@ -48,8 +49,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do ...@@ -48,8 +49,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
else else
log_test "'$current_test' overflow $target" log_test "'$current_test' overflow $target"
fi fi
RET_FIN=$(( RET_FIN || RET ))
done done
done done
current_test="" current_test=""
exit "$RET" exit "$RET_FIN"
...@@ -24,6 +24,7 @@ trap cleanup EXIT ...@@ -24,6 +24,7 @@ trap cleanup EXIT
ALL_TESTS="router tc_flower mirror_gre tc_police port" ALL_TESTS="router tc_flower mirror_gre tc_police port"
for current_test in ${TESTS:-$ALL_TESTS}; do for current_test in ${TESTS:-$ALL_TESTS}; do
RET_FIN=0
source ${current_test}_scale.sh source ${current_test}_scale.sh
num_netifs_var=${current_test^^}_NUM_NETIFS num_netifs_var=${current_test^^}_NUM_NETIFS
...@@ -50,8 +51,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do ...@@ -50,8 +51,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
log_test "'$current_test' [$profile] overflow $target" log_test "'$current_test' [$profile] overflow $target"
fi fi
done done
RET_FIN=$(( RET_FIN || RET ))
done done
done done
current_test="" current_test=""
exit "$RET" exit "$RET_FIN"
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