Browse Source

selftests: forwarding: tc_rule_stats_get: Parameterize direction

The GRE multipath tests need stats on an egress counter. Change
tc_rule_stats_get() to take direction as an optional argument, with
default of ingress.

Take the opportunity to change line continuation character from | to \.
Move the | to the next line, which indent.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata 7 years ago
parent
commit
a66d62d842
1 changed files with 3 additions and 2 deletions
  1. 3 2
      tools/testing/selftests/net/forwarding/lib.sh

+ 3 - 2
tools/testing/selftests/net/forwarding/lib.sh

@@ -383,9 +383,10 @@ tc_rule_stats_get()
 {
 {
 	local dev=$1; shift
 	local dev=$1; shift
 	local pref=$1; shift
 	local pref=$1; shift
+	local dir=$1; shift
 
 
-	tc -j -s filter show dev $dev ingress pref $pref |
-	jq '.[1].options.actions[].stats.packets'
+	tc -j -s filter show dev $dev ${dir:-ingress} pref $pref \
+	    | jq '.[1].options.actions[].stats.packets'
 }
 }
 
 
 mac_get()
 mac_get()