Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/sun/security/pkcs11/Provider/Login.sh
38855 views
#1# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#2223# @test24# @bug 485042325# @summary login facilities for hardware tokens26#27# @run shell Login.sh2829# set a few environment variables so that the shell-script can run stand-alone30# in the source directory3132# if running by hand on windows, change TESTSRC and TESTCLASSES to "."33if [ "${TESTSRC}" = "" ] ; then34TESTSRC=`pwd`35fi36if [ "${TESTCLASSES}" = "" ] ; then37TESTCLASSES=`pwd`38fi3940# if running by hand on windows, change this to appropriate value41if [ "${TESTJAVA}" = "" ] ; then42TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"43fi44if [ "${COMPILEJAVA}" = "" ]; then45COMPILEJAVA="${TESTJAVA}"46fi47echo TESTSRC=${TESTSRC}48echo TESTCLASSES=${TESTCLASSES}49echo TESTJAVA=${TESTJAVA}50echo COMPILEJAVA=${COMPILEJAVA}51echo ""5253# let java test exit if platform unsupported5455OS=`uname -s`56case "$OS" in57SunOS )58FS="/"59PS=":"60CP="${FS}bin${FS}cp"61CHMOD="${FS}bin${FS}chmod"62;;63Linux )64FS="/"65PS=":"66CP="${FS}bin${FS}cp"67CHMOD="${FS}bin${FS}chmod"68;;69Darwin )70FS="/"71PS=":"72CP="${FS}bin${FS}cp"73CHMOD="${FS}bin${FS}chmod"74;;75AIX )76FS="/"77PS=":"78CP="${FS}bin${FS}cp"79CHMOD="${FS}bin${FS}chmod"80;;81Windows* )82FS="\\"83PS=";"84CP="cp"85CHMOD="chmod"86;;87CYGWIN* )88FS="/"89PS=";"90CP="cp"91CHMOD="chmod"92#93# javac does not like /cygdrive produced by `pwd`94#95TESTSRC=`cygpath -d ${TESTSRC}`96;;97* )98echo "Unrecognized system!"99exit 1;100;;101esac102103# first make cert/key DBs writable104105${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}cert8.db ${TESTCLASSES}106${CHMOD} +w ${TESTCLASSES}${FS}cert8.db107108${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}key3.db ${TESTCLASSES}109${CHMOD} +w ${TESTCLASSES}${FS}key3.db110111# compile test112113${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \114-classpath ${TESTSRC}${FS}.. \115-d ${TESTCLASSES} \116${TESTSRC}${FS}Login.java \117${TESTSRC}${FS}..${FS}PKCS11Test.java118119# run test120121${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \122-classpath ${TESTCLASSES} \123-DCUSTOM_DB_DIR=${TESTCLASSES} \124-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}Login-nss.txt \125-DNO_DEFAULT=true \126-DNO_DEIMOS=true \127-Dtest.src=${TESTSRC} \128-Dtest.classes=${TESTCLASSES} \129-Djava.security.manager \130-Djava.security.policy=${TESTSRC}${FS}Login.policy \131-Djava.security.debug=${DEBUG} \132Login133134# save error status135status=$?136137# return138exit $status139140141