annotate test/sun/net/sdp/sanity.sh @ 3261:a06412e13bf7

6962318: Update copyright year Reviewed-by: xdono
author ohair
date Tue, 28 Dec 2010 15:53:50 -0800
parents 174916d435c9
children ae5d04dbacd6
rev   line source
alanb@1040 1 #
ohair@3261 2 # Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
alanb@1040 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
alanb@1040 4 #
alanb@1040 5 # This code is free software; you can redistribute it and/or modify it
alanb@1040 6 # under the terms of the GNU General Public License version 2 only, as
alanb@1040 7 # published by the Free Software Foundation.
alanb@1040 8 #
alanb@1040 9 # This code is distributed in the hope that it will be useful, but WITHOUT
alanb@1040 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
alanb@1040 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
alanb@1040 12 # version 2 for more details (a copy is included in the LICENSE file that
alanb@1040 13 # accompanied this code).
alanb@1040 14 #
alanb@1040 15 # You should have received a copy of the GNU General Public License version
alanb@1040 16 # 2 along with this work; if not, write to the Free Software Foundation,
alanb@1040 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
alanb@1040 18 #
ohair@2362 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@2362 20 # or visit www.oracle.com if you need additional information or have any
ohair@2362 21 # questions.
alanb@1040 22 #
alanb@1040 23
alanb@1040 24 # @test
alanb@1040 25 # @bug 4890703
alanb@1040 26 # @summary Unit test for Solaris SDP support
alanb@1040 27 # @build ProbeIB Sanity
alanb@1040 28 # @run shell sanity.sh
alanb@1040 29
alanb@1040 30 # Check we are on Solaris and that SDP is enabled
alanb@1040 31 OS=`uname -s`
alanb@1040 32 if [ "$OS" != "SunOS" ]; then
alanb@1040 33 echo "This is a Solaris-only test"
alanb@1040 34 exit 0
alanb@1040 35 fi
alanb@2736 36
alanb@2736 37 IB_LINKS=ib.links
alanb@2736 38 IB_ADDRS=ib.addrs
alanb@2736 39
alanb@2736 40 # Display IB partition link information
alanb@2736 41 # (requires Solaris 11, will fail on Solaris 10)
alanb@2736 42 /usr/sbin/dladm show-part -o LINK -p > ${IB_LINKS}
alanb@2736 43 if [ $? != 0 ]; then
alanb@2736 44 echo "Unable to get IB parition link information"
alanb@1040 45 exit 0
alanb@1040 46 fi
alanb@1040 47
alanb@1040 48 if [ -z "$TESTJAVA" ]; then
alanb@1040 49 JAVA=java
alanb@1040 50 TESTCLASSES=.
alanb@1040 51 TESTSRC=.
alanb@1040 52 else
alanb@1040 53 JAVA="${TESTJAVA}/bin/java"
alanb@1040 54 fi
alanb@1040 55
alanb@1040 56 CLASSPATH=${TESTCLASSES}:${TESTSRC}
alanb@1040 57 export CLASSPATH
alanb@1040 58
alanb@1040 59 # Probe for IP addresses plumbed to IB interfaces
alanb@2736 60 $JAVA -Djava.net.preferIPv4Stack=true ProbeIB ${IB_LINKS} > ${IB_ADDRS}
alanb@1040 61
alanb@1040 62 # Create sdp.conf
alanb@1040 63 SDPCONF=sdp.conf
alanb@1040 64 rm ${SDPCONF}
alanb@1040 65 touch ${SDPCONF}
alanb@2736 66 cat ${IB_ADDRS} | while read ADDR
alanb@1040 67 do
alanb@1040 68 echo "bind ${ADDR} *" > ${SDPCONF}
alanb@1040 69 echo "connect ${ADDR} *" >> ${SDPCONF}
alanb@1040 70 done
alanb@1040 71
alanb@1040 72 # Sanity check
alanb@1040 73 $JAVA -Djava.net.preferIPv4Stack=true -Dcom.sun.sdp.conf=${SDPCONF} -Dcom.sun.sdp.debug Sanity