2310N/A#
2362N/A# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
2310N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2310N/A#
2310N/A# This code is free software; you can redistribute it and/or modify it
2310N/A# under the terms of the GNU General Public License version 2 only, as
2310N/A# published by the Free Software Foundation.
2310N/A#
2310N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2310N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2310N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2310N/A# version 2 for more details (a copy is included in the LICENSE file that
2310N/A# accompanied this code).
2310N/A#
2310N/A# You should have received a copy of the GNU General Public License version
2310N/A# 2 along with this work; if not, write to the Free Software Foundation,
2310N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2310N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
2310N/A#
2310N/A
2310N/A# @test
2310N/A# @bug 6317711 6944847
2310N/A# @summary Ensure the GSSName has the correct impl which respects
2310N/A# the contract for equals and hashCode across different configurations.
2310N/A
2310N/A# set a few environment variables so that the shell-script can run stand-alone
2310N/A# in the source directory
2310N/A
2310N/Aif [ "${TESTSRC}" = "" ] ; then
2310N/A TESTSRC="."
2310N/Afi
2310N/A
2310N/Aif [ "${TESTCLASSES}" = "" ] ; then
2310N/A TESTCLASSES="."
2310N/Afi
2310N/A
2310N/Aif [ "${TESTJAVA}" = "" ] ; then
2310N/A echo "TESTJAVA not set. Test cannot execute."
2310N/A echo "FAILED!!!"
2310N/A exit 1
2310N/Afi
2310N/A
2310N/ANATIVE=false
2310N/A
2310N/A# set platform-dependent variables
2310N/AOS=`uname -s`
2310N/Acase "$OS" in
4774N/A SunOS | Linux )
2310N/A PATHSEP=":"
2310N/A FILESEP="/"
2310N/A NATIVE=true
2310N/A ;;
4774N/A Darwin )
4774N/A PATHSEP=":"
4774N/A FILESEP="/"
4774N/A ;;
2310N/A CYGWIN* )
2310N/A PATHSEP=";"
2310N/A FILESEP="/"
2310N/A ;;
2310N/A Windows* )
2310N/A PATHSEP=";"
2310N/A FILESEP="\\"
2310N/A ;;
2310N/A * )
2310N/A echo "Unrecognized system!"
2310N/A exit 1;
2310N/A ;;
2310N/Aesac
2310N/A
2310N/ATEST=Krb5NameEquals
2310N/A
2310N/A${TESTJAVA}${FILESEP}bin${FILESEP}javac \
2310N/A -d ${TESTCLASSES}${FILESEP} \
2310N/A ${TESTSRC}${FILESEP}${TEST}.java
2310N/A
2310N/AEXIT_STATUS=0
2310N/A
2310N/Aif [ "${NATIVE}" = "true" ] ; then
2310N/A echo "Testing native provider"
2310N/A ${TESTJAVA}${FILESEP}bin${FILESEP}java \
2310N/A -classpath ${TESTCLASSES} \
2310N/A -Dsun.security.jgss.native=true \
2310N/A ${TEST}
2310N/A if [ $? != 0 ] ; then
2310N/A echo "Native provider fails"
2310N/A EXIT_STATUS=1
2310N/A fi
2310N/Afi
2310N/A
2310N/Aecho "Testing java provider"
2310N/A${TESTJAVA}${FILESEP}bin${FILESEP}java \
2310N/A -classpath ${TESTCLASSES} \
2310N/A -Djava.security.krb5.realm=R \
2310N/A -Djava.security.krb5.kdc=127.0.0.1 \
2310N/A ${TEST}
2310N/Aif [ $? != 0 ] ; then
2310N/A echo "Java provider fails"
2310N/A EXIT_STATUS=1
2310N/Afi
2310N/A
2310N/Aexit ${EXIT_STATUS}