1#!/bin/sh 2# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved. 3# Copyright (c) International Business Machines Corp., 2000 4# 5# This program is free software; you can redistribute it and/or 6# modify it under the terms of the GNU General Public License as 7# published by the Free Software Foundation; either version 2 of 8# the License, or (at your option) any later version. 9# 10# This program is distributed in the hope that it would be useful, 11# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# GNU General Public License for more details. 14# 15# 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 18# 19# PURPOSE: To verify that three of the new options for level IPPROTO_IP 20# Service Interface are initially set to the default values as 21# defined in the documentation and that each of the new options 22# can be set and read properly by the setsockopt and getsockopt 23# routines, respectively. To test boundary conditions and to 24# generate errors while exercising the IP Multicast Service 25# Interface options. 26# 27# 28# Robbie Williamson (robbiew@us.ibm.com) 29# -Ported 30 31EXECUTABLES=${EXECUTABLES:-"mc_verify_opts mc_verify_opts_error"} 32TCID=mc_opts 33TST_TOTAL=1 34 35TST_USE_LEGACY_API=1 36. tst_net.sh 37 38COUNT=1 39while [ $COUNT -le 10 ]; do 40 # Run setsockopt/getsockopt test 41 tst_resm TINFO "Running $EXECUTABLES on $(tst_ipaddr)" 42 for i in $EXECUTABLES; do 43 $i $(tst_ipaddr) > /dev/null || \ 44 tst_brkm TFAIL "$i $(tst_ipaddr) failed" 45 done 46 47 tst_resm TINFO "Running ping with bad values" 48 ping -T 777 224.0.0.1 > /dev/null 2>&1 && \ 49 tst_brkm TFAIL "Multicast range should be out of range" 50 51 tst_resm TINFO "Running ping on a invalid interface!" 52 ping -I 3.3.3.3 224.0.0.1 > /dev/null 2>&1 && \ 53 tst_brkm TFAIL "ping on bogus interface should fail" 54 55 COUNT=$(( $COUNT + 1 )) 56done 57 58tst_resm TPASS "Test Successful" 59tst_exit 60