comparison test/sun/net/sdp/sanity.sh @ 1040:93d1fbe001b8

4890703: Support SDP (sol) Reviewed-by: michaelm
author alanb
date Mon, 06 Apr 2009 08:59:33 +0100
parents
children 00cd9dc3c2b5
comparison
equal deleted inserted replaced
-1:000000000000 0:61f290b4ba26
1 #
2 # Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
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 #
19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 # CA 95054 USA or visit www.sun.com if you need additional information or
21 # have any questions.
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