Skip to content

Commit

Permalink
selftests: mlxsw: Return correct error code in resource scale tests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Danielle Ratson authored and David S. Miller committed Apr 23, 2021
1 parent 1f1c921 commit 059b18e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ trap cleanup EXIT

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

num_netifs_var=${current_test^^}_NUM_NETIFS
Expand All @@ -48,8 +49,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
else
log_test "'$current_test' overflow $target"
fi
RET_FIN=$(( RET_FIN || RET ))
done
done
current_test=""

exit "$RET"
exit "$RET_FIN"
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ trap cleanup EXIT

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

num_netifs_var=${current_test^^}_NUM_NETIFS
Expand All @@ -50,8 +51,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
log_test "'$current_test' [$profile] overflow $target"
fi
done
RET_FIN=$(( RET_FIN || RET ))
done
done
current_test=""

exit "$RET"
exit "$RET_FIN"

0 comments on commit 059b18e

Please sign in to comment.