# HG changeset patch
# User weijun
# Date 1371088800 -28800
# Node ID deb6268716efbc13bb3b8e123654dfb61885c2c8
# Parent f47169155ea03c324191bf487f2af834ad08d514
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
diff -r f47169155ea0 -r deb6268716ef jdk/test/sun/security/tools/policytool/Alias.sh
--- a/jdk/test/sun/security/tools/policytool/Alias.sh Thu Jun 13 09:59:29 2013 +0800
+++ b/jdk/test/sun/security/tools/policytool/Alias.sh Thu Jun 13 10:00:00 2013 +0800
@@ -52,6 +52,11 @@
PS=":"
FS="/"
;;
+ CYGWIN* )
+ NULL=/dev/null
+ PS=";"
+ FS="/"
+ ;;
Windows* )
NULL=NUL
PS=";"
diff -r f47169155ea0 -r deb6268716ef jdk/test/sun/security/tools/policytool/ChangeUI.html
--- a/jdk/test/sun/security/tools/policytool/ChangeUI.html Thu Jun 13 09:59:29 2013 +0800
+++ b/jdk/test/sun/security/tools/policytool/ChangeUI.html Thu Jun 13 10:00:00 2013 +0800
@@ -17,7 +17,8 @@
First, policytool will be invoked.
@@ -63,9 +64,9 @@
/* AUTOMATICALLY GENERATED ON Tue Jul 19 16:27:30 CST 2005*/ /* DO NOT EDIT */ diff -r f47169155ea0 -r deb6268716ef jdk/test/sun/security/tools/policytool/ChangeUI.sh --- a/jdk/test/sun/security/tools/policytool/ChangeUI.sh Thu Jun 13 09:59:29 2013 +0800 +++ b/jdk/test/sun/security/tools/policytool/ChangeUI.sh Thu Jun 13 10:00:00 2013 +0800 @@ -22,7 +22,7 @@ # # @test -# @bug 6296772 6293981 6290216 +# @bug 6296772 6293981 6290216 8015276 # @summary FilePermission and DelegationPermission, and cancel button # # @run applet/manual=done ChangeUI.html @@ -51,6 +51,11 @@ PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff -r f47169155ea0 -r deb6268716ef jdk/test/sun/security/tools/policytool/OpenPolicy.sh --- a/jdk/test/sun/security/tools/policytool/OpenPolicy.sh Thu Jun 13 09:59:29 2013 +0800 +++ b/jdk/test/sun/security/tools/policytool/OpenPolicy.sh Thu Jun 13 10:00:00 2013 +0800 @@ -51,6 +51,11 @@ PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff -r f47169155ea0 -r deb6268716ef jdk/test/sun/security/tools/policytool/SaveAs.sh --- a/jdk/test/sun/security/tools/policytool/SaveAs.sh Thu Jun 13 09:59:29 2013 +0800 +++ b/jdk/test/sun/security/tools/policytool/SaveAs.sh Thu Jun 13 10:00:00 2013 +0800 @@ -52,6 +52,11 @@ PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff -r f47169155ea0 -r deb6268716ef jdk/test/sun/security/tools/policytool/UpdatePermissions.html --- a/jdk/test/sun/security/tools/policytool/UpdatePermissions.html Thu Jun 13 09:59:29 2013 +0800 +++ b/jdk/test/sun/security/tools/policytool/UpdatePermissions.html Thu Jun 13 10:00:00 2013 +0800 @@ -10,8 +10,8 @@ First, policytool will be invoked.
Then, follow these steps:
-0) If testing on Windows, create a temporary directory. -(Example: C:\foo\tmp)
+0) Find (or create) a temporary directory that you have write access to. +(Example: 'C:\foo\tmp' on Windows or '/tmp' on other systems)
1) Click on the "Add Policy Entry" button in the main policytool window.
@@ -32,13 +32,10 @@ 8) In the SaveAs window, enter "/tmp/ptool.test" as the file name and click "OK".
-If testing on Windows, use the temporary directory created in Step 0. -(Example: Save as "C:\foo\tmp\ptool.test")
+(Or use the temporary directory mentioned in Step 0 if it's not '/tmp'. +For example, "C:\foo\tmp\ptool.test" on Windows)
-9) cat /tmp/ptool.test
-If testing on Windows, check the contents of the file created in the previous -step.
- +9) Check the content of the file created in the previous step
10) check to make sure that the new entry is in the policy file.
@@ -53,8 +50,8 @@ In the confirmation dialog pop-up, click "OK".
-Exit policytool. If testing on Windows, delete the temporary directory and its -contents created during this test.
+Exit policytool. Delete the files created during this test. If the +temporary directory is also newly created, empty and delete it.
Press "Pass" if ... press "Fail" otherwise.
diff -r f47169155ea0 -r deb6268716ef jdk/test/sun/security/tools/policytool/UpdatePermissions.sh --- a/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh Thu Jun 13 09:59:29 2013 +0800 +++ b/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh Thu Jun 13 10:00:00 2013 +0800 @@ -23,6 +23,7 @@ # @test # @bug 4218206 +# @bug 8015276 # @summary missing or invalid permission target names in policy tool # # @run applet/manual=done UpdatePermissions.html @@ -51,6 +52,11 @@ PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff -r f47169155ea0 -r deb6268716ef jdk/test/sun/security/tools/policytool/UsePolicy.sh --- a/jdk/test/sun/security/tools/policytool/UsePolicy.sh Thu Jun 13 09:59:29 2013 +0800 +++ b/jdk/test/sun/security/tools/policytool/UsePolicy.sh Thu Jun 13 10:00:00 2013 +0800 @@ -51,6 +51,11 @@ PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff -r f47169155ea0 -r deb6268716ef jdk/test/sun/security/tools/policytool/i18n.html --- a/jdk/test/sun/security/tools/policytool/i18n.html Thu Jun 13 09:59:29 2013 +0800 +++ b/jdk/test/sun/security/tools/policytool/i18n.html Thu Jun 13 10:00:00 2013 +0800 @@ -15,10 +15,15 @@ is incomprehensible, then the test failed. Otherwise, the test passed.+Preparation: 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. +
Press "Pass" if ... press "Fail" otherwise.
-
-
- If testing on Windows, create a temporary directory. (Example: C:\foo\tmp) +
+
- Pull down the 'File' and 'KeyStore' menus and check values
- Pull down 'File' menu and select 'View Warning Log'. Confirm FileNotFound.
- Pull down 'File' menu and select 'New'. @@ -46,65 +51,65 @@
- Select "play" from Target menu.
- Click OK, confirm changed permission.
- Type "hello" for 'CodeBase', click on 'Done', and check error message +
- Clean up the 'CodeBase' textbox
- Type "hello" for 'SignedBy', click on 'Done', and check warning message -
- Click, on 'Edit Policy Entry' and 'Remove Policy Entry' +
- Click on 'Edit Policy Entry' and 'Remove Policy Entry' and check error messages -
- Select policy entry, click on 'Edit Policy Entry', and check pop-up window +
- Select policy entry, click on 'Edit Policy Entry', check pop-up window and close it
- Select policy entry, click on 'Remove Policy Entry', and check pop-up window
- Do not remove the entry, click 'Cancel'.
- Pull down 'File' menu and select 'Exit'. Confirm Save option. Click 'Cancel'. -
- Select 'File' menu value 'Save' and enter "/tmp/policy1" as the filename.
- If testing on Windows, use the temporary directory created in Step 0. - (Example: Save as "C:\foo\tmp\policy1")
- Check status message. +- Select 'File' menu value 'Save' and save into file "policy1" in the + temporary directory. Check status message.
- Select 'File' menu value 'New'
- Click 'Add Policy Entry', type in "hello" for 'SignedBy' field, click 'Done'. Confirm warning.
- Select 'File' menu value 'Open' and confirm save option - (do not save changes) -
- Type "/tmp/policy1" (if Windows, "C:\foo\tmp\policy1") for the filename - and confirm warning message
+ (Click 'Cancel', do not save changes)- Pull down 'File' menu, select 'View Warning Log' and confirm KeyStore alias warning
- Pull down 'KeyStore' menu and select 'Edit' -
- Enter 'foo' as KeyStore URL and check error -
- Using keytool create JKS keystore -
- Enter KeyStore URL but leave other fields empty. Should succeed. +
- Enter 'foo' as KeyStore URL, click 'OK', and check error +
- Enter KeyStore URL "file:/tmp/ks" (Or use the temporary directory mentioned + 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.
- Pull down 'KeyStore' menu and select 'Edit' -
- Confirm URL and Type values. -
- Enter 'foo' as the provider and check error message. -
- Enter 'SUN' as the provider. Should succeed. +
- Confirm URL and Type values. The Type should be "jks" +
- Enter 'foo' as the provider, click 'OK' and check error message. +
- Enter 'SUN' as the provider, click 'OK'. Should succeed.
- Pull down 'KeyStore' menu and select 'Edit'
- Confirm URL, Type, and Provider values. -
- Enter 'foo' as the password URL and check error message. -
- Enter URL with bad password and check error message. -
- Enter URL with good password. Should succeed. +
- Enter 'foo' as the password URL, click 'OK' and check error message. +
- Enter URL "file:/tmp/bad" (Or use the temporary directory mentioned in + the preparation if it's not '/tmp'. For example, "file:/C:/tmp/bad" on Windows), + click 'OK' and check error message. +
- 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.
- Pull down 'KeyStore' menu and select 'Edit'
- Confirm URL, Type, Provider, and Password URL values.
- Click OK -
- Pull down 'File' menu and select 'Save As'. Enter "/tmp/policy2" - (if Windows, "C:\foo\tmp\policy2"). - Confirm status message.
+- Pull down 'File' menu and select 'Save As' and save into file "policy2" + in the temporary directory. Confirm status message.
- Pull down 'File' menu and select 'New'. -
- Pull down 'File' menu and select 'Open'. Enter "/tmp/policy2" - (if Windows, "C:\foo\tmp\policy2"). - Confirm warning message.
+- Pull down 'File' menu and select 'Open' and open "policy2" in the + temporary directory.
- Click on 'Add Policy Entry', enter Codebase 'http://foo', SignedBy 'bar'. Click on 'Done' and confirm alias warning.
- Double-Click on just created policy entry, confirm edit window appears. -
- Change SignedBy to an alias in previously created keystore. +
- Change SignedBy to an 'hello'.
- Click on Done and confirm it worked with no warning.
- Double-Click on "SignedBy hello" policy entry and confirm edit window appears.
- Click on Edit/Remove Principal, confirm errors.
- Click on 'Add Principal' and check new window.
- Click on 'OK' and confirm error message (no principal name) -
- Enter valid KeyStore alias as principal name, click OK and +
- Enter 'hello' as principal name, click OK and confirm status message.
- Confirm new principal in Principals list. -
- Click on 'Done' (creating policy entry), confirm alias warning. +
- Click on 'Done' (creating policy entry).
- View warning log and confirm X500Principal/KeyStore alias message.
- Confirm principal added to policy entry in main window listing.
- Double click on that entry. @@ -116,14 +121,14 @@ Confirm name cleared. Type 'foo' as name. Click OK. Confirm error. type 'cn=foo' as name. Click OK. should succeed.
- Confirm changed principal in list. -
- Click on 'Add Permission', and add any FilePermission. -
- Click on 'Done' in Policy Entry window. Confirm alias warning. +
- Click on 'Add Permission', and add a FilePermission, choose a target and + an action. Click OK. +
- Click on 'Done' in Policy Entry window.
- Confirm entries in main window listing.
- Select 'File' menu value 'Exit'
- Save Changes, confirm status message. -
- If testing on Windows, delete the temporary directory and its contents - created during this test. -
- Delete all files created during this test. If the temporary directory + is also newly created, empty and delete it.