svn commit: r361701 - head/tests/sys/net

Kristof Provost kp at FreeBSD.org
Mon Jun 1 19:26:16 UTC 2020


Author: kp
Date: Mon Jun  1 19:26:16 2020
New Revision: 361701
URL: https://svnweb.freebsd.org/changeset/base/361701

Log:
  bridge tests: Avoid building a switching loop
  
  Enable STP before bringing the bridges up. This avoids a switching loop,
  which has a tendency to drown out progress in userspace processes,
  especially on single-core systems.
  
  Only check that we have indeed shut down one of the looped interfaces
  
  PR:		246448
  Reviewed by:	melifaro
  Differential Revision:	https://reviews.freebsd.org/D25084

Modified:
  head/tests/sys/net/if_bridge_test.sh

Modified: head/tests/sys/net/if_bridge_test.sh
==============================================================================
--- head/tests/sys/net/if_bridge_test.sh	Mon Jun  1 18:58:09 2020	(r361700)
+++ head/tests/sys/net/if_bridge_test.sh	Mon Jun  1 19:26:16 2020	(r361701)
@@ -72,7 +72,6 @@ stp_head()
 {
 	atf_set descr 'Spanning tree test'
 	atf_set require.user root
-	atf_set require.progs jq
 }
 
 stp_body()
@@ -91,13 +90,11 @@ stp_body()
 	vnet_mkjail a ${bridge_a} ${epair_one}a ${epair_two}a
 	vnet_mkjail b ${bridge_b} ${epair_one}b ${epair_two}b
 
-	jexec a ifconfig ${bridge_a} up
 	jexec a ifconfig ${epair_one}a up
 	jexec a ifconfig ${epair_two}a up
 	jexec a ifconfig ${bridge_a} addm ${epair_one}a
 	jexec a ifconfig ${bridge_a} addm ${epair_two}a
 
-	jexec b ifconfig ${bridge_b} up
 	jexec b ifconfig ${epair_one}b up
 	jexec b ifconfig ${epair_two}b up
 	jexec b ifconfig ${bridge_b} addm ${epair_one}b
@@ -105,22 +102,14 @@ stp_body()
 
 	jexec a ifconfig ${bridge_a} 192.0.2.1/24
 
-	# Give the interfaces some time to come up and pass some traffic
-	sleep 5
-
-	# Confirm that there's looping traffic
-	nbr=$(jexec a netstat -I ${bridge_a} --libxo json \
-		| jq ".statistics.interface[0].\"received-packets\"")
-	if [ ${nbr} -lt 100 ]
-	then
-		atf_fail "Expected bridging loop, but found very few packets."
-	fi
-
 	# Enable spanning tree
 	jexec a ifconfig ${bridge_a} stp ${epair_one}a
 	jexec a ifconfig ${bridge_a} stp ${epair_two}a
 	jexec b ifconfig ${bridge_b} stp ${epair_one}b
 	jexec b ifconfig ${bridge_b} stp ${epair_two}b
+
+	jexec b ifconfig ${bridge_b} up
+	jexec a ifconfig ${bridge_a} up
 
 	# Give STP time to do its thing
 	sleep 5


More information about the svn-src-head mailing list