sanity.sh revision 3261
0N/A#
0N/A# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
0N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A# or visit www.oracle.com if you need additional information or have any
0N/A# questions.
0N/A#
0N/A
0N/A# @test
0N/A# @bug 4890703
0N/A# @summary Unit test for Solaris SDP support
0N/A# @build ProbeIB Sanity
0N/A# @run shell sanity.sh
0N/A
0N/A# Check we are on Solaris and that SDP is enabled
0N/AOS=`uname -s`
0N/Aif [ "$OS" != "SunOS" ]; then
0N/A echo "This is a Solaris-only test"
0N/A exit 0
0N/Afi
0N/A
0N/AIB_LINKS=ib.links
0N/AIB_ADDRS=ib.addrs
0N/A
0N/A# Display IB partition link information
0N/A# (requires Solaris 11, will fail on Solaris 10)
0N/A/usr/sbin/dladm show-part -o LINK -p > ${IB_LINKS}
0N/Aif [ $? != 0 ]; then
0N/A echo "Unable to get IB parition link information"
0N/A exit 0
0N/Afi
0N/A
0N/Aif [ -z "$TESTJAVA" ]; then
0N/A JAVA=java
0N/A TESTCLASSES=.
0N/A TESTSRC=.
2078N/Aelse
2078N/A JAVA="${TESTJAVA}/bin/java"
2078N/Afi
2078N/A
2078N/ACLASSPATH=${TESTCLASSES}:${TESTSRC}
0N/Aexport CLASSPATH
0N/A
0N/A# Probe for IP addresses plumbed to IB interfaces
0N/A$JAVA -Djava.net.preferIPv4Stack=true ProbeIB ${IB_LINKS} > ${IB_ADDRS}
0N/A
0N/A# Create sdp.conf
0N/ASDPCONF=sdp.conf
2078N/Arm ${SDPCONF}
0N/Atouch ${SDPCONF}
0N/Acat ${IB_ADDRS} | while read ADDR
0N/Ado
0N/A echo "bind ${ADDR} *" > ${SDPCONF}
0N/A echo "connect ${ADDR} *" >> ${SDPCONF}
0N/Adone
0N/A
0N/A# Sanity check
0N/A$JAVA -Djava.net.preferIPv4Stack=true -Dcom.sun.sdp.conf=${SDPCONF} -Dcom.sun.sdp.debug Sanity
0N/A