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