2736N/A#
2736N/A# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2736N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2736N/A#
2736N/A# This code is free software; you can redistribute it and/or modify it
2736N/A# under the terms of the GNU General Public License version 2 only, as
2736N/A# published by the Free Software Foundation.
2736N/A#
2736N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2736N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2736N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2736N/A# version 2 for more details (a copy is included in the LICENSE file that
2736N/A# accompanied this code).
2736N/A#
2736N/A# You should have received a copy of the GNU General Public License version
2736N/A# 2 along with this work; if not, write to the Free Software Foundation,
2736N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2736N/A#
2736N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2736N/A# or visit www.oracle.com if you need additional information or have any
2736N/A# questions.
2736N/A#
2736N/A
2736N/A# @test
2736N/A# @bug 6965072
2736N/A# @summary Unit test for SDP support
2736N/A# @build Sanity
2736N/A# @run shell sanity.sh
2736N/A
2736N/AIB_LINKS=ib.links
2736N/A
2736N/AOS=`uname -s`
2736N/Acase "$OS" in
2736N/A SunOS )
2736N/A /usr/sbin/dladm show-part -o LINK -p > ${IB_LINKS}
2736N/A if [ $? != 0 ]; then
2736N/A echo "Unable to get InfiniBand parition link information"
2736N/A exit 0
2736N/A fi
2736N/A ;;
2736N/A Linux )
2736N/A if [ ! -f /proc/net/sdp ]; then
2736N/A echo "InfiniBand SDP module not installed"
2736N/A exit 0
2736N/A fi
2736N/A egrep "^[ \t]+ib" /proc/net/dev|cut -d':' -f1|tr -d '\t ' > ${IB_LINKS}
2736N/A ;;
2736N/A * )
2736N/A echo "This test only runs on Solaris or Linux"
2736N/A exit 0
2736N/A ;;
2736N/Aesac
2736N/A
2736N/Aif [ -z "$TESTJAVA" ]; then
2736N/A JAVA=java
2736N/A TESTCLASSES=.
2736N/A TESTSRC=.
2736N/Aelse
2736N/A JAVA="${TESTJAVA}/bin/java"
2736N/Afi
2736N/A
2736N/ACLASSPATH=${TESTCLASSES}:${TESTSRC}
2736N/Aexport CLASSPATH
2736N/A
2736N/A# Run sanity test (IPv4-only for now)
2736N/A$JAVA -Djava.net.preferIPv4Stack=true Sanity ${IB_LINKS}