提交 be6569ac 编写于 作者: W weijun

8015274: TEST_BUG: Step2: After selecting 'View Warning Log', it is empty instead of FileNotFound.

8015276: TEST_BUG: The 'ptool.test' can't be saved in the 'tmp' folder.
8016158: Instruction is not clear on how to use keytool to create JKS store in case
Reviewed-by: mullan
上级 7e1aff59
...@@ -52,6 +52,11 @@ case "$OS" in ...@@ -52,6 +52,11 @@ case "$OS" in
PS=":" PS=":"
FS="/" FS="/"
;; ;;
CYGWIN* )
NULL=/dev/null
PS=";"
FS="/"
;;
Windows* ) Windows* )
NULL=NUL NULL=NUL
PS=";" PS=";"
......
...@@ -17,7 +17,8 @@ reading these instructions.<br><br> ...@@ -17,7 +17,8 @@ reading these instructions.<br><br>
First, policytool will be invoked.<br><br> First, policytool will be invoked.<br><br>
<ol start="0"> <ol start="0">
<li>If testing on Windows, create a temporary directory. (Example: C:\foo\tmp) <li>Find (or create) a temporary directory that you have write access to.
(Example: 'C:\foo\tmp' on Windows or '/tmp' on other systems)
<li>Add new policy entry <li>Add new policy entry
<li>Add permission: <li>Add permission:
<pre> <pre>
...@@ -63,9 +64,9 @@ First, policytool will be invoked.<br><br> ...@@ -63,9 +64,9 @@ First, policytool will be invoked.<br><br>
<li>Confirm there are 2 entries in the permission list <li>Confirm there are 2 entries in the permission list
<li>Press cancel <li>Press cancel
<li>Save as "/tmp/p"<br> <li>Save as "/tmp/p"<br>
If testing on Windows, save in the temporary directory created in Step 0. (Or use the temporary directory mentioned in Step 0 if it's not '/tmp'.
(Example: Save as "C:\foo\tmp\p.policy") For example, "C:\foo\tmp\p" on Windows)
<li>Confirm that the file /tmp/p (or C:\foo\tmp\p.policy) looks like <li>Confirm that the file created in the previous step looks like
<pre> <pre>
/* AUTOMATICALLY GENERATED ON Tue Jul 19 16:27:30 CST 2005*/ /* AUTOMATICALLY GENERATED ON Tue Jul 19 16:27:30 CST 2005*/
/* DO NOT EDIT */ /* DO NOT EDIT */
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# #
# @test # @test
# @bug 6296772 6293981 6290216 # @bug 6296772 6293981 6290216 8015276
# @summary FilePermission and DelegationPermission, and cancel button # @summary FilePermission and DelegationPermission, and cancel button
# #
# @run applet/manual=done ChangeUI.html # @run applet/manual=done ChangeUI.html
...@@ -51,6 +51,11 @@ case "$OS" in ...@@ -51,6 +51,11 @@ case "$OS" in
PS=":" PS=":"
FS="/" FS="/"
;; ;;
CYGWIN* )
NULL=/dev/null
PS=";"
FS="/"
;;
Windows* ) Windows* )
NULL=NUL NULL=NUL
PS=";" PS=";"
......
...@@ -51,6 +51,11 @@ case "$OS" in ...@@ -51,6 +51,11 @@ case "$OS" in
PS=":" PS=":"
FS="/" FS="/"
;; ;;
CYGWIN* )
NULL=/dev/null
PS=";"
FS="/"
;;
Windows* ) Windows* )
NULL=NUL NULL=NUL
PS=";" PS=";"
......
...@@ -52,6 +52,11 @@ case "$OS" in ...@@ -52,6 +52,11 @@ case "$OS" in
PS=":" PS=":"
FS="/" FS="/"
;; ;;
CYGWIN* )
NULL=/dev/null
PS=";"
FS="/"
;;
Windows* ) Windows* )
NULL=NUL NULL=NUL
PS=";" PS=";"
......
...@@ -10,8 +10,8 @@ reading these instructions.<br><br> ...@@ -10,8 +10,8 @@ reading these instructions.<br><br>
First, policytool will be invoked.<br><br> First, policytool will be invoked.<br><br>
Then, follow these steps:<br> Then, follow these steps:<br>
0) If testing on Windows, create a temporary directory. 0) Find (or create) a temporary directory that you have write access to.
(Example: C:\foo\tmp)<br><br> (Example: 'C:\foo\tmp' on Windows or '/tmp' on other systems)<br><br>
1) Click on the "Add Policy Entry" button in the 1) Click on the "Add Policy Entry" button in the
main policytool window.<br><br> main policytool window.<br><br>
...@@ -32,13 +32,10 @@ select "Save As".<br><br> ...@@ -32,13 +32,10 @@ select "Save As".<br><br>
8) In the SaveAs window, enter "/tmp/ptool.test" as the file name 8) In the SaveAs window, enter "/tmp/ptool.test" as the file name
and click "OK".<br> and click "OK".<br>
If testing on Windows, use the temporary directory created in Step 0. (Or use the temporary directory mentioned in Step 0 if it's not '/tmp'.
(Example: Save as "C:\foo\tmp\ptool.test")<br><br> For example, "C:\foo\tmp\ptool.test" on Windows)<br><br>
9) cat /tmp/ptool.test<br>
If testing on Windows, check the contents of the file created in the previous
step.<br><br>
9) Check the content of the file created in the previous step<br><br>
10) check to make sure that the new entry is in the policy file.<br><br> 10) check to make sure that the new entry is in the policy file.<br><br>
...@@ -53,8 +50,8 @@ step.<br><br> ...@@ -53,8 +50,8 @@ step.<br><br>
In the confirmation dialog pop-up, click "OK".<br><br> In the confirmation dialog pop-up, click "OK".<br><br>
Exit policytool. If testing on Windows, delete the temporary directory and its Exit policytool. Delete the files created during this test. If the
contents created during this test.<br><br> temporary directory is also newly created, empty and delete it.<br><br>
Press "Pass" if ... press "Fail" otherwise.<br><br> Press "Pass" if ... press "Fail" otherwise.<br><br>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
# @test # @test
# @bug 4218206 # @bug 4218206
# @bug 8015276
# @summary missing or invalid permission target names in policy tool # @summary missing or invalid permission target names in policy tool
# #
# @run applet/manual=done UpdatePermissions.html # @run applet/manual=done UpdatePermissions.html
...@@ -51,6 +52,11 @@ case "$OS" in ...@@ -51,6 +52,11 @@ case "$OS" in
PS=":" PS=":"
FS="/" FS="/"
;; ;;
CYGWIN* )
NULL=/dev/null
PS=";"
FS="/"
;;
Windows* ) Windows* )
NULL=NUL NULL=NUL
PS=";" PS=";"
......
...@@ -51,6 +51,11 @@ case "$OS" in ...@@ -51,6 +51,11 @@ case "$OS" in
PS=":" PS=":"
FS="/" FS="/"
;; ;;
CYGWIN* )
NULL=/dev/null
PS=";"
FS="/"
;;
Windows* ) Windows* )
NULL=NUL NULL=NUL
PS=";" PS=";"
......
...@@ -15,10 +15,15 @@ If at any time an exception is thrown, or if any message ...@@ -15,10 +15,15 @@ If at any time an exception is thrown, or if any message
is incomprehensible, then the test failed. Otherwise, is incomprehensible, then the test failed. Otherwise,
the test passed. the test passed.
<p> <p>
<b>Preparation</b>: Find (or create) a temporary directory that you have write
access to (Example: 'C:\tmp' on Windows or '/tmp' on other systems) and copy
the files "ks", "good", "bad" from the scratch sub-directory of this test's
working directory (the -w argument of jtreg) into the temporary directory.
If 'policy1' or 'policy2' already exists in this directory, remove it.
<p>
Press "Pass" if ... press "Fail" otherwise. Press "Pass" if ... press "Fail" otherwise.
<p> <p>
<ol start="0"> <ol>
<li> If testing on Windows, create a temporary directory. (Example: C:\foo\tmp)
<li> Pull down the 'File' and 'KeyStore' menus and check values <li> Pull down the 'File' and 'KeyStore' menus and check values
<li> Pull down 'File' menu and select 'View Warning Log'. Confirm FileNotFound. <li> Pull down 'File' menu and select 'View Warning Log'. Confirm FileNotFound.
<li> Pull down 'File' menu and select 'New'. <li> Pull down 'File' menu and select 'New'.
...@@ -46,65 +51,65 @@ Press "Pass" if ... press "Fail" otherwise. ...@@ -46,65 +51,65 @@ Press "Pass" if ... press "Fail" otherwise.
<li> Select "play" from Target menu. <li> Select "play" from Target menu.
<li> Click OK, confirm changed permission. <li> Click OK, confirm changed permission.
<li> Type "hello" for 'CodeBase', click on 'Done', and check error message <li> Type "hello" for 'CodeBase', click on 'Done', and check error message
<li> Clean up the 'CodeBase' textbox
<li> Type "hello" for 'SignedBy', click on 'Done', and check warning message <li> Type "hello" for 'SignedBy', click on 'Done', and check warning message
<li> Click, on 'Edit Policy Entry' and 'Remove Policy Entry' <li> Click on 'Edit Policy Entry' and 'Remove Policy Entry'
and check error messages and check error messages
<li> Select policy entry, click on 'Edit Policy Entry', and check pop-up window <li> Select policy entry, click on 'Edit Policy Entry', check pop-up window and close it
<li> Select policy entry, click on 'Remove Policy Entry', <li> Select policy entry, click on 'Remove Policy Entry',
and check pop-up window and check pop-up window
<li> Do not remove the entry, click 'Cancel'. <li> Do not remove the entry, click 'Cancel'.
<li> Pull down 'File' menu and select 'Exit'. Confirm Save option. <li> Pull down 'File' menu and select 'Exit'. Confirm Save option.
Click 'Cancel'. Click 'Cancel'.
<li> Select 'File' menu value 'Save' and enter "/tmp/policy1" as the filename.<br> <li> Select 'File' menu value 'Save' and save into file "policy1" in the
If testing on Windows, use the temporary directory created in Step 0. temporary directory. Check status message.<br>
(Example: Save as "C:\foo\tmp\policy1")<br>
Check status message.
<li> Select 'File' menu value 'New' <li> Select 'File' menu value 'New'
<li> Click 'Add Policy Entry', type in "hello" for 'SignedBy' field, <li> Click 'Add Policy Entry', type in "hello" for 'SignedBy' field,
click 'Done'. Confirm warning. click 'Done'. Confirm warning.
<li> Select 'File' menu value 'Open' and confirm save option <li> Select 'File' menu value 'Open' and confirm save option
(do not save changes) (Click 'Cancel', do not save changes)
<li> Type "/tmp/policy1" (if Windows, "C:\foo\tmp\policy1") for the filename
and confirm warning message<br>
<li> Pull down 'File' menu, select 'View Warning Log' <li> Pull down 'File' menu, select 'View Warning Log'
and confirm KeyStore alias warning and confirm KeyStore alias warning
<li> Pull down 'KeyStore' menu and select 'Edit' <li> Pull down 'KeyStore' menu and select 'Edit'
<li> Enter 'foo' as KeyStore URL and check error <li> Enter 'foo' as KeyStore URL, click 'OK', and check error
<li> Using keytool create JKS keystore <li> Enter KeyStore URL "file:/tmp/ks" (Or use the temporary directory mentioned
<li> Enter KeyStore URL but leave other fields empty. Should succeed. in the preparation if it's not '/tmp'. For example, "file:/C:/tmp/ks" on Windows)
but leave other fields empty. Click 'OK'. Should succeed.
<li> Pull down 'KeyStore' menu and select 'Edit' <li> Pull down 'KeyStore' menu and select 'Edit'
<li> Confirm URL and Type values. <li> Confirm URL and Type values. The Type should be "jks"
<li> Enter 'foo' as the provider and check error message. <li> Enter 'foo' as the provider, click 'OK' and check error message.
<li> Enter 'SUN' as the provider. Should succeed. <li> Enter 'SUN' as the provider, click 'OK'. Should succeed.
<li> Pull down 'KeyStore' menu and select 'Edit' <li> Pull down 'KeyStore' menu and select 'Edit'
<li> Confirm URL, Type, and Provider values. <li> Confirm URL, Type, and Provider values.
<li> Enter 'foo' as the password URL and check error message. <li> Enter 'foo' as the password URL, click 'OK' and check error message.
<li> Enter URL with bad password and check error message. <li> Enter URL "file:/tmp/bad" (Or use the temporary directory mentioned in
<li> Enter URL with good password. Should succeed. the preparation if it's not '/tmp'. For example, "file:/C:/tmp/bad" on Windows),
click 'OK' and check error message.
<li> Enter URL "file:/tmp/good" (Or use the temporary directory mentioned in
the preparation if it's not '/tmp'. For example, "file:/C:/tmp/good" on Windows)
and click 'OK'. Should succeed.
<li> Pull down 'KeyStore' menu and select 'Edit' <li> Pull down 'KeyStore' menu and select 'Edit'
<li> Confirm URL, Type, Provider, and Password URL values. <li> Confirm URL, Type, Provider, and Password URL values.
<li> Click OK <li> Click OK
<li> Pull down 'File' menu and select 'Save As'. Enter "/tmp/policy2" <li> Pull down 'File' menu and select 'Save As' and save into file "policy2"
(if Windows, "C:\foo\tmp\policy2"). in the temporary directory. Confirm status message.<br>
Confirm status message.<br>
<li> Pull down 'File' menu and select 'New'. <li> Pull down 'File' menu and select 'New'.
<li> Pull down 'File' menu and select 'Open'. Enter "/tmp/policy2" <li> Pull down 'File' menu and select 'Open' and open "policy2" in the
(if Windows, "C:\foo\tmp\policy2"). temporary directory.<br>
Confirm warning message.<br>
<li> Click on 'Add Policy Entry', enter Codebase 'http://foo', <li> Click on 'Add Policy Entry', enter Codebase 'http://foo',
SignedBy 'bar'. Click on 'Done' and confirm alias warning. SignedBy 'bar'. Click on 'Done' and confirm alias warning.
<li> Double-Click on just created policy entry, confirm edit window appears. <li> Double-Click on just created policy entry, confirm edit window appears.
<li> Change SignedBy to an alias in previously created keystore. <li> Change SignedBy to an 'hello'.
<li> Click on Done and confirm it worked with no warning. <li> Click on Done and confirm it worked with no warning.
<li> Double-Click on "SignedBy hello" policy entry and <li> Double-Click on "SignedBy hello" policy entry and
confirm edit window appears. confirm edit window appears.
<li> Click on Edit/Remove Principal, confirm errors. <li> Click on Edit/Remove Principal, confirm errors.
<li> Click on 'Add Principal' and check new window. <li> Click on 'Add Principal' and check new window.
<li> Click on 'OK' and confirm error message (no principal name) <li> Click on 'OK' and confirm error message (no principal name)
<li> Enter valid KeyStore alias as principal name, click OK and <li> Enter 'hello' as principal name, click OK and
confirm status message. confirm status message.
<li> Confirm new principal in Principals list. <li> Confirm new principal in Principals list.
<li> Click on 'Done' (creating policy entry), confirm alias warning. <li> Click on 'Done' (creating policy entry).
<li> View warning log and confirm X500Principal/KeyStore alias message. <li> View warning log and confirm X500Principal/KeyStore alias message.
<li> Confirm principal added to policy entry in main window listing. <li> Confirm principal added to policy entry in main window listing.
<li> Double click on that entry. <li> Double click on that entry.
...@@ -116,14 +121,14 @@ Press "Pass" if ... press "Fail" otherwise. ...@@ -116,14 +121,14 @@ Press "Pass" if ... press "Fail" otherwise.
Confirm name cleared. Type 'foo' as name. Click OK. Confirm error. Confirm name cleared. Type 'foo' as name. Click OK. Confirm error.
type 'cn=foo' as name. Click OK. should succeed. type 'cn=foo' as name. Click OK. should succeed.
<li> Confirm changed principal in list. <li> Confirm changed principal in list.
<li> Click on 'Add Permission', and add any FilePermission. <li> Click on 'Add Permission', and add a FilePermission, choose a target and
<li> Click on 'Done' in Policy Entry window. Confirm alias warning. an action. Click OK.
<li> Click on 'Done' in Policy Entry window.
<li> Confirm entries in main window listing. <li> Confirm entries in main window listing.
<li> Select 'File' menu value 'Exit' <li> Select 'File' menu value 'Exit'
<li> Save Changes, confirm status message. <li> Save Changes, confirm status message.
<li> If testing on Windows, delete the temporary directory and its contents <li> Delete all files created during this test. If the temporary directory
created during this test. is also newly created, empty and delete it.</ol>
</ol>
<p> <p>
</body> </body>
......
...@@ -23,10 +23,13 @@ ...@@ -23,10 +23,13 @@
# @test # @test
# @bug 4348370 # @bug 4348370
# @bug 8015274
# @bug 8015276
# @bug 8016158
# @summary policytool not i18n compliant # @summary policytool not i18n compliant
# #
# @run applet/manual=done i18n.html # @run applet/manual=done i18n.html
# @run shell i18n.sh # @run shell/timeout=1200 i18n.sh
# @run applet/manual=yesno i18n.html # @run applet/manual=yesno i18n.html
# set a few environment variables so that the shell-script can run stand-alone # set a few environment variables so that the shell-script can run stand-alone
...@@ -51,6 +54,11 @@ case "$OS" in ...@@ -51,6 +54,11 @@ case "$OS" in
PS=":" PS=":"
FS="/" FS="/"
;; ;;
CYGWIN* )
NULL=/dev/null
PS=";"
FS="/"
;;
Windows* ) Windows* )
NULL=NUL NULL=NUL
PS=";" PS=";"
...@@ -66,6 +74,19 @@ esac ...@@ -66,6 +74,19 @@ esac
echo "HELLO!" echo "HELLO!"
echo "Checking for $HOME/.java.policy"
# 8015274
if [ -e $HOME/.java.policy ]; then
echo "You have a .java.policy file in your HOME directory"
echo "The file must be removed before running this test"
exit 1
fi
${TESTJAVA}${FS}bin${FS}keytool -genkeypair -alias hello -dname CN=Hello \
-storepass changeit -keypass changeit -keystore ks
echo changeit > good
echo badpass > bad
${TESTJAVA}${FS}bin${FS}policytool ${TESTJAVA}${FS}bin${FS}policytool
exit $? exit $?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册