test/sun/security/pkcs11/KeyStore/Basic.sh

Print this page




  37 # Note:
  38 #    . 'list' lists the token aliases
  39 #    . 'basic' does not run with activcard,
  40 #      and tests different things depending on what is supported by each token
  41 
  42 # set a few environment variables so that the shell-script can run stand-alone
  43 # in the source directory
  44 
  45 # if running by hand on windows, change TESTSRC and TESTCLASSES to "."
  46 if [ "${TESTSRC}" = "" ] ; then
  47     TESTSRC=`pwd`
  48 fi
  49 if [ "${TESTCLASSES}" = "" ] ; then
  50     TESTCLASSES=`pwd`
  51 fi
  52 
  53 # if running by hand on windows, change this to appropriate value
  54 if [ "${TESTJAVA}" = "" ] ; then
  55     TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"
  56 fi



  57 echo TESTSRC=${TESTSRC}
  58 echo TESTCLASSES=${TESTCLASSES}
  59 echo TESTJAVA=${TESTJAVA}

  60 echo ""
  61 
  62 # get command from input args -
  63 # default to 'nss basic'
  64 
  65 RECOMPILE="yes"
  66 if [ $# = '3' ] ; then
  67     RECOMPILE=$1
  68     TOKEN=$2
  69     TEST=$3
  70 elif [ $# = '2' ] ; then
  71     TOKEN=$1
  72     TEST=$2
  73 else
  74     TOKEN="nss"
  75     TEST="basic"
  76 fi
  77 
  78 DEBUG=sunpkcs11,pkcs11keystore
  79 


 146     ;;
 147   * )
 148     echo "Unsupported System: ${OS}"
 149     exit 0;
 150     ;;
 151 esac
 152 
 153 # first make cert/key DBs writable if token is NSS
 154 
 155 if [ "${TOKEN}" = "nss" ] ; then
 156     ${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}cert8.db ${TESTCLASSES}
 157     ${CHMOD} +w ${TESTCLASSES}${FS}cert8.db
 158 
 159     ${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}key3.db ${TESTCLASSES}
 160     ${CHMOD} +w ${TESTCLASSES}${FS}key3.db
 161 fi
 162 
 163 # compile test
 164 
 165 if [ "${RECOMPILE}" = "yes" ] ; then
 166     ${TESTJAVA}${FS}bin${FS}javac \
 167         -classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
 168         -d ${TESTCLASSES} \
 169         ${TESTSRC}${FS}Basic.java
 170 fi
 171 
 172 # run test
 173 
 174 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
 175         -classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
 176         -DDIR=${TESTSRC}${FS}BasicData \
 177         -DCUSTOM_DB_DIR=${TESTCLASSES} \
 178         -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${TOKEN}.txt \
 179         -DNO_DEFAULT=true \
 180         -DNO_DEIMOS=true \
 181         -DTOKEN=${TOKEN} \
 182         -DTEST=${TEST} \
 183         -Dtest.src=${TESTSRC} \
 184         -Dtest.classes=${TESTCLASSES} \
 185         -Djava.security.manager \
 186         -Djava.security.policy=${TESTSRC}${FS}Basic.policy \


  37 # Note:
  38 #    . 'list' lists the token aliases
  39 #    . 'basic' does not run with activcard,
  40 #      and tests different things depending on what is supported by each token
  41 
  42 # set a few environment variables so that the shell-script can run stand-alone
  43 # in the source directory
  44 
  45 # if running by hand on windows, change TESTSRC and TESTCLASSES to "."
  46 if [ "${TESTSRC}" = "" ] ; then
  47     TESTSRC=`pwd`
  48 fi
  49 if [ "${TESTCLASSES}" = "" ] ; then
  50     TESTCLASSES=`pwd`
  51 fi
  52 
  53 # if running by hand on windows, change this to appropriate value
  54 if [ "${TESTJAVA}" = "" ] ; then
  55     TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"
  56 fi
  57 if [ "${COMPILEJAVA}" = "" ]; then
  58   COMPILEJAVA="${TESTJAVA}"
  59 fi
  60 echo TESTSRC=${TESTSRC}
  61 echo TESTCLASSES=${TESTCLASSES}
  62 echo TESTJAVA=${TESTJAVA}
  63 echo echo COMPILEJAVA=${COMPILEJAVA}
  64 echo ""
  65 
  66 # get command from input args -
  67 # default to 'nss basic'
  68 
  69 RECOMPILE="yes"
  70 if [ $# = '3' ] ; then
  71     RECOMPILE=$1
  72     TOKEN=$2
  73     TEST=$3
  74 elif [ $# = '2' ] ; then
  75     TOKEN=$1
  76     TEST=$2
  77 else
  78     TOKEN="nss"
  79     TEST="basic"
  80 fi
  81 
  82 DEBUG=sunpkcs11,pkcs11keystore
  83 


 150     ;;
 151   * )
 152     echo "Unsupported System: ${OS}"
 153     exit 0;
 154     ;;
 155 esac
 156 
 157 # first make cert/key DBs writable if token is NSS
 158 
 159 if [ "${TOKEN}" = "nss" ] ; then
 160     ${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}cert8.db ${TESTCLASSES}
 161     ${CHMOD} +w ${TESTCLASSES}${FS}cert8.db
 162 
 163     ${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}key3.db ${TESTCLASSES}
 164     ${CHMOD} +w ${TESTCLASSES}${FS}key3.db
 165 fi
 166 
 167 # compile test
 168 
 169 if [ "${RECOMPILE}" = "yes" ] ; then
 170     ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
 171         -classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
 172         -d ${TESTCLASSES} \
 173         ${TESTSRC}${FS}Basic.java
 174 fi
 175 
 176 # run test
 177 
 178 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
 179         -classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
 180         -DDIR=${TESTSRC}${FS}BasicData \
 181         -DCUSTOM_DB_DIR=${TESTCLASSES} \
 182         -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${TOKEN}.txt \
 183         -DNO_DEFAULT=true \
 184         -DNO_DEIMOS=true \
 185         -DTOKEN=${TOKEN} \
 186         -DTEST=${TEST} \
 187         -Dtest.src=${TESTSRC} \
 188         -Dtest.classes=${TESTCLASSES} \
 189         -Djava.security.manager \
 190         -Djava.security.policy=${TESTSRC}${FS}Basic.policy \