7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure
authorweijun
Mon, 15 Aug 2011 10:42:41 +0800
changeset 10332 9037c51ae512
parent 10331 89efdda10a54
child 10333 96264d6bb3a3
7078816: /test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh failure Reviewed-by: alanb
jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh
--- a/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh	Fri Aug 12 14:51:48 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh	Mon Aug 15 10:42:41 2011 +0800
@@ -25,6 +25,8 @@
 # @bug 6599979
 # @summary Ensure that re-assigning the alias works
 #
+# @library ..
+# @build SecretKeysBasic
 # @run shell SecretKeysBasic.sh
 #
 # To run by hand:
@@ -43,10 +45,9 @@
 if [ "${TESTCLASSES}" = "" ] ; then
     TESTCLASSES=`pwd`
 fi
-
-# if running by hand on windows, change this to appropriate value
 if [ "${TESTJAVA}" = "" ] ; then
-    TESTJAVA="/net/shimmer/export/valeriep/jdk7/build/solaris-sparc"
+    JAVAC_CMD=`which javac`
+    TESTJAVA=`dirname $JAVAC_CMD`/..
 fi
 echo TESTSRC=${TESTSRC}
 echo TESTCLASSES=${TESTCLASSES}
@@ -63,19 +64,41 @@
   SunOS )
     FS="/"
     PS=":"
-    SCCS="${FS}usr${FS}ccs${FS}bin${FS}sccs"
-    CP="${FS}bin${FS}cp -f"
-    RM="${FS}bin${FS}rm -rf"
-    MKDIR="${FS}bin${FS}mkdir -p"
-    CHMOD="${FS}bin${FS}chmod"
+    OS_VERSION=`uname -r`
+    case "${OS_VERSION}" in
+      5.1* )
+        SOFTTOKEN_DIR=${TESTCLASSES}
+        export SOFTTOKEN_DIR
+        TOKENS="nss solaris"
+        ;;
+      * )
+        # SunPKCS11-Solaris Test only runs on Solaris 5.10 and later
+        TOKENS="nss"
+        ;;
+    esac
+    ;;
+  Windows_* )
+    FS="\\"
+    PS=";"
+    TOKENS="nss"
+    ;;
+  CYGWIN* )
+    FS="/"
+    PS=";"
+    TOKENS="nss"
     ;;
   * )
-    echo "Unsupported System ${OS} - Test only runs on Solaris"
-    exit 0;
+    FS="/"
+    PS=":"
+    TOKENS="nss"
     ;;
 esac
 
-TOKENS="nss solaris"
+CP="cp -f"
+RM="rm -rf"
+MKDIR="mkdir -p"
+CHMOD="chmod"
+
 STATUS=0
 for token in ${TOKENS}
 do
@@ -91,18 +114,6 @@
     USED_FILE_LIST="${TESTCLASSES}${FS}cert8.db ${TESTCLASSES}${FS}key3.db"
 elif [ ${token} = "solaris" ]
 then
-    OS_VERSION=`uname -r`
-    case "${OS_VERSION}" in
-      5.1* )
-        SOFTTOKEN_DIR=${TESTCLASSES}
-        export SOFTTOKEN_DIR
-        ;;
-      * )
-        echo "Unsupported Version ${OS_VERSION} - Test only runs on Solaris"
-        exit 0;
-        ;;
-    esac
-
     # copy keystore into write-able location
     if [ -d ${TESTCLASSES}${FS}pkcs11_softtoken ]
     then
@@ -127,12 +138,6 @@
     USED_FILE_LIST="${TESTCLASSES}${FS}pkcs11_softtoken"
 fi
 
-cd ${TESTCLASSES}
-${TESTJAVA}${FS}bin${FS}javac \
-        -classpath ${TESTCLASSES} \
-        -d ${TESTCLASSES} \
-        ${TESTSRC}${FS}SecretKeysBasic.java
-
 # run test
 cd ${TESTSRC}
 ${TESTJAVA}${FS}bin${FS}java \