Commit 26281e2c authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'selftests-Various-fixes'



Petr Machata says:

====================
selftests: Various fixes

This patch set contains various fixes whose common denominator is
improving quality of forwarding and mlxsw selftests.

Most of the fixes are improvements in determinism (such that timing and
latency don't impact the test performance). These were prompted by
regular runs of the test suite on a hardware emulator, the performance
of which is necessarily lower than that of the real device.

Patches #1 (from Ido), #2 and #3 make changes to ping limits.

Patches #4 and #5 add more sleep in places where things need more time
to finish.

Patches #6 and #7 fix two tests in the suite of mirror-to-gretap tests
where underlay involves a VLAN device over an 802.1q bridge.

Patches #8, #9 and #10 fix bugs in mirror-to-gretap test where underlay
involves a LAG device.

Patch #11 fixes a missed RET initialization in mirror-to-gretap flower
test.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3fc46fc9 084fafe9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -148,9 +148,10 @@ dscp_ping_test()
	eval "t0s=($(dscp_fetch_stats $dev_10 10)
		   $(dscp_fetch_stats $dev_20 20))"

	local ping_timeout=$((PING_TIMEOUT * 5))
	ip vrf exec $vrf_name \
	   ${PING} -Q $dscp_10 ${sip:+-I $sip} $dip \
		   -c 10 -i 0.1 -w 2 &> /dev/null
		   -c 10 -i 0.5 -w $ping_timeout &> /dev/null

	local -A t1s
	eval "t1s=($(dscp_fetch_stats $dev_10 10)
+2 −1
Original line number Diff line number Diff line
@@ -169,9 +169,10 @@ dscp_ping_test()
	eval "local -A dev1_t0s=($(dscp_fetch_stats $dev1 0))"
	eval "local -A dev2_t0s=($(dscp_fetch_stats $dev2 0))"

	local ping_timeout=$((PING_TIMEOUT * 5))
	ip vrf exec $vrf_name \
	   ${PING} -Q $dscp ${sip:+-I $sip} $dip \
		   -c 10 -i 0.1 -w 2 &> /dev/null
		   -c 10 -i 0.5 -w $ping_timeout &> /dev/null

	eval "local -A dev1_t1s=($(dscp_fetch_stats $dev1 0))"
	eval "local -A dev2_t1s=($(dscp_fetch_stats $dev2 0))"
+3 −0
Original line number Diff line number Diff line
@@ -33,3 +33,6 @@ PAUSE_ON_CLEANUP=no
NETIF_TYPE=veth
# Whether to create virtual interfaces (veth) or not
NETIF_CREATE=yes
# Timeout (in seconds) before ping exits regardless of how many packets have
# been sent or received
PING_TIMEOUT=5
+5 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ NETIF_TYPE=${NETIF_TYPE:=veth}
NETIF_CREATE=${NETIF_CREATE:=yes}
MCD=${MCD:=smcrouted}
MC_CLI=${MC_CLI:=smcroutectl}
PING_TIMEOUT=${PING_TIMEOUT:=5}

relative_path="${BASH_SOURCE%/*}"
if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then
@@ -820,7 +821,8 @@ ping_do()
	local vrf_name

	vrf_name=$(master_name_get $if_name)
	ip vrf exec $vrf_name $PING $args $dip -c 10 -i 0.1 -w 2 &> /dev/null
	ip vrf exec $vrf_name \
		$PING $args $dip -c 10 -i 0.1 -w $PING_TIMEOUT &> /dev/null
}

ping_test()
@@ -840,7 +842,8 @@ ping6_do()
	local vrf_name

	vrf_name=$(master_name_get $if_name)
	ip vrf exec $vrf_name $PING6 $args $dip -c 10 -i 0.1 -w 2 &> /dev/null
	ip vrf exec $vrf_name \
		$PING6 $args $dip -c 10 -i 0.1 -w $PING_TIMEOUT &> /dev/null
}

ping6_test()
+10 −1
Original line number Diff line number Diff line
@@ -190,6 +190,8 @@ setup_prepare()
	h4_create
	switch_create

	forwarding_enable

	trap_install $h3 ingress
	trap_install $h4 ingress
}
@@ -201,6 +203,8 @@ cleanup()
	trap_uninstall $h4 ingress
	trap_uninstall $h3 ingress

	forwarding_restore

	switch_destroy
	h4_destroy
	h3_destroy
@@ -220,11 +224,15 @@ test_lag_slave()

	RET=0

	tc filter add dev $swp1 ingress pref 999 \
		proto 802.1q flower vlan_ethtype arp $tcflags \
		action pass
	mirror_install $swp1 ingress gt4 \
		"proto 802.1q flower vlan_id 333 $tcflags"

	# Test connectivity through $up_dev when $down_dev is set down.
	ip link set dev $down_dev down
	ip neigh flush dev br1
	setup_wait_dev $up_dev
	setup_wait_dev $host_dev
	$ARPING -I br1 192.0.2.130 -qfc 1
@@ -240,6 +248,7 @@ test_lag_slave()
	ip link set dev $up_dev up
	ip link set dev $down_dev up
	mirror_uninstall $swp1 ingress
	tc filter del dev $swp1 ingress pref 999

	log_test "$what ($tcflags)"
}
Loading