jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
changeset 2 90ce3da70b43
child 3433 3b2490b7a752
equal deleted inserted replaced
0:fd16c54261b3 2:90ce3da70b43
       
     1 #
       
     2 # Copyright 2004-2005 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 5070773
       
    26 # @summary SunPKCS11 provider does not support spaces config's provider name
       
    27 # @run shell ConfigQuotedString.sh
       
    28 
       
    29 # set a few environment variables so that the shell-script can run stand-alone
       
    30 # in the source directory
       
    31 
       
    32 # if running by hand on windows, change TESTSRC and TESTCLASSES to "."
       
    33 if [ "${TESTSRC}" = "" ] ; then
       
    34     TESTSRC=`pwd`
       
    35 fi
       
    36 if [ "${TESTCLASSES}" = "" ] ; then
       
    37     TESTCLASSES=`pwd`
       
    38 fi
       
    39 
       
    40 # if running by hand on windows, change this to appropriate value
       
    41 if [ "${TESTJAVA}" = "" ] ; then
       
    42     TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"
       
    43 fi
       
    44 echo TESTSRC=${TESTSRC}
       
    45 echo TESTCLASSES=${TESTCLASSES}
       
    46 echo TESTJAVA=${TESTJAVA}
       
    47 echo ""
       
    48 
       
    49 # let java test exit if platform unsupported
       
    50 
       
    51 OS=`uname -s`
       
    52 case "$OS" in
       
    53   SunOS )
       
    54     FS="/"
       
    55     PS=":"
       
    56     CP="${FS}bin${FS}cp"
       
    57     CHMOD="${FS}bin${FS}chmod"
       
    58     ;;
       
    59   Linux )
       
    60     FS="/"
       
    61     PS=":"
       
    62     CP="${FS}bin${FS}cp"
       
    63     CHMOD="${FS}bin${FS}chmod"
       
    64     ;;
       
    65   Windows* )
       
    66     FS="\\"
       
    67     PS=";"
       
    68     CP="cp"
       
    69     CHMOD="chmod"
       
    70     ;;
       
    71 esac
       
    72 
       
    73 # compile test
       
    74 
       
    75 ${TESTJAVA}${FS}bin${FS}javac \
       
    76 	-classpath ${TESTSRC}${FS}.. \
       
    77 	-d ${TESTCLASSES} \
       
    78 	${TESTSRC}${FS}ConfigQuotedString.java
       
    79 
       
    80 # run test
       
    81 
       
    82 ${TESTJAVA}${FS}bin${FS}java \
       
    83 	-classpath ${TESTCLASSES} \
       
    84 	-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ConfigQuotedString-nss.txt \
       
    85 	-Dtest.src=${TESTSRC} \
       
    86 	-Dtest.classes=${TESTCLASSES} \
       
    87 	ConfigQuotedString
       
    88 
       
    89 # save error status
       
    90 status=$?
       
    91 
       
    92 # return
       
    93 exit $status