test/sun/security/tools/policytool/i18n.sh

Print this page
rev 7285 : 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

@@ -24,11 +24,11 @@
 # @test
 # @bug 4348370
 # @summary policytool not i18n compliant
 #
 # @run applet/manual=done i18n.html
-# @run shell i18n.sh
+# @run shell/timeout=1200 i18n.sh
 # @run applet/manual=yesno i18n.html
 
 # set a few environment variables so that the shell-script can run stand-alone
 # in the source directory
 if [ "${TESTSRC}" = "" ] ; then

@@ -49,10 +49,15 @@
   SunOS | Linux | Darwin )
     NULL=/dev/null
     PS=":"
     FS="/"
     ;;
+  CYGWIN* )
+    NULL=/dev/null
+    PS=";"
+    FS="/"
+    ;;
   Windows* )
     NULL=NUL
     PS=";"
     FS="\\"
     ;;

@@ -64,9 +69,21 @@
 
 # the test code
 
 echo "HELLO!"
 
+echo "Checking for $HOME/.java.policy"
+
+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
 
 exit $?