author | vinnie |
Mon, 05 Mar 2012 14:13:29 +0000 | |
changeset 12042 | 88bd85bd793d |
parent 12039 | fe21bbf8f775 |
child 12294 | f313586fc3cc |
permissions | -rw-r--r-- |
2 | 1 |
# |
12042 | 2 |
# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
# |
|
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. |
|
2 | 22 |
# |
23 |
||
24 |
# @test |
|
25 |
# @summary (almost) all keytool behaviors |
|
26 |
# @author Weijun Wang |
|
27 |
# |
|
2067
6f9db5f305cd
6780416: New keytool commands/options: -gencert, -printcertreq, -ext
weijun
parents:
629
diff
changeset
|
28 |
# This test is only executed on several platforms |
6f9db5f305cd
6780416: New keytool commands/options: -gencert, -printcertreq, -ext
weijun
parents:
629
diff
changeset
|
29 |
# |
2 | 30 |
# set a few environment variables so that the shell-script can run stand-alone |
31 |
# in the source directory |
|
32 |
if [ "${TESTSRC}" = "" ] ; then |
|
33 |
TESTSRC="." |
|
34 |
fi |
|
35 |
if [ "${TESTCLASSES}" = "" ] ; then |
|
36 |
TESTCLASSES="." |
|
37 |
fi |
|
38 |
if [ "${TESTJAVA}" = "" ] ; then |
|
39 |
echo "TESTJAVA not set. Test cannot execute." |
|
40 |
echo "FAILED!!!" |
|
41 |
exit 1 |
|
42 |
fi |
|
43 |
||
44 |
# set platform-dependent variables |
|
45 |
OS=`uname -s` |
|
46 |
case "$OS" in |
|
47 |
SunOS ) |
|
48 |
FS="/" |
|
49 |
LIBNAME=libsoftokn3.so |
|
50 |
ARCH=`isainfo` |
|
51 |
case "$ARCH" in |
|
52 |
sparc* ) |
|
12042 | 53 |
PF="solaris-sparc" |
2 | 54 |
;; |
55 |
* ) |
|
56 |
echo "Will not run test on: Solaris ${ARCH}" |
|
57 |
exit 0; |
|
58 |
;; |
|
59 |
esac |
|
60 |
;; |
|
61 |
Linux ) |
|
62 |
LIBNAME=libsoftokn3.so |
|
63 |
ARCH=`uname -m` |
|
64 |
FS="/" |
|
65 |
case "$ARCH" in |
|
66 |
i[3-6]86 ) |
|
12042 | 67 |
PF="linux-i586" |
2 | 68 |
;; |
69 |
* ) |
|
70 |
echo "Will not run test on: Linux ${ARCH}" |
|
71 |
exit 0; |
|
72 |
;; |
|
73 |
esac |
|
74 |
;; |
|
75 |
* ) |
|
76 |
echo "Will not run test on: ${OS}" |
|
77 |
exit 0; |
|
78 |
;; |
|
79 |
esac |
|
80 |
||
81 |
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}KeyToolTest.java || exit 10 |
|
82 |
||
83 |
NSS=${TESTSRC}${FS}..${FS}..${FS}pkcs11${FS}nss |
|
84 |
||
85 |
cp ${TESTSRC}${FS}p11-nss.txt . |
|
86 |
cp ${NSS}${FS}db${FS}cert8.db . |
|
87 |
cp ${NSS}${FS}db${FS}key3.db . |
|
88 |
cp ${NSS}${FS}db${FS}secmod.db . |
|
89 |
||
90 |
chmod u+w key3.db |
|
91 |
chmod u+w cert8.db |
|
92 |
||
2067
6f9db5f305cd
6780416: New keytool commands/options: -gencert, -printcertreq, -ext
weijun
parents:
629
diff
changeset
|
93 |
echo | ${TESTJAVA}${FS}bin${FS}java -Dnss \ |
12042 | 94 |
-Dnss.lib=${NSS}${FS}lib${FS}${PF}${FS}${LIBNAME} \ |
629 | 95 |
KeyToolTest |
96 |
status=$? |
|
2 | 97 |
|
98 |
rm -f p11-nss.txt |
|
99 |
rm -f cert8.db |
|
100 |
rm -f key3.db |
|
101 |
rm -f secmod.db |
|
102 |
||
103 |
rm HumanInputStream*.class |
|
2067
6f9db5f305cd
6780416: New keytool commands/options: -gencert, -printcertreq, -ext
weijun
parents:
629
diff
changeset
|
104 |
rm KeyToolTest*.class |
6f9db5f305cd
6780416: New keytool commands/options: -gencert, -printcertreq, -ext
weijun
parents:
629
diff
changeset
|
105 |
rm TestException.class |
2 | 106 |
|
629 | 107 |
exit $status |
108 |