changeset 4558:eff45ca3391b

Merge
author lana
date Wed, 28 Dec 2011 13:02:43 -0800
parents 69304428880a ea43b1e91196
children e5b699ef3c77 15b5f3ec1c55
files
diffstat 1 files changed, 35 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh	Wed Dec 28 10:52:45 2011 -0800
+++ b/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh	Wed Dec 28 13:02:43 2011 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -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:
@@ -44,9 +46,9 @@
     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 +65,42 @@
   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 +116,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 +140,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 \