aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Kodanev <alexey.kodanev@oracle.com>2016-09-07 19:11:43 +0300
committerAlexey Kodanev <alexey.kodanev@oracle.com>2016-09-19 16:29:04 +0300
commit8b8fc3d636d020e16bbba4a69a5bf2b5ddb842bc (patch)
treed2058b09fbaa8078445be4a59e8097c3ef373f48
parent86cfd98225dac7ba44b7e1d71bae9340a168cd12 (diff)
network/ping02: add new flood ping test
* test sends packets without delay; * packets filled out with a predefined pattern. Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
-rw-r--r--runtest/net.ipv61
-rw-r--r--runtest/net.tcp_cmds1
-rw-r--r--testcases/network/tcp_cmds/ping/Makefile3
-rwxr-xr-xtestcases/network/tcp_cmds/ping/ping02.sh47
4 files changed, 51 insertions, 1 deletions
diff --git a/runtest/net.ipv6 b/runtest/net.ipv6
index 76d86582f..0e63467cd 100644
--- a/runtest/net.ipv6
+++ b/runtest/net.ipv6
@@ -1,5 +1,6 @@
#DESCRIPTION:IPV6 related tests
ping601 ping01.sh -6
+ping602 ping02.sh -6
sendfile601 sendfile01 -6
tcpdump601 tcpdump01 -6
tracepath601 tracepath01.sh -6
diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index 24cdbb554..66262f855 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -11,6 +11,7 @@ ftp export TCbin=$LTPROOT/testcases/network/tcp_cmds/ftp; ftp01
host host01
netstat netstat01
ping01 ping01.sh
+ping02 ping02.sh
rcp export TCbin=$LTPROOT/testcases/network/tcp_cmds/rcp; rcp01
rdist export TCbin=$LTPROOT/testcases/network/tcp_cmds/rdist; rdist01
rlogin rlogin01
diff --git a/testcases/network/tcp_cmds/ping/Makefile b/testcases/network/tcp_cmds/ping/Makefile
index 6e26ac94c..29429e761 100644
--- a/testcases/network/tcp_cmds/ping/Makefile
+++ b/testcases/network/tcp_cmds/ping/Makefile
@@ -24,7 +24,8 @@ top_srcdir ?= ../../../..
include $(top_srcdir)/include/mk/env_pre.mk
-INSTALL_TARGETS := ping01.sh
+INSTALL_TARGETS := ping01.sh \
+ ping02.sh
MAKE_TARGETS :=
diff --git a/testcases/network/tcp_cmds/ping/ping02.sh b/testcases/network/tcp_cmds/ping/ping02.sh
new file mode 100755
index 000000000..6a9878e42
--- /dev/null
+++ b/testcases/network/tcp_cmds/ping/ping02.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+TST_TOTAL=10
+TCID="ping02"
+
+. test_net.sh
+
+do_setup()
+{
+ COUNT=${COUNT:-3}
+ PACKETSIZES=${PACKETSIZES:-"8 16 32 64 128 256 512 1024 2048 4064"}
+
+ PING=ping${TST_IPV6}
+
+ tst_check_cmds $PING
+}
+
+do_test()
+{
+ local pat="000102030405060708090a0b0c0d0e0f"
+
+ tst_resm TINFO "flood $PING: ICMP packets filled with pattern '$pat'"
+
+ local ipaddr=$(tst_ipaddr rhost)
+ for psize in $PACKETSIZES; do
+ EXPECT_PASS $PING -c $COUNT -f -s $psize $ipaddr -p "$pat" \>/dev/null
+ done
+}
+
+do_setup
+do_test
+
+tst_exit