Skip to content

Commit

Permalink
selftests: mlxsw: Remove a redundant if statement in port_scale test
Browse files Browse the repository at this point in the history
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: 5154b1b ("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>
  • Loading branch information
Danielle Ratson authored and David S. Miller committed Apr 23, 2021
1 parent c8d0260 commit b6fc2f2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tools/testing/selftests/drivers/net/mlxsw/port_scale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

}

0 comments on commit b6fc2f2

Please sign in to comment.