jdk/test/com/oracle/net/sanity.sh
author ohair
Tue, 12 Apr 2011 18:36:42 -0700
changeset 9064 63c8767f5915
parent 6525 56be41b86ef8
child 14786 a9f61e0cbe61
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6525
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
     1
#
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
     2
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
     4
#
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
     7
# published by the Free Software Foundation.
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
     8
#
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    13
# accompanied this code).
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    14
#
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    18
#
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    21
# questions.
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    22
#
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    23
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    24
# @test
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    25
# @bug 6965072
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    26
# @summary Unit test for SDP support
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    27
# @build  Sanity
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    28
# @run shell sanity.sh
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    29
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    30
IB_LINKS=ib.links
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    31
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    32
OS=`uname -s`
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    33
case "$OS" in
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    34
    SunOS )
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    35
        /usr/sbin/dladm show-part -o LINK -p > ${IB_LINKS}
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    36
        if [ $? != 0 ]; then
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    37
            echo "Unable to get InfiniBand parition link information"
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    38
            exit 0
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    39
        fi
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    40
        ;;
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    41
    Linux )
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    42
        if [ ! -f /proc/net/sdp ]; then
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    43
            echo "InfiniBand SDP module not installed"
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    44
            exit 0
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    45
        fi
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    46
        egrep "^[ \t]+ib" /proc/net/dev|cut -d':' -f1|tr -d '\t ' > ${IB_LINKS}
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    47
        ;; 
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    48
    * )
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    49
        echo "This test only runs on Solaris or Linux"
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    50
        exit 0
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    51
        ;;
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    52
esac
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    53
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    54
if [ -z "$TESTJAVA" ]; then
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    55
    JAVA=java
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    56
    TESTCLASSES=.
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    57
    TESTSRC=.
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    58
else
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    59
    JAVA="${TESTJAVA}/bin/java"
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    60
fi
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    61
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    62
CLASSPATH=${TESTCLASSES}:${TESTSRC}
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    63
export CLASSPATH
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    64
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    65
# Run sanity test (IPv4-only for now)
56be41b86ef8 6965072: Need API to create SDP sockets
alanb
parents:
diff changeset
    66
$JAVA -Djava.net.preferIPv4Stack=true Sanity ${IB_LINKS}