• 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. tst_net.sh
18
19do_setup()
20{
21	COUNT=${COUNT:-3}
22	PACKETSIZES=${PACKETSIZES:-"8 16 32 64 128 256 512 1024 2048 4064"}
23
24	PING_CMD=ping${TST_IPV6}
25
26	tst_require_cmds $PING_CMD
27}
28
29do_test()
30{
31	tst_res TINFO "$PING_CMD with $PACKETSIZES ICMP packets"
32	local ipaddr=$(tst_ipaddr rhost)
33	local s
34
35	for s in $PACKETSIZES; do
36		EXPECT_PASS $PING_CMD -i 0.2 -c $COUNT -s $s $ipaddr \>/dev/null
37	done
38}
39
40tst_run
41