• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2014-2019 Oracle and/or its affiliates. All Rights Reserved.
4# Copyright (c) International Business Machines Corp., 2000
5#
6# To test the basic functionality of the `ping` command.
7#
8#  HISTORY:
9#    06/06/03 Manoj Iyer manjo@mail.utexas.edu
10#    - Modified testcase to use test APIs and also fixed minor bugs
11#    03/01 Robbie Williamson (robbiew@us.ibm.com)
12#      -Ported
13
14TST_SETUP="do_setup"
15TST_TESTFUNC="do_test"
16
17
18do_setup()
19{
20	COUNT=${COUNT:-3}
21	PACKETSIZES=${PACKETSIZES:-"8 16 32 64 128 256 512 1024 2048 4064"}
22
23	PING_CMD=ping${TST_IPV6}
24
25	tst_require_cmds $PING_CMD
26}
27
28do_test()
29{
30	tst_res TINFO "$PING_CMD with $PACKETSIZES ICMP packets"
31	local ipaddr=$(tst_ipaddr rhost)
32	local s
33
34	for s in $PACKETSIZES; do
35		EXPECT_PASS $PING_CMD -i 0.2 -c $COUNT -s $s $ipaddr \>/dev/null
36	done
37}
38
39. tst_net.sh
40tst_run
41