author | jjiang |
Wed, 15 Aug 2018 18:41:18 +0800 | |
changeset 51460 | 97e361fe3433 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
291
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
1 |
# |
51460
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
2 |
# Copyright (c) 2008, 2018, 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 | 19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
# or visit www.oracle.com if you need additional information or have any |
|
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 |
# |
51460
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
28 |
# @library /test/lib .. |
10332
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} |
51460
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
55 |
echo CPAPPEND=${CPAPPEND} |
291
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
56 |
echo "" |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
57 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
58 |
#DEBUG=sunpkcs11,pkcs11keystore |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
59 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
60 |
echo DEBUG=${DEBUG} |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
61 |
echo "" |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
62 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
63 |
OS=`uname -s` |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
64 |
case "$OS" in |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
65 |
SunOS ) |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
66 |
FS="/" |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
67 |
PS=":" |
10332
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
68 |
OS_VERSION=`uname -r` |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
69 |
case "${OS_VERSION}" in |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
70 |
5.1* ) |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
71 |
SOFTTOKEN_DIR=${TESTCLASSES} |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
72 |
export SOFTTOKEN_DIR |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
73 |
TOKENS="nss solaris" |
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 |
* ) |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
76 |
# 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
|
77 |
TOKENS="nss" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
78 |
;; |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
79 |
esac |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
80 |
;; |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
81 |
Windows_* ) |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
82 |
FS="\\" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
83 |
PS=";" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
84 |
TOKENS="nss" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
85 |
;; |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
86 |
CYGWIN* ) |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
87 |
FS="/" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
88 |
PS=";" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
89 |
TOKENS="nss" |
291
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
90 |
;; |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
91 |
* ) |
10332
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
92 |
FS="/" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
93 |
PS=":" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
94 |
TOKENS="nss" |
291
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
95 |
;; |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
96 |
esac |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
97 |
|
10332
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
98 |
CP="cp -f" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
99 |
RM="rm -rf" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
100 |
MKDIR="mkdir -p" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
101 |
CHMOD="chmod" |
9037c51ae512
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
weijun
parents:
5506
diff
changeset
|
102 |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10332
diff
changeset
|
103 |
|
291
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
104 |
STATUS=0 |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
105 |
for token in ${TOKENS} |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
106 |
do |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
107 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
108 |
if [ ${token} = "nss" ] |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
109 |
then |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
110 |
# 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
|
111 |
${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
|
112 |
${CHMOD} +w ${TESTCLASSES}${FS}cert8.db |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
113 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
114 |
${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
|
115 |
${CHMOD} +w ${TESTCLASSES}${FS}key3.db |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
116 |
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
|
117 |
elif [ ${token} = "solaris" ] |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
118 |
then |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
119 |
# copy keystore into write-able location |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
120 |
if [ -d ${TESTCLASSES}${FS}pkcs11_softtoken ] |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
121 |
then |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
122 |
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
|
123 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
124 |
echo ${RM} ${TESTCLASSES}${FS}pkcs11_softtoken |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
125 |
${RM} ${TESTCLASSES}${FS}pkcs11_softtoken |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
126 |
fi |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
127 |
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
|
128 |
${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
|
129 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
130 |
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
|
131 |
${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
|
132 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
133 |
echo ${CP} ${TESTSRC}${FS}BasicData${FS}pkcs11_softtoken${FS}objstore_info \ |
51460
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
134 |
${TESTCLASSES}${FS}pkcs11_softtoken |
291
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
135 |
${CP} ${TESTSRC}${FS}BasicData${FS}pkcs11_softtoken${FS}objstore_info \ |
51460
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
136 |
${TESTCLASSES}${FS}pkcs11_softtoken |
291
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
137 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
138 |
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
|
139 |
${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
|
140 |
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
|
141 |
fi |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
142 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
143 |
# run test |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
144 |
cd ${TESTSRC} |
14786
a9f61e0cbe61
8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents:
14342
diff
changeset
|
145 |
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \ |
51460
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
146 |
-DDIR=${TESTSRC}${FS}BasicData${FS} \ |
20486
628fe9d47885
8004283: test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failing intermittently
ascarpino
parents:
14786
diff
changeset
|
147 |
-classpath \ |
51460
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
148 |
${TESTCLASSES}${PS}${TESTCLASSES}${FS}..${PS}${TESTSRC}${FS}loader.jar${PS}${CPAPPEND} \ |
291
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
149 |
-DCUSTOM_DB_DIR=${TESTCLASSES} \ |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
150 |
-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${token}.txt \ |
51460
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
151 |
-DNO_DEFAULT=true \ |
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
152 |
-DNO_DEIMOS=true \ |
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
153 |
-DTOKEN=${token} \ |
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
154 |
-Djava.security.debug=${DEBUG} \ |
97e361fe3433
8164639: Configure PKCS11 tests to use user-supplied NSS libraries
jjiang
parents:
47216
diff
changeset
|
155 |
SecretKeysBasic |
291
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 |
# -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
|
158 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
159 |
# save error status |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
160 |
if [ $? != 0 ] |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
161 |
then |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
162 |
echo "Test against " ${token} " Failed!" |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
163 |
STATUS=1 |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
164 |
fi |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
165 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
166 |
# clean up |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
167 |
${RM} ${USED_FILE_LIST} |
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 |
done |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
170 |
|
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
171 |
# return |
be2e0a87d658
6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff
changeset
|
172 |
exit ${STATUS} |