test/jdk/sun/security/tools/keytool/standard.sh
branchJEP-230-microbenchmarks-branch
changeset 56921 69544f53b8bf
parent 56920 e0750e33f818
parent 51997 9ce37fa2e179
child 56922 4219852032ba
equal deleted inserted replaced
56920:e0750e33f818 56921:69544f53b8bf
     1 #
       
     2 # Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
       
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4 #
       
     5 # This code is free software; you can redistribute it and/or modify it
       
     6 # under the terms of the GNU General Public License version 2 only, as
       
     7 # published by the Free Software Foundation.
       
     8 #
       
     9 # This code is distributed in the hope that it will be useful, but WITHOUT
       
    10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    12 # version 2 for more details (a copy is included in the LICENSE file that
       
    13 # accompanied this code).
       
    14 #
       
    15 # You should have received a copy of the GNU General Public License version
       
    16 # 2 along with this work; if not, write to the Free Software Foundation,
       
    17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    18 #
       
    19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    20 # or visit www.oracle.com if you need additional information or have any
       
    21 # questions.
       
    22 #
       
    23 
       
    24 # @test
       
    25 # @summary (almost) all keytool behaviors
       
    26 # @author Weijun Wang
       
    27 # @library /test/lib
       
    28 # @build jdk.test.lib.util.FileUtils
       
    29 # @run shell/timeout=600 standard.sh
       
    30 # @key intermittent
       
    31 
       
    32 # This test is always excecuted.
       
    33 #
       
    34 # set a few environment variables so that the shell-script can run stand-alone
       
    35 # in the source directory
       
    36 if [ "${TESTSRC}" = "" ] ; then
       
    37   TESTSRC="."
       
    38 fi
       
    39 if [ "${TESTCLASSES}" = "" ] ; then
       
    40   TESTCLASSES="."
       
    41 fi
       
    42 if [ "${TESTJAVA}" = "" ] ; then
       
    43   JAVAC_CMD=`which javac`
       
    44   TESTJAVA=`dirname $JAVAC_CMD`/..
       
    45   COMPILEJAVA="${TESTJAVA}"
       
    46 fi
       
    47 
       
    48 # set platform-dependent variables
       
    49 OS=`uname -s`
       
    50 case "$OS" in
       
    51   SunOS | Linux | Darwin | AIX | CYGWIN* )
       
    52     FS="/"
       
    53     ;;
       
    54   Windows_* )
       
    55     FS="\\"
       
    56     ;;
       
    57   * )
       
    58     echo "Unrecognized system!"
       
    59     exit 1;
       
    60     ;;
       
    61 esac
       
    62 case "$OS" in
       
    63   Windows_* | CYGWIN* )
       
    64     PS=";"
       
    65     ;;
       
    66   * )
       
    67     PS=":"
       
    68     ;;
       
    69 esac
       
    70 
       
    71 EXTRAOPTS="--add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED \
       
    72  --add-exports java.base/sun.security.util=ALL-UNNAMED \
       
    73  --add-exports java.base/sun.security.x509=ALL-UNNAMED"
       
    74 
       
    75 ${COMPILEJAVA}${FS}bin${FS}javac -classpath ${TESTCLASSPATH} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . -XDignore.symbol.file ${TESTSRC}${FS}KeyToolTest.java || exit 10
       
    76 
       
    77 echo | ${TESTJAVA}${FS}bin${FS}java -classpath .${PS}${TESTCLASSPATH} ${TESTVMOPTS} ${EXTRAOPTS} -Dfile KeyToolTest
       
    78 status=$?
       
    79 
       
    80 exit $status
       
    81