summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDanielle Ratson <danieller@nvidia.com>2021-04-23 14:19:44 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-14 10:53:03 +0200
commit92aa8a27b47069c069ed7cc6373903d072b84462 (patch)
treed2c4edb0c904733ec1f278a89297b0dcd14cd3c5 /tools
parent8334e4fbe50ab139399fec4902fbb00125b4763a (diff)
downloadlinux-92aa8a27b47069c069ed7cc6373903d072b84462.tar.gz
linux-92aa8a27b47069c069ed7cc6373903d072b84462.tar.bz2
linux-92aa8a27b47069c069ed7cc6373903d072b84462.zip
selftests: mlxsw: Remove a redundant if statement in port_scale test
[ Upstream commit b6fc2f212108b3676f54d00a2c38e3bc36753980 ] Currently, the error return code of the failure condition is lost after using an if statement, so the test doesn't fail when it should. Remove the if statement that separates the condition and the error code check, so the test won't always pass. Fixes: 5154b1b826d9b ("selftests: mlxsw: Add a scale test for physical ports") Reported-by: Ido Schimmel <idosch@nvidia.com> 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/drivers/net/mlxsw/port_scale.sh6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/testing/selftests/drivers/net/mlxsw/port_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/port_scale.sh
index f813ffefc07e..65f43a7ce9c9 100644
--- a/tools/testing/selftests/drivers/net/mlxsw/port_scale.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/port_scale.sh
@@ -55,10 +55,6 @@ port_test()
| jq '.[][][] | select(.name=="physical_ports") |.["occ"]')
[[ $occ -eq $max_ports ]]
- if [[ $should_fail -eq 0 ]]; then
- check_err $? "Mismatch ports number: Expected $max_ports, got $occ."
- else
- check_err_fail $should_fail $? "Reached more ports than expected"
- fi
+ check_err_fail $should_fail $? "Attempt to create $max_ports ports (actual result $occ)"
}