From 955e0697ba1b2de891ded69c8d4befafaddd73dc Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Thu, 17 May 2012 21:59:26 -0700 Subject: [PATCH] 7145960: sun/security/mscapi/ShortRSAKey1024.sh failing on windows Reviewed-by: vinnie, wetmore --- .../sun/security/mscapi/ShortRSAKey1024.sh | 25 +++++++++++++++---- .../sun/security/mscapi/ShortRSAKey512.sh | 25 +++++++++++++++---- .../sun/security/mscapi/ShortRSAKey768.sh | 25 +++++++++++++++---- 3 files changed, 60 insertions(+), 15 deletions(-) diff --git a/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh b/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh index b446143ecb1..9caeed46c39 100644 --- a/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh +++ b/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh @@ -46,11 +46,20 @@ if [ "${TESTJAVA}" = "" ] ; then fi OS=`uname -s` +case "$OS" in + SunOS | Linux | Darwin | CYGWIN* ) + FS="/" + ;; + Windows_* ) + FS="\\" + ;; +esac + case "$OS" in Windows* | CYGWIN* ) echo "Creating a temporary RSA keypair in the Windows-My store..." - ${TESTJAVA}/bin/keytool \ + ${TESTJAVA}${FS}bin${FS}keytool \ -genkeypair \ -storetype Windows-My \ -keyalg RSA \ @@ -59,22 +68,28 @@ case "$OS" in -dname "cn=localhost,c=US" \ -noprompt + if [ "$?" -ne "0" ]; then + echo "Unable to generate key pair in Windows-My keystore" + exit 1 + fi + echo echo "Running the test..." - ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\ShortRSAKeyWithinTLS.java - ${TESTJAVA}/bin/java ShortRSAKeyWithinTLS 7106773.1024 1024 \ + ${TESTJAVA}${FS}bin${FS}javac -d . \ + ${TESTSRC}${FS}ShortRSAKeyWithinTLS.java + ${TESTJAVA}${FS}bin${FS}java ShortRSAKeyWithinTLS 7106773.1024 1024 \ TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA rc=$? echo echo "Removing the temporary RSA keypair from the Windows-My store..." - ${TESTJAVA}/bin/keytool \ + ${TESTJAVA}${FS}bin${FS}keytool \ -delete \ -storetype Windows-My \ -alias 7106773.1024 - echo done. + echo "Done". exit $rc ;; diff --git a/jdk/test/sun/security/mscapi/ShortRSAKey512.sh b/jdk/test/sun/security/mscapi/ShortRSAKey512.sh index e4cae406383..b8cb84076a3 100644 --- a/jdk/test/sun/security/mscapi/ShortRSAKey512.sh +++ b/jdk/test/sun/security/mscapi/ShortRSAKey512.sh @@ -46,11 +46,20 @@ if [ "${TESTJAVA}" = "" ] ; then fi OS=`uname -s` +case "$OS" in + SunOS | Linux | Darwin | CYGWIN* ) + FS="/" + ;; + Windows_* ) + FS="\\" + ;; +esac + case "$OS" in Windows* | CYGWIN* ) echo "Creating a temporary RSA keypair in the Windows-My store..." - ${TESTJAVA}/bin/keytool \ + ${TESTJAVA}${FS}bin${FS}keytool \ -genkeypair \ -storetype Windows-My \ -keyalg RSA \ @@ -59,10 +68,16 @@ case "$OS" in -dname "cn=localhost,c=US" \ -noprompt + if [ "$?" -ne "0" ]; then + echo "Unable to generate key pair in Windows-My keystore" + exit 1 + fi + echo echo "Running the test..." - ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\ShortRSAKeyWithinTLS.java - ${TESTJAVA}/bin/java ShortRSAKeyWithinTLS 7106773.512 512 \ + ${TESTJAVA}${FS}bin${FS}javac -d . \ + ${TESTSRC}${FS}ShortRSAKeyWithinTLS.java + ${TESTJAVA}${FS}bin${FS}java ShortRSAKeyWithinTLS 7106773.512 512 \ TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA @@ -70,12 +85,12 @@ case "$OS" in echo echo "Removing the temporary RSA keypair from the Windows-My store..." - ${TESTJAVA}/bin/keytool \ + ${TESTJAVA}${FS}bin${FS}keytool \ -delete \ -storetype Windows-My \ -alias 7106773.512 - echo done. + echo "Done". exit $rc ;; diff --git a/jdk/test/sun/security/mscapi/ShortRSAKey768.sh b/jdk/test/sun/security/mscapi/ShortRSAKey768.sh index a81903b818c..0732f9a1029 100644 --- a/jdk/test/sun/security/mscapi/ShortRSAKey768.sh +++ b/jdk/test/sun/security/mscapi/ShortRSAKey768.sh @@ -46,11 +46,20 @@ if [ "${TESTJAVA}" = "" ] ; then fi OS=`uname -s` +case "$OS" in + SunOS | Linux | Darwin | CYGWIN* ) + FS="/" + ;; + Windows_* ) + FS="\\" + ;; +esac + case "$OS" in Windows* | CYGWIN* ) echo "Creating a temporary RSA keypair in the Windows-My store..." - ${TESTJAVA}/bin/keytool \ + ${TESTJAVA}${FS}bin${FS}keytool \ -genkeypair \ -storetype Windows-My \ -keyalg RSA \ @@ -59,22 +68,28 @@ case "$OS" in -dname "cn=localhost,c=US" \ -noprompt + if [ "$?" -ne "0" ]; then + echo "Unable to generate key pair in Windows-My keystore" + exit 1 + fi + echo echo "Running the test..." - ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\ShortRSAKeyWithinTLS.java - ${TESTJAVA}/bin/java ShortRSAKeyWithinTLS 7106773.768 768 \ + ${TESTJAVA}${FS}bin${FS}javac -d . \ + ${TESTSRC}${FS}ShortRSAKeyWithinTLS.java + ${TESTJAVA}${FS}bin${FS}java ShortRSAKeyWithinTLS 7106773.768 768 \ TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA rc=$? echo echo "Removing the temporary RSA keypair from the Windows-My store..." - ${TESTJAVA}/bin/keytool \ + ${TESTJAVA}${FS}bin${FS}keytool \ -delete \ -storetype Windows-My \ -alias 7106773.768 - echo done. + echo "Done". exit $rc ;;