author | weijun |
Fri, 15 Nov 2019 09:06:58 +0800 | |
changeset 59104 | 046e4024e55a |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
2 | 1 |
# |
59104 | 2 |
# Copyright (c) 2006, 2019, 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 |
|
17165
80d6d9e57fbc
8005527: [TEST_BUG] console.sh failed Automatically with exit code 1.
weijun
parents:
14699
diff
changeset
|
25 |
# @bug 6418647 8005527 |
2 | 26 |
# @summary Doc bug 5035358 shows sun.security.util.Password.readPassword() is buggy. |
27 |
# @author Weijun Wang |
|
28 |
# @run shell/manual console.sh |
|
29 |
||
706 | 30 |
if [ "$ALT_PASS" = "" ]; then |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
31 |
PASSW=äöäöäö |
2 | 32 |
else |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
33 |
PASSW=$ALT_PASS |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
34 |
fi |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
35 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
36 |
KS=/tmp/kkk.$$ |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
37 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
38 |
cat <<____ |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
39 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
40 |
ATTENTION |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
41 |
=============================================================== |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
42 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
43 |
This test is about non-ASCII password input compatibility between |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
44 |
JDK 5.0 and later versions. Before running the test, make sure that -- |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
45 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
46 |
\$J5 points to a JDK 5.0 installation |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
47 |
\$JM points to the current installation |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
48 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
49 |
The password string used in this test is $PASSW. If you find difficulty |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
50 |
entering it in in your system, feel free to change it to something else |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
51 |
by providing \$ALT_PASS. It should be no less than 6 characters and include |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
52 |
some non-ASCII characters. |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
53 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
54 |
For each test, type into the characters as described in the test header. |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
55 |
<R> means the RETURN (or ENTER key). Please wait for a little while |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
56 |
after <R> is pressed each time. |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
57 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
58 |
\$J5 is now $J5 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
59 |
\$JM is now $JM |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
60 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
61 |
____ |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
62 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
63 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
64 |
if [ "$J5" = "" -o "$JM" = "" ]; then |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
65 |
echo "Define \$J5 and \$JM first" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
66 |
exit 1 |
2 | 67 |
fi |
68 |
||
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
69 |
echo "Press ENTER to start the test, or Ctrl-C to stop it" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
70 |
read x |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
71 |
|
2 | 72 |
echo |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
73 |
echo "==========================================" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
74 |
echo "Test #1: 5->6, non-prompt. Please type <R>" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
75 |
echo "==========================================" |
2 | 76 |
echo |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
77 |
rm $KS 2> /dev/null |
59104 | 78 |
$J5/bin/keytool -keystore $KS -genkey -keyalg DSA -dname CN=olala -storepass $PASSW || exit 1 |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
79 |
$JM/bin/keytool -keystore $KS -list -storepass $PASSW || exit 2 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
80 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
81 |
echo "==========================================" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
82 |
echo "Test #2: 6->5, non-prompt. Please type <R>" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
83 |
echo "==========================================" |
706 | 84 |
echo |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
85 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
86 |
rm $KS 2> /dev/null |
59104 | 87 |
$JM/bin/keytool -keystore $KS -genkey -keyalg DSA -dname CN=olala -storepass $PASSW || exit 3 |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
88 |
$J5/bin/keytool -keystore $KS -list -storepass $PASSW || exit 4 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
89 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
90 |
echo "============================================================" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
91 |
echo "Test #3: 5->6, prompt. Please type $PASSW <R> <R> $PASSW <R>" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
92 |
echo "============================================================" |
2 | 93 |
echo |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
94 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
95 |
rm $KS 2> /dev/null |
59104 | 96 |
$J5/bin/keytool -keystore $KS -genkey -keyalg DSA -dname CN=olala || exit 5 |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
97 |
$JM/bin/keytool -keystore $KS -list || exit 6 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
98 |
echo $PASSW| $J5/bin/keytool -keystore $KS -list || exit 7 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
99 |
echo $PASSW| $JM/bin/keytool -keystore $KS -list || exit 8 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
100 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
101 |
echo "=======================================================================" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
102 |
echo "Test #4: 6->5, prompt. Please type $PASSW <R> $PASSW <R> <R> $PASSW <R>" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
103 |
echo "=======================================================================" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
104 |
echo |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
105 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
106 |
rm $KS 2> /dev/null |
59104 | 107 |
$JM/bin/keytool -keystore $KS -genkey -keyalg DSA -dname CN=olala || exit 9 |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
108 |
$J5/bin/keytool -keystore $KS -list || exit 10 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
109 |
echo $PASSW| $JM/bin/keytool -keystore $KS -list || exit 11 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
110 |
echo $PASSW| $J5/bin/keytool -keystore $KS -list || exit 12 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
111 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
112 |
echo "===========================================" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
113 |
echo "Test #5: 5->6, pipe. Please type $PASSW <R>" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
114 |
echo "===========================================" |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
115 |
echo |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
116 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
117 |
rm $KS 2> /dev/null |
59104 | 118 |
echo $PASSW| $J5/bin/keytool -keystore $KS -genkey -keyalg DSA -dname CN=olala || exit 13 |
14699
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
119 |
$JM/bin/keytool -keystore $KS -list || exit 14 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
120 |
echo $PASSW| $J5/bin/keytool -keystore $KS -list || exit 15 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
121 |
echo $PASSW| $JM/bin/keytool -keystore $KS -list || exit 16 |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
122 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
123 |
rm $KS 2> /dev/null |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
124 |
|
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
125 |
echo |
c3ef2c941697
7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten
weijun
parents:
5506
diff
changeset
|
126 |
echo "Success" |
706 | 127 |
|
128 |
exit 0 |