All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, <mlxsw@nvidia.com>,
	Ido Schimmel <idosch@nvidia.com>,
	Danielle Ratson <danieller@nvidia.com>,
	Jiri Pirko <jiri@nvidia.com>, "Petr Machata" <petrm@nvidia.com>
Subject: [PATCH net-next 3/6] selftests: mlxsw: Remove a redundant if statement in tc_flower_scale test
Date: Fri, 23 Apr 2021 14:19:45 +0200	[thread overview]
Message-ID: <898eb9e5bb2cc8ed82e7f5b5458befef96bb2ff4.1619179926.git.petrm@nvidia.com> (raw)
In-Reply-To: <cover.1619179926.git.petrm@nvidia.com>

From: Danielle Ratson <danieller@nvidia.com>

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: abfce9e062021 ("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>
---
 .../testing/selftests/drivers/net/mlxsw/tc_flower_scale.sh  | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/mlxsw/tc_flower_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/tc_flower_scale.sh
index cc0f07e72cf2..aa74be9f47c8 100644
--- a/tools/testing/selftests/drivers/net/mlxsw/tc_flower_scale.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/tc_flower_scale.sh
@@ -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()
-- 
2.26.2


  parent reply	other threads:[~2021-04-23 12:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 12:19 [PATCH net-next 0/6] selftests: mlxsw: Fixes Petr Machata
2021-04-23 12:19 ` [PATCH net-next 1/6] selftests: net: mirror_gre_vlan_bridge_1q: Make an FDB entry static Petr Machata
2021-04-23 12:19 ` [PATCH net-next 2/6] selftests: mlxsw: Remove a redundant if statement in port_scale test Petr Machata
2021-04-23 12:19 ` Petr Machata [this message]
2021-04-23 12:19 ` [PATCH net-next 4/6] selftests: mlxsw: Return correct error code in resource scale tests Petr Machata
2021-04-23 12:19 ` [PATCH net-next 5/6] selftests: mlxsw: Increase the tolerance of backlog buildup Petr Machata
2021-04-23 12:19 ` [PATCH net-next 6/6] selftests: mlxsw: Fix mausezahn invocation in ERSPAN scale test Petr Machata
2021-04-23 21:10 ` [PATCH net-next 0/6] selftests: mlxsw: Fixes patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=898eb9e5bb2cc8ed82e7f5b5458befef96bb2ff4.1619179926.git.petrm@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=danieller@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.