2446
|
1 |
#
|
5506
|
2 |
# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
|
2446
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
#
|
|
5 |
# This code is free software; you can redistribute it and/or modify it
|
|
6 |
# under the terms of the GNU General Public License version 2 only, as
|
|
7 |
# published by the Free Software Foundation.
|
|
8 |
#
|
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that
|
|
13 |
# accompanied this code).
|
|
14 |
#
|
|
15 |
# You should have received a copy of the GNU General Public License version
|
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 |
#
|
5506
|
19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
20 |
# or visit www.oracle.com if you need additional information or have any
|
|
21 |
# questions.
|
2446
|
22 |
#
|
|
23 |
|
|
24 |
# @test
|
|
25 |
# @bug 4890703
|
|
26 |
# @summary Unit test for Solaris SDP support
|
|
27 |
# @build ProbeIB Sanity
|
|
28 |
# @run shell sanity.sh
|
|
29 |
|
|
30 |
# Check we are on Solaris and that SDP is enabled
|
|
31 |
OS=`uname -s`
|
|
32 |
if [ "$OS" != "SunOS" ]; then
|
|
33 |
echo "This is a Solaris-only test"
|
|
34 |
exit 0
|
|
35 |
fi
|
|
36 |
SDPADM=/usr/sbin/sdpadm
|
|
37 |
if [ ! -f ${SDPADM} ]; then
|
|
38 |
echo "SDP not available"
|
|
39 |
exit 0
|
|
40 |
fi
|
|
41 |
${SDPADM} status|grep Enabled
|
|
42 |
if [ $? != 0 ]; then
|
|
43 |
echo "SDP not enabled"
|
|
44 |
exit 0
|
|
45 |
fi
|
|
46 |
|
|
47 |
if [ -z "$TESTJAVA" ]; then
|
|
48 |
JAVA=java
|
|
49 |
TESTCLASSES=.
|
|
50 |
TESTSRC=.
|
|
51 |
else
|
|
52 |
JAVA="${TESTJAVA}/bin/java"
|
|
53 |
fi
|
|
54 |
|
|
55 |
CLASSPATH=${TESTCLASSES}:${TESTSRC}
|
|
56 |
export CLASSPATH
|
|
57 |
|
|
58 |
# Probe for IP addresses plumbed to IB interfaces
|
|
59 |
$JAVA -Djava.net.preferIPv4Stack=true ProbeIB > ib_addrs
|
|
60 |
|
|
61 |
# Create sdp.conf
|
|
62 |
SDPCONF=sdp.conf
|
|
63 |
rm ${SDPCONF}
|
|
64 |
touch ${SDPCONF}
|
|
65 |
cat ib_addrs | while read ADDR
|
|
66 |
do
|
|
67 |
echo "bind ${ADDR} *" > ${SDPCONF}
|
|
68 |
echo "connect ${ADDR} *" >> ${SDPCONF}
|
|
69 |
done
|
|
70 |
|
|
71 |
# Sanity check
|
|
72 |
$JAVA -Djava.net.preferIPv4Stack=true -Dcom.sun.sdp.conf=${SDPCONF} -Dcom.sun.sdp.debug Sanity
|