mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	Merge branch 'selftests-net-more-pmtu-sh-fixes'
Paolo Abeni says: ==================== selftests: net: more pmtu.sh fixes The mentioned test is still flaky, unusally enough in 'fast' environments. Patch 2/2 [try to] address the existing issues, while patch 1/2 introduces more strict tests for the existing net helpers, to hopefully prevent future pain. ==================== Link: https://lore.kernel.org/r/cover.1707731086.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
		
						commit
						1e41f11f08
					
				
					 2 changed files with 9 additions and 6 deletions
				
			
		| 
						 | 
					@ -8,13 +8,16 @@ wait_local_port_listen()
 | 
				
			||||||
	local listener_ns="${1}"
 | 
						local listener_ns="${1}"
 | 
				
			||||||
	local port="${2}"
 | 
						local port="${2}"
 | 
				
			||||||
	local protocol="${3}"
 | 
						local protocol="${3}"
 | 
				
			||||||
	local port_hex
 | 
						local pattern
 | 
				
			||||||
	local i
 | 
						local i
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	port_hex="$(printf "%04X" "${port}")"
 | 
						pattern=":$(printf "%04X" "${port}") "
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# for tcp protocol additionally check the socket state
 | 
				
			||||||
 | 
						[ ${protocol} = "tcp" ] && pattern="${pattern}0A"
 | 
				
			||||||
	for i in $(seq 10); do
 | 
						for i in $(seq 10); do
 | 
				
			||||||
		if ip netns exec "${listener_ns}" cat /proc/net/"${protocol}"* | \
 | 
							if ip netns exec "${listener_ns}" awk '{print $2" "$4}' \
 | 
				
			||||||
		   grep -q "${port_hex}"; then
 | 
							   /proc/net/"${protocol}"* | grep -q "${pattern}"; then
 | 
				
			||||||
			break
 | 
								break
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
		sleep 0.1
 | 
							sleep 0.1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1336,16 +1336,16 @@ test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception() {
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			TCPDST="TCP:[${dst}]:50000"
 | 
								TCPDST="TCP:[${dst}]:50000"
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
		${ns_b} socat -T 3 -u -6 TCP-LISTEN:50000 STDOUT > $tmpoutfile &
 | 
							${ns_b} socat -T 3 -u -6 TCP-LISTEN:50000,reuseaddr STDOUT > $tmpoutfile &
 | 
				
			||||||
		local socat_pid=$!
 | 
							local socat_pid=$!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		wait_local_port_listen ${NS_B} 50000 tcp
 | 
							wait_local_port_listen ${NS_B} 50000 tcp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		dd if=/dev/zero status=none bs=1M count=1 | ${target} socat -T 3 -u STDIN $TCPDST,connect-timeout=3
 | 
							dd if=/dev/zero status=none bs=1M count=1 | ${target} socat -T 3 -u STDIN $TCPDST,connect-timeout=3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							wait ${socat_pid}
 | 
				
			||||||
		size=$(du -sb $tmpoutfile)
 | 
							size=$(du -sb $tmpoutfile)
 | 
				
			||||||
		size=${size%%/tmp/*}
 | 
							size=${size%%/tmp/*}
 | 
				
			||||||
		wait ${socat_pid}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		[ $size -ne 1048576 ] && err "File size $size mismatches exepcted value in locally bridged vxlan test" && return 1
 | 
							[ $size -ne 1048576 ] && err "File size $size mismatches exepcted value in locally bridged vxlan test" && return 1
 | 
				
			||||||
	done
 | 
						done
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue