8040321: keytool and jarsigner tests doesn't pass though VM tools to tools
authorweijun
Fri, 25 Apr 2014 10:57:09 +0800
changeset 24116 9f9b4ba34aad
parent 24077 0809c9a4d36e
child 24117 19c6d44b6550
8040321: keytool and jarsigner tests doesn't pass though VM tools to tools Reviewed-by: alanb
jdk/test/sun/security/mscapi/KeytoolChangeAlias.sh
jdk/test/sun/security/mscapi/PublicKeyInterop.sh
jdk/test/sun/security/mscapi/ShortRSAKey1024.sh
jdk/test/sun/security/mscapi/SignUsingNONEwithRSA.sh
jdk/test/sun/security/tools/jarsigner/AlgOptions.sh
jdk/test/sun/security/tools/jarsigner/PercentSign.sh
jdk/test/sun/security/tools/jarsigner/TimestampCheck.java
jdk/test/sun/security/tools/jarsigner/checkusage.sh
jdk/test/sun/security/tools/jarsigner/collator.sh
jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh
jdk/test/sun/security/tools/jarsigner/crl.sh
jdk/test/sun/security/tools/jarsigner/diffend.sh
jdk/test/sun/security/tools/jarsigner/ec.sh
jdk/test/sun/security/tools/jarsigner/emptymanifest.sh
jdk/test/sun/security/tools/jarsigner/jvindex.sh
jdk/test/sun/security/tools/jarsigner/nameclash.sh
jdk/test/sun/security/tools/jarsigner/newsize7.sh
jdk/test/sun/security/tools/jarsigner/oldsig.sh
jdk/test/sun/security/tools/jarsigner/onlymanifest.sh
jdk/test/sun/security/tools/jarsigner/passtype.sh
jdk/test/sun/security/tools/jarsigner/samename.sh
jdk/test/sun/security/tools/jarsigner/ts.sh
jdk/test/sun/security/tools/jarsigner/warnings.sh
jdk/test/sun/security/tools/keytool/AltProviderPath.sh
jdk/test/sun/security/tools/keytool/CloneKeyAskPassword.sh
jdk/test/sun/security/tools/keytool/ListKeychainStore.sh
jdk/test/sun/security/tools/keytool/NoExtNPE.sh
jdk/test/sun/security/tools/keytool/SecretKeyKS.sh
jdk/test/sun/security/tools/keytool/StandardAlgName.sh
jdk/test/sun/security/tools/keytool/StorePasswordsByShell.sh
jdk/test/sun/security/tools/keytool/emptysubject.sh
jdk/test/sun/security/tools/keytool/file-in-help.sh
jdk/test/sun/security/tools/keytool/importreadall.sh
jdk/test/sun/security/tools/keytool/newhelp.sh
jdk/test/sun/security/tools/keytool/p12importks.sh
jdk/test/sun/security/tools/keytool/printssl.sh
jdk/test/sun/security/tools/keytool/resource.sh
jdk/test/sun/security/tools/keytool/selfissued.sh
jdk/test/sun/security/tools/keytool/trystore.sh
jdk/test/sun/security/tools/policytool/i18n.sh
jdk/test/sun/security/validator/certreplace.sh
jdk/test/sun/security/validator/samedn.sh
--- a/jdk/test/sun/security/mscapi/KeytoolChangeAlias.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/mscapi/KeytoolChangeAlias.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -56,7 +56,7 @@
     #  execute test program - rely on it to exit if platform unsupported
 
         echo "Creating the alias '246810' in the Windows-My store..."
-        ${TESTJAVA}/bin/keytool \
+        ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 	    -import \
 	    -storetype Windows-My \
 	    -file ${TESTSRC}/246810.cer \
@@ -68,13 +68,13 @@
 	fi
 
 	echo "Removing the alias '13579', if it is already present..."
-        ${TESTJAVA}/bin/keytool \
+        ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 	    -list \
             -storetype Windows-My \
 	    -alias 13579 > /dev/null 2>&1
 
 	if [ $? ] ; then
-            ${TESTJAVA}/bin/keytool \
+            ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 		-delete \
 		-storetype Windows-My \
 		-alias 13579 \
@@ -82,12 +82,12 @@
 	fi
 
 	echo "Counting the entries in the store..."
-	count=`${TESTJAVA}/bin/keytool -list -storetype Windows-My | wc -l`
+	count=`${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} -list -storetype Windows-My | wc -l`
 	before=$count
 
 	echo "Changing the alias name from '246810' to '13579'..."
 
-        ${TESTJAVA}/bin/keytool \
+        ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 	    -changealias \
 	    -storetype Windows-My \
 	    -alias 246810 \
@@ -98,7 +98,7 @@
 	fi
 
 	echo "Re-counting the entries in the store..."
-	count=`${TESTJAVA}/bin/keytool -list -storetype Windows-My | wc -l`
+	count=`${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} -list -storetype Windows-My | wc -l`
 	after=$count
 
 	if [ ! $before = $after ]; then
@@ -107,7 +107,7 @@
 	fi
 
 	echo "Confirming that the new alias is present..."
-        ${TESTJAVA}/bin/keytool \
+        ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 	    -list \
             -storetype Windows-My \
 	    -alias 13579 > /dev/null 2>&1
@@ -118,7 +118,7 @@
 	fi
 
 	echo "Removing the new alias '13579'..."
-        ${TESTJAVA}/bin/keytool \
+        ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 	    -delete \
             -storetype Windows-My \
 	    -alias 13579 > /dev/null 2>&1
--- a/jdk/test/sun/security/mscapi/PublicKeyInterop.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/mscapi/PublicKeyInterop.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -51,7 +51,7 @@
     Windows* | CYGWIN* )
 
         echo "Creating a temporary RSA keypair in the Windows-My store..."
-        ${TESTJAVA}/bin/keytool \
+        ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 	    -genkeypair \
 	    -storetype Windows-My \
 	    -keyalg RSA \
@@ -61,14 +61,14 @@
 
         echo
 	echo "Running the test..."
-        ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\PublicKeyInterop.java
+        ${TESTJAVA}/bin/javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} -d . ${TESTSRC}\\PublicKeyInterop.java
         ${TESTJAVA}/bin/java ${TESTVMOPTS} PublicKeyInterop
 
         rc=$?
 
         echo
         echo "Removing the temporary RSA keypair from the Windows-My store..."
-        ${TESTJAVA}/bin/keytool \
+        ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 	    -delete \
 	    -storetype Windows-My \
 	    -alias 6888925
--- a/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -63,14 +63,14 @@
     Windows* | CYGWIN* )
 
         echo "Removing the keypair if it already exists (for unknown reason)..."
-        ${TESTJAVA}${FS}bin${FS}keytool \
+        ${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} \
             -delete \
             -storetype Windows-My \
             -debug \
             -alias 7106773.$BITS
 
         echo "Creating a temporary RSA keypair in the Windows-My store..."
-        ${TESTJAVA}${FS}bin${FS}keytool \
+        ${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} \
             -genkeypair \
             -storetype Windows-My \
             -keyalg RSA \
@@ -87,7 +87,7 @@
 
         echo
         echo "Running the test..."
-        ${TESTJAVA}${FS}bin${FS}javac -d . \
+        ${TESTJAVA}${FS}bin${FS}javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} -d . \
             ${TESTSRC}${FS}ShortRSAKeyWithinTLS.java
         ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ShortRSAKeyWithinTLS 7106773.$BITS $BITS \
             TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA
@@ -96,7 +96,7 @@
 
         echo
         echo "Removing the temporary RSA keypair from the Windows-My store..."
-        ${TESTJAVA}${FS}bin${FS}keytool \
+        ${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} \
             -delete \
             -storetype Windows-My \
             -debug \
--- a/jdk/test/sun/security/mscapi/SignUsingNONEwithRSA.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/mscapi/SignUsingNONEwithRSA.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -50,7 +50,7 @@
     Windows* | CYGWIN* )
 
         echo "Creating a temporary RSA keypair in the Windows-My store..."
-        ${TESTJAVA}/bin/keytool \
+        ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 	    -genkeypair \
 	    -storetype Windows-My \
 	    -keyalg RSA \
@@ -60,14 +60,14 @@
 
         echo
 	echo "Running the test..."
-        ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\SignUsingNONEwithRSA.java
+        ${TESTJAVA}/bin/javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} -d . ${TESTSRC}\\SignUsingNONEwithRSA.java
         ${TESTJAVA}/bin/java ${TESTVMOPTS} SignUsingNONEwithRSA
 
         rc=$?
 
         echo
         echo "Removing the temporary RSA keypair from the Windows-My store..."
-        ${TESTJAVA}/bin/keytool \
+        ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} \
 	    -delete \
 	    -storetype Windows-My \
 	    -alias 6578658
--- a/jdk/test/sun/security/tools/jarsigner/AlgOptions.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/AlgOptions.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -75,7 +75,7 @@
 
 failed=0
 # test missing signature algorithm arg
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -sigalg \
@@ -89,7 +89,7 @@
 fi
 
 # test missing digest algorithm arg
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -digestalg \
@@ -103,7 +103,7 @@
 fi
 
 # test BOGUS signature algorithm
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -sigalg BOGUS \
@@ -117,7 +117,7 @@
 fi
 
 # test BOGUS digest algorithm
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -digestalg BOGUS \
@@ -131,7 +131,7 @@
 fi
 
 # test incompatible signature algorithm
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -sigalg SHA1withDSA \
@@ -145,7 +145,7 @@
 fi
 
 # test compatible signature algorithm
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -sigalg SHA512withRSA \
@@ -159,7 +159,7 @@
 fi
 
 # verify it
-${TESTJAVA}${FS}bin${FS}jarsigner -verify ${TESTCLASSES}${FS}AlgOptionsTmp.jar
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -verify ${TESTCLASSES}${FS}AlgOptionsTmp.jar
 RESULT=$?
 if [ $RESULT -eq 0 ]; then
     echo "test 7 passed"
@@ -169,7 +169,7 @@
 fi
 
 # test non-default digest algorithm
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -digestalg SHA-256 \
@@ -183,7 +183,7 @@
 fi
 
 # verify it
-${TESTJAVA}${FS}bin${FS}jarsigner -verify ${TESTCLASSES}${FS}AlgOptionsTmp.jar
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -verify ${TESTCLASSES}${FS}AlgOptionsTmp.jar
 RESULT=$?
 if [ $RESULT -eq 0 ]; then
     echo "test 9 passed"
@@ -193,7 +193,7 @@
 fi
 
 # test SHA-512 digest algorithm (creates long lines)
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -digestalg SHA-512 \
@@ -208,7 +208,7 @@
 fi
 
 # verify it
-${TESTJAVA}${FS}bin${FS}jarsigner -verify ${TESTCLASSES}${FS}AlgOptionsTmp.jar
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -verify ${TESTCLASSES}${FS}AlgOptionsTmp.jar
 RESULT=$?
 if [ $RESULT -eq 0 ]; then
     echo "test 11 passed"
--- a/jdk/test/sun/security/tools/jarsigner/PercentSign.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/PercentSign.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -73,7 +73,7 @@
 # copy jar file into writeable location
 ${CP} ${TESTSRC}${FS}AlgOptions.jar ${TESTCLASSES}${FS}AlgOptionsTmp.jar
 
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}a%b${FS}percent.keystore \
     -storepass changeit \
     ${TESTCLASSES}${FS}AlgOptionsTmp.jar ok
--- a/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java	Fri Apr 25 10:57:09 2014 +0800
@@ -255,18 +255,16 @@
         // nonce generation in timestamping request. Not avaibale on
         // Windows and defaults to thread seed generator, not too bad.
         if (System.getProperty("java.home").endsWith("jre")) {
-            cmd = System.getProperty("java.home") + "/../bin/jarsigner" +
+            cmd = System.getProperty("java.home") + "/../bin/jarsigner";
+        } else {
+            cmd = System.getProperty("java.home") + "/bin/jarsigner";
+        }
+
+        cmd +=  " " + System.getProperty("test.tool.vm.opts") +
                 " -J-Djava.security.egd=file:/dev/./urandom" +
                 " -debug -keystore " + TSKS + " -storepass changeit" +
                 " -tsa http://localhost:" + port + "/%d" +
                 " -signedjar new_%d.jar " + JAR + " old";
-        } else {
-            cmd = System.getProperty("java.home") + "/bin/jarsigner" +
-                " -J-Djava.security.egd=file:/dev/./urandom" +
-                " -debug -keystore " + TSKS + " -storepass changeit" +
-                " -tsa http://localhost:" + port + "/%d" +
-                " -signedjar new_%d.jar " + JAR + " old";
-        }
 
         try {
             if (args.length == 0) {         // Run this test
--- a/jdk/test/sun/security/tools/jarsigner/checkusage.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/checkusage.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -45,9 +45,9 @@
     ;;
 esac
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keyalg rsa"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner"
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keyalg rsa"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
 
 rm js.jks trust.jks unrelated.jks 2> /dev/null
 
--- a/jdk/test/sun/security/tools/jarsigner/collator.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/collator.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -46,10 +46,10 @@
 KS=collator.jks
 JFILE=collator.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit \
         -keyalg rsa -keystore $KS"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner -keystore $KS -storepass changeit"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -keystore $KS -storepass changeit"
 
 rm $F $KS $JFILE 2> /dev/null
 
--- a/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -47,10 +47,10 @@
 # Choose 1024-bit RSA to make sure it runs fine and fast on all platforms. In
 # fact, every keyalg/keysize combination is OK for this test.
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore js.jks -keyalg rsa -keysize 1024"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
-JAVAC=$TESTJAVA${FS}bin${FS}javac
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore js.jks -keyalg rsa -keysize 1024"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
+JAVAC="$TESTJAVA${FS}bin${FS}javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS}"
 
 rm js.jks
 
--- a/jdk/test/sun/security/tools/jarsigner/crl.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/crl.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -45,7 +45,7 @@
 
 KS=crl.jks
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 
 rm $KS 2> /dev/null
 
--- a/jdk/test/sun/security/tools/jarsigner/diffend.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/diffend.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -85,7 +85,7 @@
 rm diffend.jar
 zip diffend.jar META-INF/MANIFEST.MF META-INF/x.RSA 1
 
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -digestalg SHA1 \
@@ -99,7 +99,7 @@
 rm diffend.jar
 zip diffend.jar META-INF/MANIFEST.MF 1
 
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -digestalg SHA1 \
--- a/jdk/test/sun/security/tools/jarsigner/ec.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/ec.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -45,9 +45,9 @@
 KS=ec.jks
 JFILE=ec.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
 
 rm $KS $JFILE
 echo A > A
--- a/jdk/test/sun/security/tools/jarsigner/emptymanifest.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/emptymanifest.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -47,11 +47,11 @@
 KS=emptymanifest.jks
 JFILE=em.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JAVA=$TESTJAVA${FS}bin${FS}java
-JAVAC=$TESTJAVA${FS}bin${FS}javac
-JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JAVA="$TESTJAVA${FS}bin${FS}java ${TESTVMOPTS}"
+JAVAC="$TESTJAVA${FS}bin${FS}javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
 
 rm $KS $JFILE
 echo A > A
@@ -65,7 +65,7 @@
 }
 EOF
 $JAVAC CrLf.java
-$JAVA ${TESTVMOPTS} CrLf > META-INF${FS}MANIFEST.MF
+$JAVA CrLf > META-INF${FS}MANIFEST.MF
 zip $JFILE META-INF${FS}MANIFEST.MF A B
 
 $KT -alias a -dname CN=a -keyalg rsa -genkey -validity 300
--- a/jdk/test/sun/security/tools/jarsigner/jvindex.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/jvindex.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -46,10 +46,10 @@
 KS=jvindex.jks
 JFILE=jvindex.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit \
         -keystore $KS -keyalg rsa"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner -keystore $KS -storepass changeit"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -keystore $KS -storepass changeit"
 
 rm $F $KS $JFILE 2> /dev/null
 
--- a/jdk/test/sun/security/tools/jarsigner/nameclash.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/nameclash.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -45,9 +45,9 @@
 KS=nc.jks
 JFILE=nc.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
 
 rm $KS $JFILE
 
--- a/jdk/test/sun/security/tools/jarsigner/newsize7.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/newsize7.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -51,9 +51,9 @@
 
 KSFILE=ns7.jks
 
-KT="${TESTJAVA}${FS}bin${FS}keytool -keystore ns7.jks -storepass changeit -keypass changeit -keyalg rsa"
-JAR="${TESTJAVA}${FS}bin${FS}jar"
-JS="${TESTJAVA}${FS}bin${FS}jarsigner -keystore ns7.jks -storepass changeit"
+KT="${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -keystore ns7.jks -storepass changeit -keypass changeit -keyalg rsa"
+JAR="${TESTJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JS="${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -keystore ns7.jks -storepass changeit"
 
 rm ns7.*
 
--- a/jdk/test/sun/security/tools/jarsigner/oldsig.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/oldsig.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -70,10 +70,10 @@
 ${CP} ${TESTSRC}${FS}oldsig${FS}A.jar B.jar
 ${CP} ${TESTSRC}${FS}oldsig${FS}A.class B.class
 
-${TESTJAVA}${FS}bin${FS}jar uvf B.jar B.class
-${TESTJAVA}${FS}bin${FS}jarsigner \
+${TESTJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS} uvf B.jar B.class
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} \
     -keystore ${TESTSRC}${FS}JarSigning.keystore \
     -storepass bbbbbb \
     -digestalg SHA1 \
     B.jar c
-${TESTJAVA}${FS}bin${FS}jarsigner -verify B.jar
+${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -verify B.jar
--- a/jdk/test/sun/security/tools/jarsigner/onlymanifest.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/onlymanifest.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -45,10 +45,10 @@
 KS=onlymanifest.jks
 JFILE=onlymanifest.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit \
         -keystore $KS -keyalg rsa"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
 
 rm $KS $JFILE 2> /dev/null
 
--- a/jdk/test/sun/security/tools/jarsigner/passtype.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/passtype.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -45,9 +45,9 @@
 KS=pt.jks
 JFILE=pt.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -keystore $KS -validity 300 -keyalg rsa"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -keystore $KS -validity 300 -keyalg rsa"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
 
 rm $KS $JFILE
 
--- a/jdk/test/sun/security/tools/jarsigner/samename.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/samename.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -47,9 +47,9 @@
 KS=samename.jks
 JFILE=em.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
 
 rm $KS $JFILE $SIGNEDJAR
 echo A > A
--- a/jdk/test/sun/security/tools/jarsigner/ts.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/ts.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -50,10 +50,10 @@
   TESTJAVA=`dirname $JAVAC_CMD`/..
 fi
 
-JAR="${TESTJAVA}${FS}bin${FS}jar"
-JAVA="${TESTJAVA}${FS}bin${FS}java"
-JAVAC="${TESTJAVA}${FS}bin${FS}javac"
-KT="${TESTJAVA}${FS}bin${FS}keytool -keystore tsks -storepass changeit -keypass changeit -keyalg rsa -validity 200"
+JAR="${TESTJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JAVA="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS}"
+JAVAC="${TESTJAVA}${FS}bin${FS}javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS}"
+KT="${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -keystore tsks -storepass changeit -keypass changeit -keyalg rsa -validity 200"
 
 rm tsks
 echo Nothing > A
@@ -87,5 +87,5 @@
         $KT -alias tsbad3 -importcert
 
 $JAVAC -d . ${TESTSRC}/TimestampCheck.java
-$JAVA ${TESTVMOPTS} TimestampCheck
+$JAVA ${TESTVMOPTS} "-Dtest.tool.vm.opts=${TESTTOOLVMOPTS}" TimestampCheck
 
--- a/jdk/test/sun/security/tools/jarsigner/warnings.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/jarsigner/warnings.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -46,10 +46,10 @@
 KS=warnings.jks
 JFILE=warnings.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit \
         -keystore $KS"
-JAR=$TESTJAVA${FS}bin${FS}jar
-JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner -keystore $KS -storepass changeit"
+JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -keystore $KS -storepass changeit"
 
 rm $KS 2> /dev/null
 
--- a/jdk/test/sun/security/tools/keytool/AltProviderPath.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/AltProviderPath.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -69,7 +69,7 @@
 
 # the test code
 #genkey
-${TESTJAVA}${FS}bin${FS}keytool -genkey -v -alias dummyTestCA \
+${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -genkey -v -alias dummyTestCA \
     -keyalg "RSA" -keysize 1024 -sigalg "ShA1WithRSA" \
     -dname "cn=Dummy Test CA, ou=JSN, o=JavaSoft, c=US" -validity 3650 \
     -keypass storepass -keystore keystoreCA.dks -storepass storepass \
@@ -81,7 +81,7 @@
 fi
 
 #Change keystore password
-${TESTJAVA}${FS}bin${FS}keytool -storepasswd -new storepass2 \
+${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepasswd -new storepass2 \
     -keystore keystoreCA.dks -storetype "dummyks" -storepass storepass \
     -provider "org.test.dummy.DummyProvider" -providerPath ${TESTCLASSES}
 
@@ -91,7 +91,7 @@
 
 
 #Change keystore key password
-${TESTJAVA}${FS}bin${FS}keytool -keypasswd -alias "dummyTestCA" \
+${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -keypasswd -alias "dummyTestCA" \
     -keypass storepass -new keypass -keystore keystoreCA.dks \
     -storetype "dummyks" -storepass storepass2 \
     -provider "org.test.dummy.DummyProvider" -providerPath ${TESTCLASSES}
@@ -101,7 +101,7 @@
 fi
 
 #Export certificate
-${TESTJAVA}${FS}bin${FS}keytool -v -export -rfc -alias "dummyTestCA" \
+${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -v -export -rfc -alias "dummyTestCA" \
     -file "dummyTestCA.der" -keystore keystoreCA.dks -storetype "dummyks" \
     -storepass storepass2 -provider "org.test.dummy.DummyProvider" \
     -providerPath ${TESTCLASSES}
@@ -111,7 +111,7 @@
 fi
 
 #list keystore
-${TESTJAVA}${FS}bin${FS}keytool -v -list -keystore keystoreCA.dks \
+${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -v -list -keystore keystoreCA.dks \
     -storetype "dummyks" -storepass storepass2 \
     -provider "org.test.dummy.DummyProvider" -providerPath ${TESTCLASSES}
 
--- a/jdk/test/sun/security/tools/keytool/CloneKeyAskPassword.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/CloneKeyAskPassword.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -82,7 +82,7 @@
 chmod 644 CloneKeyAskPassword.jks
 
 # run the test: attempt to clone the private key
-${TESTJAVA}${FILESEP}bin${FILESEP}keytool \
+${TESTJAVA}${FILESEP}bin${FILESEP}keytool ${TESTTOOLVMOPTS} \
         -keyclone \
         -alias mykey \
         -dest myclone \
--- a/jdk/test/sun/security/tools/keytool/ListKeychainStore.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/ListKeychainStore.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -46,7 +46,7 @@
 esac
 
 PWD="xxxxxx"
-KEYTOOL="${TESTJAVA}/bin/keytool -storetype KeychainStore -keystore NONE -storepass $PWD"
+KEYTOOL="${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} -storetype KeychainStore -keystore NONE -storepass $PWD"
 TEMPORARY_P12="$TESTCLASSES/7133495.p12"
 TEMPORARY_KC="$TESTCLASSES/7133495.keychain"
 CLEANUP_P12="rm -f $TEMPORARY_P12"
@@ -67,7 +67,7 @@
 
 for i in X Y Z
 do
-    ${TESTJAVA}/bin/keytool -genkeypair \
+    ${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} -genkeypair \
         -storetype PKCS12 \
         -keystore $TEMPORARY_P12 \
         -storepass $PWD \
--- a/jdk/test/sun/security/tools/keytool/NoExtNPE.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/NoExtNPE.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -67,7 +67,7 @@
     ;;
 esac
 
-${TESTJAVA}${FILESEP}bin${FILESEP}keytool \
+${TESTJAVA}${FILESEP}bin${FILESEP}keytool ${TESTTOOLVMOPTS} \
         -list -v \
         -keystore ${TESTSRC}${FILESEP}CloneKeyAskPassword.jks \
         -storepass test123
--- a/jdk/test/sun/security/tools/keytool/SecretKeyKS.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/SecretKeyKS.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -68,6 +68,6 @@
 
 # the test code
 
-${TESTJAVA}${FS}bin${FS}keytool -list -keystore ${TESTSRC}${FS}SecretKeyKS.jks -storepass password
+${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -list -keystore ${TESTSRC}${FS}SecretKeyKS.jks -storepass password
 
 exit $?
--- a/jdk/test/sun/security/tools/keytool/StandardAlgName.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/StandardAlgName.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -69,20 +69,20 @@
 
 # the test code
 #CA
-${TESTJAVA}${FS}bin${FS}keytool -genkey -v -alias pkcs12testCA -keyalg "RsA" -keysize 2048 -sigalg "ShA1wItHRSA" -dname "cn=PKCS12 Test CA, ou=Security SQE, o=JavaSoft, c=US" -validity 3650 -keypass storepass -keystore keystoreCA.jceks.data -storepass storepass -storetype jceKS 2>&1 | egrep 'RsA|ShA1wItHRSA'
+${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -genkey -v -alias pkcs12testCA -keyalg "RsA" -keysize 2048 -sigalg "ShA1wItHRSA" -dname "cn=PKCS12 Test CA, ou=Security SQE, o=JavaSoft, c=US" -validity 3650 -keypass storepass -keystore keystoreCA.jceks.data -storepass storepass -storetype jceKS 2>&1 | egrep 'RsA|ShA1wItHRSA'
 
 RESULT=$?
 if [ $RESULT -eq 0 ]; then
     exit 1
 else
     #Lead
-    ${TESTJAVA}${FS}bin${FS}keytool -genkey -v -alias pkcs12testLead -keyalg "rSA" -keysize 1024 -sigalg "mD5withRSA" -dname "cn=PKCS12 Test Lead, ou=Security SQE, o=JavaSoft, c=US" -validity 3650 -keypass storepass -keystore keystoreLead.jceks.data -storepass storepass -storetype jCeks 2>&1 | egrep 'rSA|mD5withRSA'
+    ${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -genkey -v -alias pkcs12testLead -keyalg "rSA" -keysize 1024 -sigalg "mD5withRSA" -dname "cn=PKCS12 Test Lead, ou=Security SQE, o=JavaSoft, c=US" -validity 3650 -keypass storepass -keystore keystoreLead.jceks.data -storepass storepass -storetype jCeks 2>&1 | egrep 'rSA|mD5withRSA'
     RESULT=$?
     if [ $RESULT -eq 0 ]; then
         exit 1
     else
         #End User 1
-        ${TESTJAVA}${FS}bin${FS}keytool -genkey -v -alias pkcs12testEndUser1 -keyalg "RSa" -keysize 1024 -sigalg "sHa1wIThRSA" -dname "cn=PKCS12 Test End User 1, ou=Security SQE, o=JavaSoft, c=US" -validity 3650 -keypass storepass -keystore keystoreEndUser1.jceks.data -storepass storepass -storetype Jceks 2>&1 | egrep 'RSa|sHa1wIThRSA'
+        ${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -genkey -v -alias pkcs12testEndUser1 -keyalg "RSa" -keysize 1024 -sigalg "sHa1wIThRSA" -dname "cn=PKCS12 Test End User 1, ou=Security SQE, o=JavaSoft, c=US" -validity 3650 -keypass storepass -keystore keystoreEndUser1.jceks.data -storepass storepass -storetype Jceks 2>&1 | egrep 'RSa|sHa1wIThRSA'
         RESULT=$?
         if [ $RESULT -eq 0 ]; then
             exit 1
--- a/jdk/test/sun/security/tools/keytool/StorePasswordsByShell.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/StorePasswordsByShell.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -107,7 +107,7 @@
 
     echo "Storing user password (protected by ${i})"
     echo "${USER_PWD}" | \
-        ${TESTJAVA}${FILESEP}bin${FILESEP}keytool ${IMPORTPASSWORD} \
+        ${TESTJAVA}${FILESEP}bin${FILESEP}keytool ${TESTTOOLVMOPTS} ${IMPORTPASSWORD} \
             -storetype pkcs12 -keystore mykeystore.p12 -storepass changeit \
             -alias "${ALIAS_PREFIX}${i}" ${KEYALG} > /dev/null 2>&1
     if [ $? -ne 0 ]; then
@@ -119,7 +119,7 @@
 done
 echo
 
-COUNTER2=`${TESTJAVA}${FILESEP}bin${FILESEP}keytool -list -storetype pkcs12 \
+COUNTER2=`${TESTJAVA}${FILESEP}bin${FILESEP}keytool ${TESTTOOLVMOPTS} -list -storetype pkcs12 \
   -keystore mykeystore.p12 -storepass changeit | grep -c "${ALIAS_PREFIX}"`
 
 RESULT="stored ${COUNTER} user passwords, detected ${COUNTER2} user passwords"
--- a/jdk/test/sun/security/tools/keytool/emptysubject.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/emptysubject.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -45,7 +45,7 @@
 esac
 
 KS=emptysubject.jks
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 
 rm $KS
 
--- a/jdk/test/sun/security/tools/keytool/file-in-help.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/file-in-help.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -43,8 +43,8 @@
 esac
 
 LANG=C
-$TESTJAVA${FS}bin${FS}keytool -printcertreq -help 2> h1 || exit 1
-$TESTJAVA${FS}bin${FS}keytool -exportcert -help 2> h2 || exit 2
+$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -printcertreq -help 2> h1 || exit 1
+$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -exportcert -help 2> h2 || exit 2
 
 grep "input file" h1 || exit 3
 grep "output file" h2 || exit 4
--- a/jdk/test/sun/security/tools/keytool/importreadall.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/importreadall.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -49,7 +49,7 @@
     ;;
 esac
 
-KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -keystore importreadall.jks -storepass changeit -keypass changeit -keyalg rsa"
+KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -keystore importreadall.jks -storepass changeit -keypass changeit -keyalg rsa"
 
 # In case the test is run twice in the same directory
 
--- a/jdk/test/sun/security/tools/keytool/newhelp.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/newhelp.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -43,8 +43,8 @@
 esac
 
 LANG=C
-$TESTJAVA${FS}bin${FS}keytool -help 2> h1 || exit 1
-$TESTJAVA${FS}bin${FS}keytool -help -list 2> h2 || exit 2
+$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -help 2> h1 || exit 1
+$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -help -list 2> h2 || exit 2
 
 grep Commands: h1 || exit 3
 grep Options: h2 || exit 4
--- a/jdk/test/sun/security/tools/keytool/p12importks.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/p12importks.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -44,7 +44,7 @@
 esac
 
 LANG=C
-KT=$TESTJAVA${FS}bin${FS}keytool
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS}"
 
 # Part 1: JKS keystore with same storepass and keypass
 
--- a/jdk/test/sun/security/tools/keytool/printssl.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/printssl.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -62,7 +62,7 @@
           echo "Server not started"
           exit 2
       else
-          ${TESTJAVA}${FS}bin${FS}keytool -printcert -sslserver localhost:$PORT
+          ${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -printcert -sslserver localhost:$PORT
       fi
 )
 status=$?
--- a/jdk/test/sun/security/tools/keytool/resource.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/resource.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -62,7 +62,7 @@
 esac
 
 # the test code
-${TESTJAVA}${FS}bin${FS}keytool > temp_file_40875602475 2> ${NULL}
+${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} > temp_file_40875602475 2> ${NULL}
 grep MissingResourceException temp_file_40875602475
 
 if [ $? -eq 0 ]; then
--- a/jdk/test/sun/security/tools/keytool/selfissued.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/selfissued.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -45,7 +45,7 @@
 esac
 
 KS=selfsigned.jks
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 
 rm $KS
 
--- a/jdk/test/sun/security/tools/keytool/trystore.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/keytool/trystore.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -43,7 +43,7 @@
 
 rm trystore.jks 2> /dev/null
 
-KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -storetype jks -keystore trystore.jks -keyalg rsa"
+KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storetype jks -keystore trystore.jks -keyalg rsa"
 $KEYTOOL -genkeypair -alias a -dname CN=A -storepass changeit -keypass changeit
 $KEYTOOL -genkeypair -alias b -dname CN=B -storepass changeit -keypass changeit
 
--- a/jdk/test/sun/security/tools/policytool/i18n.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/tools/policytool/i18n.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -83,11 +83,11 @@
     exit 1
 fi
 
-${TESTJAVA}${FS}bin${FS}keytool -genkeypair -alias hello -dname CN=Hello \
+${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -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 ${TESTTOOLVMOPTS}
 
 exit $?
 
--- a/jdk/test/sun/security/validator/certreplace.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/validator/certreplace.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -47,7 +47,7 @@
     ;;
 esac
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit \
     -keypass changeit -keystore certreplace.jks -keyalg rsa"
 JAVAC=$COMPILEJAVA${FS}bin${FS}javac
 JAVA=$TESTJAVA${FS}bin${FS}java
--- a/jdk/test/sun/security/validator/samedn.sh	Wed Jul 05 19:38:35 2017 +0200
+++ b/jdk/test/sun/security/validator/samedn.sh	Fri Apr 25 10:57:09 2014 +0800
@@ -47,7 +47,7 @@
     ;;
 esac
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
+KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit \
     -keypass changeit -keystore samedn.jks -keyalg rsa"
 JAVAC=$COMPILEJAVA${FS}bin${FS}javac
 JAVA=$TESTJAVA${FS}bin${FS}java