author | weijun |
Fri, 25 Apr 2014 10:57:09 +0800 | |
changeset 24116 | 9f9b4ba34aad |
parent 23237 | 0c0c7f131faa |
permissions | -rw-r--r-- |
904
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
1 |
# |
23237 | 2 |
# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. |
904
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
4 |
# |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
8 |
# |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
13 |
# accompanied this code). |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
14 |
# |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
15 |
# You should have received a copy of the GNU General Public License version |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation, |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
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. |
|
904
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
22 |
# |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
23 |
|
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
24 |
# @test |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
25 |
# @bug 6480981 |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
26 |
# @summary keytool should be able to import certificates from remote SSL servers |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
27 |
|
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
28 |
if [ "${TESTSRC}" = "" ] ; then |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
29 |
TESTSRC="." |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
30 |
fi |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
31 |
if [ "${TESTJAVA}" = "" ] ; then |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
32 |
echo "TESTJAVA not set. Test cannot execute." |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
33 |
echo "FAILED!!!" |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
34 |
exit 1 |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
35 |
fi |
15254
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
36 |
if [ "${COMPILEJAVA}" = "" ]; then |
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
37 |
COMPILEJAVA="${TESTJAVA}" |
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
38 |
fi |
904
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
39 |
|
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
40 |
# set platform-dependent variables |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
41 |
OS=`uname -s` |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
42 |
case "$OS" in |
22602
0d9a07b0d7e9
8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents:
15254
diff
changeset
|
43 |
SunOS | Linux | Darwin | AIX ) |
904
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
44 |
FS="/" |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
45 |
;; |
3433 | 46 |
CYGWIN* ) |
47 |
FS="/" |
|
48 |
;; |
|
904
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
49 |
Windows_* ) |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
50 |
FS="\\" |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
51 |
;; |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
52 |
* ) |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
53 |
echo "Unrecognized operating system!" |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
54 |
exit 1; |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
55 |
;; |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
56 |
esac |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
57 |
|
15254
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
58 |
${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}PrintSSL.java || exit 10 |
23237 | 59 |
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dtest.src=$TESTSRC PrintSSL | ( |
60 |
read PORT |
|
61 |
if [ "$PORT" = "" ]; then |
|
62 |
echo "Server not started" |
|
63 |
exit 2 |
|
64 |
else |
|
24116
9f9b4ba34aad
8040321: keytool and jarsigner tests doesn't pass though VM tools to tools
weijun
parents:
23237
diff
changeset
|
65 |
${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -printcert -sslserver localhost:$PORT |
23237 | 66 |
fi |
67 |
) |
|
904
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
68 |
status=$? |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
69 |
|
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
70 |
rm PrintSSL*.class |
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
71 |
|
eadc9fa4b700
6480981: keytool should be able to import certificates from remote SSL servers
weijun
parents:
diff
changeset
|
72 |
exit $status |