annotate test/sun/security/krb5/runNameEquals.sh @ 6252:ae5d04dbacd6

8003890: corelibs test scripts should pass TESTVMOPTS Reviewed-by: chegar, alanb Contributed-by: Mark Sheppard <mark.sheppard@oracle.com>
author chegar
date Thu, 13 Dec 2012 14:47:35 +0000
parents cea72c2bf071
children 7da291690aa0
rev   line source
weijun@2310 1 #
alanb@6073 2 # Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
weijun@2310 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
weijun@2310 4 #
weijun@2310 5 # This code is free software; you can redistribute it and/or modify it
weijun@2310 6 # under the terms of the GNU General Public License version 2 only, as
weijun@2310 7 # published by the Free Software Foundation.
weijun@2310 8 #
weijun@2310 9 # This code is distributed in the hope that it will be useful, but WITHOUT
weijun@2310 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
weijun@2310 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
weijun@2310 12 # version 2 for more details (a copy is included in the LICENSE file that
weijun@2310 13 # accompanied this code).
weijun@2310 14 #
weijun@2310 15 # You should have received a copy of the GNU General Public License version
weijun@2310 16 # 2 along with this work; if not, write to the Free Software Foundation,
weijun@2310 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
weijun@2310 18 #
ohair@2362 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@2362 20 # or visit www.oracle.com if you need additional information or have any
ohair@2362 21 # questions.
weijun@2310 22 #
weijun@2310 23
weijun@2310 24 # @test
weijun@2310 25 # @bug 6317711 6944847
weijun@2310 26 # @summary Ensure the GSSName has the correct impl which respects
weijun@2310 27 # the contract for equals and hashCode across different configurations.
weijun@2310 28
weijun@2310 29 # set a few environment variables so that the shell-script can run stand-alone
weijun@2310 30 # in the source directory
weijun@2310 31
weijun@2310 32 if [ "${TESTSRC}" = "" ] ; then
weijun@2310 33 TESTSRC="."
weijun@2310 34 fi
weijun@2310 35
weijun@2310 36 if [ "${TESTCLASSES}" = "" ] ; then
weijun@2310 37 TESTCLASSES="."
weijun@2310 38 fi
weijun@2310 39
weijun@2310 40 if [ "${TESTJAVA}" = "" ] ; then
weijun@2310 41 echo "TESTJAVA not set. Test cannot execute."
weijun@2310 42 echo "FAILED!!!"
weijun@2310 43 exit 1
weijun@2310 44 fi
weijun@2310 45
weijun@2310 46 NATIVE=false
weijun@2310 47
weijun@2310 48 # set platform-dependent variables
weijun@2310 49 OS=`uname -s`
weijun@2310 50 case "$OS" in
michaelm@5116 51 SunOS | Linux )
weijun@2310 52 PATHSEP=":"
weijun@2310 53 FILESEP="/"
weijun@2310 54 NATIVE=true
weijun@2310 55 ;;
michaelm@5116 56 Darwin )
weijun@2310 57 PATHSEP=":"
weijun@2310 58 FILESEP="/"
weijun@2310 59 ;;
weijun@2310 60 CYGWIN* )
weijun@2310 61 PATHSEP=";"
weijun@2310 62 FILESEP="/"
weijun@2310 63 ;;
weijun@2310 64 Windows* )
weijun@2310 65 PATHSEP=";"
weijun@2310 66 FILESEP="\\"
weijun@2310 67 ;;
weijun@2310 68 * )
weijun@2310 69 echo "Unrecognized system!"
weijun@2310 70 exit 1;
weijun@2310 71 ;;
weijun@2310 72 esac
weijun@2310 73
weijun@2310 74 TEST=Krb5NameEquals
weijun@2310 75
weijun@2310 76 ${TESTJAVA}${FILESEP}bin${FILESEP}javac \
weijun@2310 77 -d ${TESTCLASSES}${FILESEP} \
weijun@2310 78 ${TESTSRC}${FILESEP}${TEST}.java
weijun@2310 79
weijun@2310 80 EXIT_STATUS=0
weijun@2310 81
weijun@2310 82 if [ "${NATIVE}" = "true" ] ; then
weijun@2310 83 echo "Testing native provider"
chegar@6252 84 ${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
weijun@2310 85 -classpath ${TESTCLASSES} \
weijun@2310 86 -Dsun.security.jgss.native=true \
weijun@2310 87 ${TEST}
weijun@2310 88 if [ $? != 0 ] ; then
weijun@2310 89 echo "Native provider fails"
weijun@2310 90 EXIT_STATUS=1
weijun@2310 91 fi
weijun@2310 92 fi
weijun@2310 93
weijun@2310 94 echo "Testing java provider"
chegar@6252 95 ${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
weijun@2310 96 -classpath ${TESTCLASSES} \
weijun@2310 97 -Djava.security.krb5.realm=R \
weijun@2310 98 -Djava.security.krb5.kdc=127.0.0.1 \
weijun@2310 99 ${TEST}
weijun@2310 100 if [ $? != 0 ] ; then
weijun@2310 101 echo "Java provider fails"
weijun@2310 102 EXIT_STATUS=1
weijun@2310 103 fi
weijun@2310 104
weijun@2310 105 exit ${EXIT_STATUS}