diff mbox series

selftests: net: udpgro_fwd.sh: explicitly checking the available ping feature

Message ID 825ee22b-4245-dbf7-d2f7-a230770d6e21@163.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series selftests: net: udpgro_fwd.sh: explicitly checking the available ping feature | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 2 blamed authors not CCed: davem@davemloft.net wujianguo@chinatelecom.cn; 4 maintainers not CCed: linux-kselftest@vger.kernel.org davem@davemloft.net shuah@kernel.org wujianguo@chinatelecom.cn
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Jianguo Wu Dec. 31, 2021, 2:01 a.m. UTC
From: Jianguo Wu <wujianguo@chinatelecom.cn>

As Paolo pointed out, the result of ping IPv6 address depends on
the running distro. So explicitly checking the available ping feature,
as e.g. do the bareudp.sh self-tests.

Fixes: 8b3170e07539 ("selftests: net: using ping6 for IPv6 in udpgro_fwd.sh")
Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
---
 tools/testing/selftests/net/udpgro_fwd.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jakub Kicinski Jan. 1, 2022, 3:03 a.m. UTC | #1
On Fri, 31 Dec 2021 10:01:08 +0800 Jianguo Wu wrote:
> From: Jianguo Wu <wujianguo@chinatelecom.cn>
> 
> As Paolo pointed out, the result of ping IPv6 address depends on
> the running distro. So explicitly checking the available ping feature,
> as e.g. do the bareudp.sh self-tests.
> 
> Fixes: 8b3170e07539 ("selftests: net: using ping6 for IPv6 in udpgro_fwd.sh")
> Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>

Applied, thanks!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/udpgro_fwd.sh b/tools/testing/selftests/net/udpgro_fwd.sh
index 3ea7301..6f05e06 100755
--- a/tools/testing/selftests/net/udpgro_fwd.sh
+++ b/tools/testing/selftests/net/udpgro_fwd.sh
@@ -193,7 +193,8 @@  for family in 4 6; do
 		SUFFIX="64 nodad"
 		VXDEV=vxlan6
 		IPT=ip6tables
-		PING="ping6"
+		# Use ping6 on systems where ping doesn't handle IPv6
+		ping -w 1 -c 1 ::1 > /dev/null 2>&1 || PING="ping6"
 	fi

 	echo "IPv$family"