sanity.sh revision 1040
2129N/A#
2129N/A# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
2129N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2129N/A#
2129N/A# This code is free software; you can redistribute it and/or modify it
2129N/A# under the terms of the GNU General Public License version 2 only, as
2129N/A# published by the Free Software Foundation.
2129N/A#
2129N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2129N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2129N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2129N/A# version 2 for more details (a copy is included in the LICENSE file that
2129N/A# accompanied this code).
2129N/A#
2129N/A# You should have received a copy of the GNU General Public License version
2129N/A# 2 along with this work; if not, write to the Free Software Foundation,
2129N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2129N/A#
2129N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
2129N/A# CA 95054 USA or visit www.sun.com if you need additional information or
2129N/A# have any questions.
2129N/A#
2129N/A
2129N/A# @test
2129N/A# @bug 4890703
2129N/A# @summary Unit test for Solaris SDP support
2129N/A# @build ProbeIB Sanity
2129N/A# @run shell sanity.sh
2129N/A
2129N/A# Check we are on Solaris and that SDP is enabled
2129N/AOS=`uname -s`
2129N/Aif [ "$OS" != "SunOS" ]; then
2129N/A echo "This is a Solaris-only test"
2129N/A exit 0
2129N/Afi
2129N/ASDPADM=/usr/sbin/sdpadm
2129N/Aif [ ! -f ${SDPADM} ]; then
2129N/A echo "SDP not available"
2129N/A exit 0
2129N/Afi
2129N/A${SDPADM} status|grep Enabled
2129N/Aif [ $? != 0 ]; then
2129N/A echo "SDP not enabled"
2129N/A exit 0
2129N/Afi
2129N/A
2129N/Aif [ -z "$TESTJAVA" ]; then
2129N/A JAVA=java
2129N/A TESTCLASSES=.
2129N/A TESTSRC=.
2129N/Aelse
2129N/A JAVA="${TESTJAVA}/bin/java"
2129N/Afi
2129N/A
2129N/ACLASSPATH=${TESTCLASSES}:${TESTSRC}
2129N/Aexport CLASSPATH
2129N/A
2129N/A# Probe for IP addresses plumbed to IB interfaces
2129N/A$JAVA -Djava.net.preferIPv4Stack=true ProbeIB > ib_addrs
2129N/A
2129N/A# Create sdp.conf
2129N/ASDPCONF=sdp.conf
2129N/Arm ${SDPCONF}
2129N/Atouch ${SDPCONF}
2129N/Acat ib_addrs | while read ADDR
2129N/Ado
2129N/A echo "bind ${ADDR} *" > ${SDPCONF}
2129N/A echo "connect ${ADDR} *" >> ${SDPCONF}
2129N/Adone
2129N/A
2129N/A# Sanity check
2129N/A$JAVA -Djava.net.preferIPv4Stack=true -Dcom.sun.sdp.conf=${SDPCONF} -Dcom.sun.sdp.debug Sanity
2129N/A