All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] network/ping01: rename file and update runtest files
@ 2016-09-08  7:34 Alexey Kodanev
  2016-09-08  7:34 ` [LTP] [PATCH 2/3] network/ping01: use ROD_SILENT and report test result Alexey Kodanev
  2016-09-08  7:34 ` [LTP] [PATCH 3/3] network/ping02: add new flood ping test Alexey Kodanev
  0 siblings, 2 replies; 6+ messages in thread
From: Alexey Kodanev @ 2016-09-08  7:34 UTC (permalink / raw)
  To: ltp

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 runtest/net.ipv6                          |    2 +-
 runtest/net.tcp_cmds                      |    2 +-
 testcases/network/tcp_cmds/ping/Makefile  |    2 +-
 testcases/network/tcp_cmds/ping/ping01    |   61 -----------------------------
 testcases/network/tcp_cmds/ping/ping01.sh |   61 +++++++++++++++++++++++++++++
 5 files changed, 64 insertions(+), 64 deletions(-)
 delete mode 100755 testcases/network/tcp_cmds/ping/ping01
 create mode 100755 testcases/network/tcp_cmds/ping/ping01.sh

diff --git a/runtest/net.ipv6 b/runtest/net.ipv6
index 5f42e01..76d8658 100644
--- a/runtest/net.ipv6
+++ b/runtest/net.ipv6
@@ -1,5 +1,5 @@
 #DESCRIPTION:IPV6 related tests
-ping601 ping01 -6
+ping601 ping01.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 9801fef..24cdbb5 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -10,7 +10,7 @@ finger finger01
 ftp export TCbin=$LTPROOT/testcases/network/tcp_cmds/ftp; ftp01
 host host01
 netstat netstat01
-ping export LTPROOT; ping01
+ping01 ping01.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 3bfc37a..6e26ac9 100644
--- a/testcases/network/tcp_cmds/ping/Makefile
+++ b/testcases/network/tcp_cmds/ping/Makefile
@@ -24,7 +24,7 @@ top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/env_pre.mk
 
-INSTALL_TARGETS		:= ping01
+INSTALL_TARGETS		:= ping01.sh
 
 MAKE_TARGETS		:=
 
diff --git a/testcases/network/tcp_cmds/ping/ping01 b/testcases/network/tcp_cmds/ping/ping01
deleted file mode 100755
index e188c3a..0000000
--- a/testcases/network/tcp_cmds/ping/ping01
+++ /dev/null
@@ -1,61 +0,0 @@
-#! /bin/sh
-# Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
-# Copyright (c) International Business Machines  Corp., 2000
-#
-# 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, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-#  PURPOSE: To test the basic functionality of the `ping` command.
-#
-#  SETUP: If "RHOST" is not exported, then the local hostname is used.
-#
-#  HISTORY:
-#    06/06/03 Manoj Iyer manjo@mail.utexas.edu
-#    - Modified testcase to use test APIs and also fixed minor bugs
-#    03/01 Robbie Williamson (robbiew@us.ibm.com)
-#      -Ported
-
-TST_TOTAL=1
-TCID="ping01"
-
-. test_net.sh
-
-do_setup()
-{
-	COUNT=${COUNT:-3}
-	PACKETSIZES=${PACKETSIZES:-"8 16 32 64 128 256 512 1024 2048 4064"}
-
-	PING_CMD=ping${TST_IPV6}
-
-	tst_check_cmds $PING_CMD
-}
-
-do_test()
-{
-	tst_resm TINFO "$PING_CMD with $PACKETSIZES ICMP packets"
-	local ipaddr=$(tst_ipaddr rhost)
-	for packetsize in $PACKETSIZES; do
-		tst_resm TINFO "call $PING_CMD with packet size = $packetsize"
-		$PING_CMD -c $COUNT -s $packetsize $ipaddr > /dev/null 2>&1
-		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "$PING_CMD -c $COUNT -s $packetsize $ipaddr"
-			return
-		fi
-	done
-}
-
-do_setup
-do_test
-
-tst_exit
diff --git a/testcases/network/tcp_cmds/ping/ping01.sh b/testcases/network/tcp_cmds/ping/ping01.sh
new file mode 100755
index 0000000..e188c3a
--- /dev/null
+++ b/testcases/network/tcp_cmds/ping/ping01.sh
@@ -0,0 +1,61 @@
+#! /bin/sh
+# Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines  Corp., 2000
+#
+# 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, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+#  PURPOSE: To test the basic functionality of the `ping` command.
+#
+#  SETUP: If "RHOST" is not exported, then the local hostname is used.
+#
+#  HISTORY:
+#    06/06/03 Manoj Iyer manjo@mail.utexas.edu
+#    - Modified testcase to use test APIs and also fixed minor bugs
+#    03/01 Robbie Williamson (robbiew@us.ibm.com)
+#      -Ported
+
+TST_TOTAL=1
+TCID="ping01"
+
+. test_net.sh
+
+do_setup()
+{
+	COUNT=${COUNT:-3}
+	PACKETSIZES=${PACKETSIZES:-"8 16 32 64 128 256 512 1024 2048 4064"}
+
+	PING_CMD=ping${TST_IPV6}
+
+	tst_check_cmds $PING_CMD
+}
+
+do_test()
+{
+	tst_resm TINFO "$PING_CMD with $PACKETSIZES ICMP packets"
+	local ipaddr=$(tst_ipaddr rhost)
+	for packetsize in $PACKETSIZES; do
+		tst_resm TINFO "call $PING_CMD with packet size = $packetsize"
+		$PING_CMD -c $COUNT -s $packetsize $ipaddr > /dev/null 2>&1
+		if [ $? -ne 0 ]; then
+			tst_resm TFAIL "$PING_CMD -c $COUNT -s $packetsize $ipaddr"
+			return
+		fi
+	done
+}
+
+do_setup
+do_test
+
+tst_exit
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 2/3] network/ping01: use ROD_SILENT and report test result
  2016-09-08  7:34 [LTP] [PATCH 1/3] network/ping01: rename file and update runtest files Alexey Kodanev
@ 2016-09-08  7:34 ` Alexey Kodanev
  2016-09-19 10:31   ` Cyril Hrubis
  2016-09-08  7:34 ` [LTP] [PATCH 3/3] network/ping02: add new flood ping test Alexey Kodanev
  1 sibling, 1 reply; 6+ messages in thread
From: Alexey Kodanev @ 2016-09-08  7:34 UTC (permalink / raw)
  To: ltp

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/network/tcp_cmds/ping/ping01.sh |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/testcases/network/tcp_cmds/ping/ping01.sh b/testcases/network/tcp_cmds/ping/ping01.sh
index e188c3a..5dd3369 100755
--- a/testcases/network/tcp_cmds/ping/ping01.sh
+++ b/testcases/network/tcp_cmds/ping/ping01.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 2014-2016 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2000
 #
 # This program is free software; you can redistribute it and/or
@@ -13,8 +13,7 @@
 # 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, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
 #
 #  PURPOSE: To test the basic functionality of the `ping` command.
 #
@@ -47,12 +46,10 @@ do_test()
 	local ipaddr=$(tst_ipaddr rhost)
 	for packetsize in $PACKETSIZES; do
 		tst_resm TINFO "call $PING_CMD with packet size = $packetsize"
-		$PING_CMD -c $COUNT -s $packetsize $ipaddr > /dev/null 2>&1
-		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "$PING_CMD -c $COUNT -s $packetsize $ipaddr"
-			return
-		fi
+		ROD_SILENT $PING_CMD -c $COUNT -s $packetsize $ipaddr
 	done
+
+	tst_resm TPASS "$PING_CMD test completed"
 }
 
 do_setup
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 3/3] network/ping02: add new flood ping test
  2016-09-08  7:34 [LTP] [PATCH 1/3] network/ping01: rename file and update runtest files Alexey Kodanev
  2016-09-08  7:34 ` [LTP] [PATCH 2/3] network/ping01: use ROD_SILENT and report test result Alexey Kodanev
@ 2016-09-08  7:34 ` Alexey Kodanev
  1 sibling, 0 replies; 6+ messages in thread
From: Alexey Kodanev @ 2016-09-08  7:34 UTC (permalink / raw)
  To: ltp

* test sends packets without delay;
* packets filled out with a predefined pattern.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 runtest/net.ipv6                          |    1 +
 runtest/net.tcp_cmds                      |    1 +
 testcases/network/tcp_cmds/ping/Makefile  |    3 +-
 testcases/network/tcp_cmds/ping/ping02.sh |   50 +++++++++++++++++++++++++++++
 4 files changed, 54 insertions(+), 1 deletions(-)
 create mode 100755 testcases/network/tcp_cmds/ping/ping02.sh

diff --git a/runtest/net.ipv6 b/runtest/net.ipv6
index 76d8658..0e63467 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 24cdbb5..66262f8 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 6e26ac9..29429e7 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 0000000..2cfdff8
--- /dev/null
+++ b/testcases/network/tcp_cmds/ping/ping02.sh
@@ -0,0 +1,50 @@
+#! /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=1
+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
+		tst_resm TINFO "call $PING with packet size = $psize"
+		ROD_SILENT $PING -c $COUNT -f -s $psize $ipaddr -p "$pat"
+	done
+
+	tst_resm TPASS "flood $PING test completed"
+}
+
+do_setup
+do_test
+
+tst_exit
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 2/3] network/ping01: use ROD_SILENT and report test result
  2016-09-08  7:34 ` [LTP] [PATCH 2/3] network/ping01: use ROD_SILENT and report test result Alexey Kodanev
@ 2016-09-19 10:31   ` Cyril Hrubis
  2016-09-19 12:10     ` Alexey Kodanev
  0 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2016-09-19 10:31 UTC (permalink / raw)
  To: ltp

Hi!
> @@ -47,12 +46,10 @@ do_test()
>  	local ipaddr=$(tst_ipaddr rhost)
>  	for packetsize in $PACKETSIZES; do
>  		tst_resm TINFO "call $PING_CMD with packet size = $packetsize"
> -		$PING_CMD -c $COUNT -s $packetsize $ipaddr > /dev/null 2>&1
> -		if [ $? -ne 0 ]; then
> -			tst_resm TFAIL "$PING_CMD -c $COUNT -s $packetsize $ipaddr"
> -			return
> -		fi
> +		ROD_SILENT $PING_CMD -c $COUNT -s $packetsize $ipaddr

What about we use the EXPECT_PASS here? The ROD_SILENT would produce
TBROK instead of TFAIL in case of failure.

I know that EXPECT_PASS wouldn't exit the test on first failure, do we
really need that anyway? And it also wouldn't silence the ping output,
which shouldn't be so much of a problem since the $COUNT is small.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 2/3] network/ping01: use ROD_SILENT and report test result
  2016-09-19 10:31   ` Cyril Hrubis
@ 2016-09-19 12:10     ` Alexey Kodanev
  2016-09-19 12:13       ` Cyril Hrubis
  0 siblings, 1 reply; 6+ messages in thread
From: Alexey Kodanev @ 2016-09-19 12:10 UTC (permalink / raw)
  To: ltp

Hi,
On 09/19/2016 01:31 PM, Cyril Hrubis wrote:
> Hi!
>> @@ -47,12 +46,10 @@ do_test()
>>   	local ipaddr=$(tst_ipaddr rhost)
>>   	for packetsize in $PACKETSIZES; do
>>   		tst_resm TINFO "call $PING_CMD with packet size = $packetsize"
>> -		$PING_CMD -c $COUNT -s $packetsize $ipaddr > /dev/null 2>&1
>> -		if [ $? -ne 0 ]; then
>> -			tst_resm TFAIL "$PING_CMD -c $COUNT -s $packetsize $ipaddr"
>> -			return
>> -		fi
>> +		ROD_SILENT $PING_CMD -c $COUNT -s $packetsize $ipaddr
> What about we use the EXPECT_PASS here? The ROD_SILENT would produce
> TBROK instead of TFAIL in case of failure.
>
> I know that EXPECT_PASS wouldn't exit the test on first failure, do we
> really need that anyway? And it also wouldn't silence the ping output,
> which shouldn't be so much of a problem since the $COUNT is small.

Yes, $COUNT is small but we should multiply it by $PACKETSIZES. Even 
with '-q' there will be a lot of output.
What about adding redirection to /dev/null and removing tst_resm() as below:

-TST_TOTAL=1
+TST_TOTAL=10
  TCID="ping01"

  . test_net.sh
@@ -45,11 +45,8 @@ do_test()
         tst_resm TINFO "$PING_CMD with $PACKETSIZES ICMP packets"
         local ipaddr=$(tst_ipaddr rhost)
         for packetsize in $PACKETSIZES; do
-               tst_resm TINFO "call $PING_CMD with packet size = 
$packetsize"
-               ROD_SILENT $PING_CMD -c $COUNT -s $packetsize $ipaddr
+               EXPECT_PASS $PING_CMD -c $COUNT -s $packetsize $ipaddr 
\>/dev/null
         done
-
-       tst_resm TPASS "$PING_CMD test completed"
  }


Thanks,
Alexey

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 2/3] network/ping01: use ROD_SILENT and report test result
  2016-09-19 12:10     ` Alexey Kodanev
@ 2016-09-19 12:13       ` Cyril Hrubis
  0 siblings, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2016-09-19 12:13 UTC (permalink / raw)
  To: ltp

Hi!
> Yes, $COUNT is small but we should multiply it by $PACKETSIZES. Even 
> with '-q' there will be a lot of output.
> What about adding redirection to /dev/null and removing tst_resm() as below:
> 
> -TST_TOTAL=1
> +TST_TOTAL=10
>   TCID="ping01"
> 
>   . test_net.sh
> @@ -45,11 +45,8 @@ do_test()
>          tst_resm TINFO "$PING_CMD with $PACKETSIZES ICMP packets"
>          local ipaddr=$(tst_ipaddr rhost)
>          for packetsize in $PACKETSIZES; do
> -               tst_resm TINFO "call $PING_CMD with packet size = 
> $packetsize"
> -               ROD_SILENT $PING_CMD -c $COUNT -s $packetsize $ipaddr
> +               EXPECT_PASS $PING_CMD -c $COUNT -s $packetsize $ipaddr 
> \>/dev/null
>          done
> -
> -       tst_resm TPASS "$PING_CMD test completed"
>   }

Looks good.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-19 12:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-08  7:34 [LTP] [PATCH 1/3] network/ping01: rename file and update runtest files Alexey Kodanev
2016-09-08  7:34 ` [LTP] [PATCH 2/3] network/ping01: use ROD_SILENT and report test result Alexey Kodanev
2016-09-19 10:31   ` Cyril Hrubis
2016-09-19 12:10     ` Alexey Kodanev
2016-09-19 12:13       ` Cyril Hrubis
2016-09-08  7:34 ` [LTP] [PATCH 3/3] network/ping02: add new flood ping test Alexey Kodanev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.