Skip to content

Commit 86cfd98

Browse files
committed
network/ping01: use EXPECT_PASS and correct TST_TOTAL
Signed-off-by: Alexey Kodanev <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
1 parent 36ca778 commit 86cfd98

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

testcases/network/tcp_cmds/ping/ping01.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
2+
# Copyright (c) 2014-2016 Oracle and/or its affiliates. All Rights Reserved.
33
# Copyright (c) International Business Machines Corp., 2000
44
#
55
# This program is free software; you can redistribute it and/or
@@ -13,8 +13,7 @@
1313
# GNU General Public License for more details.
1414
#
1515
# You should have received a copy of the GNU General Public License
16-
# along with this program; if not, write the Free Software Foundation,
17-
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1817
#
1918
# PURPOSE: To test the basic functionality of the `ping` command.
2019
#
@@ -26,7 +25,7 @@
2625
# 03/01 Robbie Williamson ([email protected])
2726
# -Ported
2827

29-
TST_TOTAL=1
28+
TST_TOTAL=10
3029
TCID="ping01"
3130

3231
. test_net.sh
@@ -46,12 +45,7 @@ do_test()
4645
tst_resm TINFO "$PING_CMD with $PACKETSIZES ICMP packets"
4746
local ipaddr=$(tst_ipaddr rhost)
4847
for packetsize in $PACKETSIZES; do
49-
tst_resm TINFO "call $PING_CMD with packet size = $packetsize"
50-
$PING_CMD -c $COUNT -s $packetsize $ipaddr > /dev/null 2>&1
51-
if [ $? -ne 0 ]; then
52-
tst_resm TFAIL "$PING_CMD -c $COUNT -s $packetsize $ipaddr"
53-
return
54-
fi
48+
EXPECT_PASS $PING_CMD -c $COUNT -s $packetsize $ipaddr \>/dev/null
5549
done
5650
}
5751

0 commit comments

Comments
 (0)