Skip to contentSkip to conversation

selftests/net/forwarding: configurable seed tests

PATCH Superseded Balaev Pavel 1 participant 1 message Apr 27, 2021

Subsystems (5)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 3/3 selftests/net/forwarding: configurable seed tests

Test equal and different seed values for IPv4/IPv6 multipath routing.

---
 .../testing/selftests/net/forwarding/Makefile |   1 +
 tools/testing/selftests/net/forwarding/lib.sh |  28 ++
 .../net/forwarding/router_mpath_seed.sh       | 347 ++++++++++++++++++
 3 files changed, 376 insertions(+)
 create mode 100755 tools/testing/selftests/net/forwarding/router_mpath_seed.sh
tools/testing/selftests/net/forwarding/Makefile +1 -0
index d97bd6889..080af970c 100644
@@ -38,6 +38,7 @@ TEST_PROGS = bridge_igmp.sh \
 	router_mpath_nh.sh \
 	router_multicast.sh \
 	router_multipath.sh \
+	router_mpath_seed.sh \
 	router.sh \
 	router_vid_1.sh \
 	sch_ets.sh \
tools/testing/selftests/net/forwarding/lib.sh +28 -0
index 42e28c983..b7445b1c5 100644
@@ -10,6 +10,7 @@ PING6=${PING6:=ping6}
 MZ=${MZ:=mausezahn}
 ARPING=${ARPING:=arping}
 TEAMD=${TEAMD:=teamd}
+OPENSSL=${OPENSSL:=openssl}
 WAIT_TIME=${WAIT_TIME:=5}
 PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
 PAUSE_ON_CLEANUP=${PAUSE_ON_CLEANUP:=no}
@@ -698,6 +699,33 @@ link_stats_rx_errors_get()
 	link_stats_get $1 rx errors
 }
 
+ns_link_stats_get()
+{
+	local netns=$1; shift
+	local if_name=$1; shift
+	local dir=$1; shift
+	local stat=$1; shift
+
+	ip netns exec $netns ip -j -s link show dev $if_name \
+		| jq '.[]["stats64"]["'$dir'"]["'$stat'"]'
+}
+
+ns_link_stats_tx_packets_get()
+{
+	local netns=$1; shift
+	local if_name=$1; shift
+
+	ns_link_stats_get $netns $if_name tx packets
+}
+
+ns_link_stats_rx_errors_get()
+{
+	local netns=$1; shift
+	local if_name=$1; shift
+
+	ns_link_stats_get $netns $if_name rx errors
+}
+
 tc_rule_stats_get()
 {
 	local dev=$1; shift
tools/testing/selftests/net/forwarding/router_mpath_seed.sh new file +347 -0

347 lines not on this page · raw message

Signature · 1 line
2.31.1