[LTP] [PATCH 1/2] tst_net.sh: tst_ping(): check for ping -I support

Petr Vorel pvorel@suse.cz
Sat Mar 30 19:08:17 CET 2024


tst_ping() may require ping -I support, which is not supported by
ping from inetutils.

Link: https://github.com/linux-test-project/ltp/pull/1149#issuecomment-2027947024
Reported-by: Xiangyu Chen <xiangyu.chen@windriver.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_net.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 6cf7f2fcb..ee0ae1cad 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -928,7 +928,10 @@ tst_ping()
 		c) ping_count="$OPTARG";;
 		s) msg_sizes="$OPTARG";;
 		p) pattern_opt="-p $OPTARG";;
-		I) src_iface="$OPTARG";;
+		I) src_iface="$OPTARG"
+		   tst_ping_opt_unsupported -I $OPTARG && \
+			   tst_brk_ TCONF "unsupported ping version (ping from inetutils?)"
+		   ;;
 		H) dst_addr="$OPTARG";;
 		*) tst_brk_ TBROK "tst_ping: unknown option: $OPTARG";;
 		esac
-- 
2.43.0



More information about the ltp mailing list