annotate test/sun/net/sdp/sanity.sh @ 1040:93d1fbe001b8

4890703: Support SDP (sol) Reviewed-by: michaelm
author alanb
date Mon, 06 Apr 2009 08:59:33 +0100
parents
children 00cd9dc3c2b5
rev   line source
alanb@1040 1 #
alanb@1040 2 # Copyright 2009 Sun Microsystems, Inc. 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 #
alanb@1040 19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
alanb@1040 20 # CA 95054 USA or visit www.sun.com if you need additional information or
alanb@1040 21 # have any 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@1040 36 SDPADM=/usr/sbin/sdpadm
alanb@1040 37 if [ ! -f ${SDPADM} ]; then
alanb@1040 38 echo "SDP not available"
alanb@1040 39 exit 0
alanb@1040 40 fi
alanb@1040 41 ${SDPADM} status|grep Enabled
alanb@1040 42 if [ $? != 0 ]; then
alanb@1040 43 echo "SDP not enabled"
alanb@1040 44 exit 0
alanb@1040 45 fi
alanb@1040 46
alanb@1040 47 if [ -z "$TESTJAVA" ]; then
alanb@1040 48 JAVA=java
alanb@1040 49 TESTCLASSES=.
alanb@1040 50 TESTSRC=.
alanb@1040 51 else
alanb@1040 52 JAVA="${TESTJAVA}/bin/java"
alanb@1040 53 fi
alanb@1040 54
alanb@1040 55 CLASSPATH=${TESTCLASSES}:${TESTSRC}
alanb@1040 56 export CLASSPATH
alanb@1040 57
alanb@1040 58 # Probe for IP addresses plumbed to IB interfaces
alanb@1040 59 $JAVA -Djava.net.preferIPv4Stack=true ProbeIB > ib_addrs
alanb@1040 60
alanb@1040 61 # Create sdp.conf
alanb@1040 62 SDPCONF=sdp.conf
alanb@1040 63 rm ${SDPCONF}
alanb@1040 64 touch ${SDPCONF}
alanb@1040 65 cat ib_addrs | while read ADDR
alanb@1040 66 do
alanb@1040 67 echo "bind ${ADDR} *" > ${SDPCONF}
alanb@1040 68 echo "connect ${ADDR} *" >> ${SDPCONF}
alanb@1040 69 done
alanb@1040 70
alanb@1040 71 # Sanity check
alanb@1040 72 $JAVA -Djava.net.preferIPv4Stack=true -Dcom.sun.sdp.conf=${SDPCONF} -Dcom.sun.sdp.debug Sanity