1#! /bin/sh 2# SPDX-License-Identifier: GPL-2.0-or-later 3# Copyright (c) 2016-2019 Oracle and/or its affiliates. All Rights Reserved. 4 5TST_SETUP="do_setup" 6TST_TESTFUNC="do_test" 7TST_NEEDS_ROOT=1 8 9. tst_net.sh 10 11do_setup() 12{ 13 COUNT=${COUNT:-3} 14 PACKETSIZES=${PACKETSIZES:-"8 16 32 64 128 256 512 1024 2048 4064"} 15 16 PING=ping${TST_IPV6} 17 18 tst_require_cmds $PING 19} 20 21do_test() 22{ 23 local pat="000102030405060708090a0b0c0d0e0f" 24 25 tst_res TINFO "flood $PING: ICMP packets filled with pattern '$pat'" 26 27 local ipaddr=$(tst_ipaddr rhost) 28 local s 29 30 for s in $PACKETSIZES; do 31 EXPECT_PASS $PING -c $COUNT -f -s $s $ipaddr -p "$pat" \>/dev/null 32 done 33} 34 35tst_run 36