jdk/test/sun/security/pkcs11/Provider/Login.sh
author tbell
Tue, 11 Nov 2008 22:01:08 -0800
changeset 1546 a02228c60567
parent 2 90ce3da70b43
child 3433 3b2490b7a752
permissions -rw-r--r--
6764892: VS2008 changes required to compile hotspot sources Summary: Minor changes required to build using the Visual Studio 2008 compiler Reviewed-by: kvn, ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
# Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
# @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
# @bug 4850423
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
# @summary login facilities for hardware tokens
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# @run shell Login.sh
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# set a few environment variables so that the shell-script can run stand-alone
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
# in the source directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
# if running by hand on windows, change TESTSRC and TESTCLASSES to "."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
if [ "${TESTSRC}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
    TESTSRC=`pwd`
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
if [ "${TESTCLASSES}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    TESTCLASSES=`pwd`
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
# if running by hand on windows, change this to appropriate value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
if [ "${TESTJAVA}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
echo TESTSRC=${TESTSRC}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
echo TESTCLASSES=${TESTCLASSES}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
echo TESTJAVA=${TESTJAVA}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
echo ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
# let java test exit if platform unsupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
OS=`uname -s`
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
case "$OS" in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
  SunOS )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    FS="/"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    PS=":"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    CP="${FS}bin${FS}cp"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    CHMOD="${FS}bin${FS}chmod"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
  Linux )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    FS="/"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    PS=":"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    CP="${FS}bin${FS}cp"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    CHMOD="${FS}bin${FS}chmod"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
  Windows* )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    FS="\\"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    PS=";"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    CP="cp"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    CHMOD="chmod"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
esac
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
# first make cert/key DBs writable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}cert8.db ${TESTCLASSES}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
${CHMOD} +w ${TESTCLASSES}${FS}cert8.db
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}key3.db ${TESTCLASSES}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
${CHMOD} +w ${TESTCLASSES}${FS}key3.db
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
# compile test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
${TESTJAVA}${FS}bin${FS}javac \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
	-classpath ${TESTSRC}${FS}.. \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
	-d ${TESTCLASSES} \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
	${TESTSRC}${FS}Login.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
# run test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
${TESTJAVA}${FS}bin${FS}java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
	-classpath ${TESTCLASSES} \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
	-DCUSTOM_DB_DIR=${TESTCLASSES} \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
	-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}Login-nss.txt \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
	-DNO_DEFAULT=true \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
	-DNO_DEIMOS=true \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
	-Dtest.src=${TESTSRC} \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
	-Dtest.classes=${TESTCLASSES} \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
	-Djava.security.manager \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
	-Djava.security.policy=${TESTSRC}${FS}Login.policy \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
	-Djava.security.debug=${DEBUG} \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
	Login
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
# save error status
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
status=$?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
# return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
exit $status