提交 637f6269 编写于 作者: D Danielle Ratson 提交者: Zheng Zengkai

selftests: mlxsw: Remove a redundant if statement in tc_flower_scale test

stable inclusion
from stable-5.10.37
commit 1625872f012c8ccdcbd77ed14102f9f4cb6ed907
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit 1f1c9213 ]

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: abfce9e0 ("selftests: mlxsw: Reduce running time using offload indication")
Reported-by: NIdo Schimmel <idosch@nvidia.com>
Signed-off-by: NDanielle Ratson <danieller@nvidia.com>
Reviewed-by: NPetr Machata <petrm@nvidia.com>
Signed-off-by: NPetr Machata <petrm@nvidia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 363d7c84
......@@ -98,11 +98,7 @@ __tc_flower_test()
jq -r '[ .[] | select(.kind == "flower") |
.options | .in_hw ]' | jq .[] | wc -l)
[[ $((offload_count - 1)) -eq $count ]]
if [[ $should_fail -eq 0 ]]; then
check_err $? "Offload mismatch"
else
check_err_fail $should_fail $? "Offload more than expacted"
fi
check_err_fail $should_fail $? "Attempt to offload $count rules (actual result $((offload_count - 1)))"
}
tc_flower_test()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册