Skip to content

Commit 1625872

Browse files
daniellertsgregkh
authored andcommitted
selftests: mlxsw: Remove a redundant if statement in tc_flower_scale test
[ Upstream commit 1f1c921 ] 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: abfce9e ("selftests: mlxsw: Reduce running time using offload indication") 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>
1 parent 8ebdce8 commit 1625872

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

tools/testing/selftests/drivers/net/mlxsw/tc_flower_scale.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,7 @@ __tc_flower_test()
9898
jq -r '[ .[] | select(.kind == "flower") |
9999
.options | .in_hw ]' | jq .[] | wc -l)
100100
[[ $((offload_count - 1)) -eq $count ]]
101-
if [[ $should_fail -eq 0 ]]; then
102-
check_err $? "Offload mismatch"
103-
else
104-
check_err_fail $should_fail $? "Offload more than expacted"
105-
fi
101+
check_err_fail $should_fail $? "Attempt to offload $count rules (actual result $((offload_count - 1)))"
106102
}
107103

108104
tc_flower_test()

0 commit comments

Comments
 (0)