jdk/test/sun/security/mscapi/ShortRSAKey768.sh
changeset 12699 6142d1da5851
parent 11521 d7698e6c5f51
--- a/jdk/test/sun/security/mscapi/ShortRSAKey768.sh	Thu May 17 22:42:32 2012 +0100
+++ b/jdk/test/sun/security/mscapi/ShortRSAKey768.sh	Thu May 17 21:59:26 2012 -0700
@@ -47,10 +47,19 @@
 
 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 @@
             -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
         ;;