Signed-off-by: Alexey Kodanev <alexey.koda...@oracle.com> --- testcases/network/multicast/mc_opts/mc_opts | 77 +++++++++------------------ 1 files changed, 26 insertions(+), 51 deletions(-)
diff --git a/testcases/network/multicast/mc_opts/mc_opts b/testcases/network/multicast/mc_opts/mc_opts index 7d50a76..66b814b 100755 --- a/testcases/network/multicast/mc_opts/mc_opts +++ b/testcases/network/multicast/mc_opts/mc_opts @@ -1,26 +1,21 @@ #! /bin/sh -unset LIBPATH -#****************************************************************************** -# -# 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 will 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 to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# Copyright (c) 2015 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. # -# FILE : mc_opts +# 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 verify that three of the new options for level IPPROTO_IP # Service Interface are initially set to the default values as @@ -30,52 +25,32 @@ unset LIBPATH # generate errors while exercising the IP Multicast Service # Interface options. # -# HISTORY: -# 03/26/01 Robbie Williamson (robb...@us.ibm.com) -# -Ported # -#****************************************************************************** +# Robbie Williamson (robb...@us.ibm.com) +# -Ported -TC=mc_opts EXECUTABLES=${EXECUTABLES:-"mc_verify_opts mc_verify_opts_error"} -IPADDR=${IPADDR:-$(mc_gethost `hostname`| grep address |awk '{ print $2 }')} - -export TCID=$TC -export TST_TOTAL=1 -export TST_COUNT=1 - -. test.sh - -if [ -z $IPADDR ]; then - tst_brkm TCONF "Not found $(hostname) in /etc/hosts" -fi +TCID=mc_opts +TST_TOTAL=1 -tst_resm TINFO "doing test." +. test_net.sh COUNT=1 -while [ $COUNT -le 10 ] -do +while [ $COUNT -le 10 ]; do # Run setsockopt/getsockopt test - tst_resm TINFO "Running $EXECUTABLES on $IPADDR" - for i in $EXECUTABLES - do - $i $IPADDR > /dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_brkm TFAIL "$i $IPADDR failed" - fi + tst_resm TINFO "Running $EXECUTABLES on $(tst_ipaddr)" + for i in $EXECUTABLES; do + $i $(tst_ipaddr) > /dev/null || \ + tst_brkm TFAIL "$i $(tst_ipaddr) failed" done tst_resm TINFO "Running ping with bad values" - ping -T 777 224.0.0.1 > /dev/null 2>&1 - if [ $? -eq 0 ]; then + ping -T 777 224.0.0.1 > /dev/null 2>&1 && \ tst_brkm TFAIL "Multicast range should be out of range" - fi tst_resm TINFO "Running ping on a invalid interface!" - ping -I 3.3.3.3 224.0.0.1 > /dev/null 2>&1 - if [ $? -eq 0 ]; then + ping -I 3.3.3.3 224.0.0.1 > /dev/null 2>&1 && \ tst_brkm TFAIL "ping on bogus interface should fail" - fi COUNT=$(( $COUNT + 1 )) done -- 1.7.1 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list