netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next] selftests: forwarding: add tests for TC chain get and dump operations
@ 2018-07-26  9:38 Jiri Pirko
  2018-07-26 16:35 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2018-07-26  9:38 UTC (permalink / raw)
  To: netdev
  Cc: davem, jhs, xiyou.wangcong, jakub.kicinski, simon.horman,
	john.hurley, dsahern, mlxsw, sridhar.samudrala

From: Jiri Pirko <jiri@mellanox.com>

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 tools/testing/selftests/net/forwarding/tc_chains.sh | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tools/testing/selftests/net/forwarding/tc_chains.sh b/tools/testing/selftests/net/forwarding/tc_chains.sh
index 031e322e28b3..2934fb5ed2a2 100755
--- a/tools/testing/selftests/net/forwarding/tc_chains.sh
+++ b/tools/testing/selftests/net/forwarding/tc_chains.sh
@@ -88,9 +88,30 @@ create_destroy_chain()
 	tc chain add dev $h2 ingress
 	check_err $? "Failed to create default chain"
 
+	output="$(tc -j chain get dev $h2 ingress)"
+	check_err $? "Failed to get default chain"
+
+	echo $output | jq -e ".[] | select(.chain == 0)" &> /dev/null
+	check_err $? "Unexpected output for default chain"
+
 	tc chain add dev $h2 ingress chain 1
 	check_err $? "Failed to create chain 1"
 
+	output="$(tc -j chain get dev $h2 ingress chain 1)"
+	check_err $? "Failed to get chain 1"
+
+	echo $output | jq -e ".[] | select(.chain == 1)" &> /dev/null
+	check_err $? "Unexpected output for chain 1"
+
+	output="$(tc -j chain show dev $h2 ingress)"
+	check_err $? "Failed to dump chains"
+
+	echo $output | jq -e ".[] | select(.chain == 0)" &> /dev/null
+	check_err $? "Can't find default chain in dump"
+
+	echo $output | jq -e ".[] | select(.chain == 1)" &> /dev/null
+	check_err $? "Can't find chain 1 in dump"
+
 	tc chain del dev $h2 ingress
 	check_err $? "Failed to destroy default chain"
 
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch net-next] selftests: forwarding: add tests for TC chain get and dump operations
  2018-07-26  9:38 [patch net-next] selftests: forwarding: add tests for TC chain get and dump operations Jiri Pirko
@ 2018-07-26 16:35 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-07-26 16:35 UTC (permalink / raw)
  To: jiri
  Cc: netdev, jhs, xiyou.wangcong, jakub.kicinski, simon.horman,
	john.hurley, dsahern, mlxsw, sridhar.samudrala

From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 26 Jul 2018 11:38:34 +0200

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Applied, thanks Jiri.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-26 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-26  9:38 [patch net-next] selftests: forwarding: add tests for TC chain get and dump operations Jiri Pirko
2018-07-26 16:35 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).