jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh
author alanb
Fri, 02 Nov 2012 15:50:11 +0000
changeset 14342 8435a30053c1
parent 12047 320a714614e9
child 14786 a9f61e0cbe61
permissions -rw-r--r--
7197491: update copyright year to match last edit in jdk8 jdk repository Reviewed-by: chegar, ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     1
#
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 12047
diff changeset
     2
# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     4
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     7
# published by the Free Software Foundation.
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     8
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    13
# accompanied this code).
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    14
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    18
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 291
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 291
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 291
diff changeset
    21
# questions.
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    22
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    23
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    24
# @test
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    25
# @bug 6599979
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    26
# @summary Ensure that re-assigning the alias works
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    27
#
10332
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    28
# @library ..
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    29
# @build SecretKeysBasic
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    30
# @run shell SecretKeysBasic.sh
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    31
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    32
# To run by hand:
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    33
#    %sh SecretKeysBasic.sh
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    34
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    35
# Note:
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    36
#    . test only runs on solaris at the moment
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    37
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    38
# set a few environment variables so that the shell-script can run stand-alone
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    39
# in the source directory
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    40
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    41
# if running by hand on windows, change TESTSRC and TESTCLASSES to "."
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    42
if [ "${TESTSRC}" = "" ] ; then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    43
    TESTSRC=`pwd`
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    44
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    45
if [ "${TESTCLASSES}" = "" ] ; then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    46
    TESTCLASSES=`pwd`
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    47
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    48
if [ "${TESTJAVA}" = "" ] ; then
10332
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    49
    JAVAC_CMD=`which javac`
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    50
    TESTJAVA=`dirname $JAVAC_CMD`/..
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    51
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    52
echo TESTSRC=${TESTSRC}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    53
echo TESTCLASSES=${TESTCLASSES}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    54
echo TESTJAVA=${TESTJAVA}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    55
echo ""
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    56
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    57
#DEBUG=sunpkcs11,pkcs11keystore
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    58
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    59
echo DEBUG=${DEBUG}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    60
echo ""
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    61
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    62
OS=`uname -s`
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    63
case "$OS" in
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    64
  SunOS )
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    65
    FS="/"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    66
    PS=":"
10332
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    67
    OS_VERSION=`uname -r`
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    68
    case "${OS_VERSION}" in
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    69
      5.1* )
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    70
        SOFTTOKEN_DIR=${TESTCLASSES}
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    71
        export SOFTTOKEN_DIR
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    72
        TOKENS="nss solaris"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    73
        ;;
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    74
      * )
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    75
        # SunPKCS11-Solaris Test only runs on Solaris 5.10 and later
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    76
        TOKENS="nss"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    77
        ;;
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    78
    esac
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    79
    ;;
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    80
  Windows_* )
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    81
    FS="\\"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    82
    PS=";"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    83
    TOKENS="nss"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    84
    ;;
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    85
  CYGWIN* )
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    86
    FS="/"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    87
    PS=";"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    88
    TOKENS="nss"
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    89
    ;;
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    90
  * )
10332
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    91
    FS="/"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    92
    PS=":"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    93
    TOKENS="nss"
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    94
    ;;
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    95
esac
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    96
10332
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    97
CP="cp -f"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    98
RM="rm -rf"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
    99
MKDIR="mkdir -p"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
   100
CHMOD="chmod"
9037c51ae512 7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents: 5506
diff changeset
   101
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10332
diff changeset
   102
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   103
STATUS=0
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   104
for token in ${TOKENS}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   105
do
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   106
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   107
if [ ${token} = "nss" ]
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   108
then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   109
    # make cert/key DBs writable if token is NSS
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   110
    ${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}cert8.db ${TESTCLASSES}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   111
    ${CHMOD} +w ${TESTCLASSES}${FS}cert8.db
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   112
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   113
    ${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}key3.db ${TESTCLASSES}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   114
    ${CHMOD} +w ${TESTCLASSES}${FS}key3.db
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   115
    USED_FILE_LIST="${TESTCLASSES}${FS}cert8.db ${TESTCLASSES}${FS}key3.db"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   116
elif [ ${token} = "solaris" ]
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   117
then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   118
    # copy keystore into write-able location
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   119
    if [ -d ${TESTCLASSES}${FS}pkcs11_softtoken ]
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   120
    then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   121
        echo "Removing old pkcs11_keystore, creating new pkcs11_keystore"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   122
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   123
        echo ${RM} ${TESTCLASSES}${FS}pkcs11_softtoken
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   124
        ${RM} ${TESTCLASSES}${FS}pkcs11_softtoken
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   125
    fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   126
    echo ${MKDIR} ${TESTCLASSES}${FS}pkcs11_softtoken${FS}private
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   127
    ${MKDIR} ${TESTCLASSES}${FS}pkcs11_softtoken${FS}private
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   128
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   129
    echo ${MKDIR} ${TESTCLASSES}${FS}pkcs11_softtoken${FS}public
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   130
    ${MKDIR} ${TESTCLASSES}${FS}pkcs11_softtoken${FS}public
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   131
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   132
    echo ${CP} ${TESTSRC}${FS}BasicData${FS}pkcs11_softtoken${FS}objstore_info \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   133
	${TESTCLASSES}${FS}pkcs11_softtoken
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   134
    ${CP} ${TESTSRC}${FS}BasicData${FS}pkcs11_softtoken${FS}objstore_info \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   135
	${TESTCLASSES}${FS}pkcs11_softtoken
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   136
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   137
    echo ${CHMOD} +w ${TESTCLASSES}${FS}pkcs11_softtoken${FS}objstore_info
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   138
    ${CHMOD} 600 ${TESTCLASSES}${FS}pkcs11_softtoken${FS}objstore_info
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   139
    USED_FILE_LIST="${TESTCLASSES}${FS}pkcs11_softtoken"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   140
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   141
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   142
# run test
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   143
cd ${TESTSRC}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   144
${TESTJAVA}${FS}bin${FS}java \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   145
	-DDIR=${TESTSRC}${FS}BasicData${FS} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   146
        -classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   147
        -DCUSTOM_DB_DIR=${TESTCLASSES} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   148
        -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${token}.txt \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   149
	-DNO_DEFAULT=true \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   150
	-DNO_DEIMOS=true \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   151
	-DTOKEN=${token} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   152
	-Djava.security.debug=${DEBUG} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   153
	SecretKeysBasic
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   154
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   155
#	-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${token}.txt \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   156
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   157
# save error status
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   158
if [ $? != 0 ]
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   159
then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   160
    echo "Test against " ${token} " Failed!"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   161
    STATUS=1
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   162
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   163
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   164
# clean up
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   165
${RM} ${USED_FILE_LIST}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   166
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   167
done
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   168
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   169
# return
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   170
exit ${STATUS}