jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh
author prr
Tue, 01 Jul 2014 10:20:56 -0700
changeset 25211 2476da7d73bf
parent 23010 6dadb192ad81
child 41580 cc479488428c
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 22602
diff changeset
     2
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3433
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3433
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3433
diff changeset
    21
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
# @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
# @bug 6370923
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# @summary SecretKeyFactory failover does not work
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# @author Brad R. Wetmore
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
if [ "${TESTJAVA}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
echo "TESTJAVA=${TESTJAVA}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    38
if [ "${COMPILEJAVA}" = "" ]; then
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    39
  COMPILEJAVA="${TESTJAVA}"
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    40
fi
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    41
echo "COMPILEJAVA=${COMPILEJAVA}"
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    42
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
if [ "${TESTSRC}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    TESTSRC="."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
echo "TESTSRC=${TESTSRC}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
if [ "${TESTCLASSES}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    TESTCLASSES="."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
echo "TESTCLASSES=${TESTCLASSES}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
# set platform-dependent variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
OS=`uname -s`
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
case "$OS" in
22602
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 15254
diff changeset
    59
  SunOS | Linux | Darwin | AIX )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    NULL=/dev/null
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    PS=":"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    FS="/"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    ;;
3433
3b2490b7a752 6867657: Many JSN tests do not run under cygwin
wetmore
parents: 2
diff changeset
    64
  CYGWIN* )
3b2490b7a752 6867657: Many JSN tests do not run under cygwin
wetmore
parents: 2
diff changeset
    65
    NULL=/dev/null
3b2490b7a752 6867657: Many JSN tests do not run under cygwin
wetmore
parents: 2
diff changeset
    66
    PS=";"
3b2490b7a752 6867657: Many JSN tests do not run under cygwin
wetmore
parents: 2
diff changeset
    67
    FS="/"
3b2490b7a752 6867657: Many JSN tests do not run under cygwin
wetmore
parents: 2
diff changeset
    68
    ;;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
  Windows* )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    NULL=NUL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    PS=";"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    FS="\\"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
  * )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    echo "Unrecognized system!"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    exit 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
esac
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    80
${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    -d . \
3433
3b2490b7a752 6867657: Many JSN tests do not run under cygwin
wetmore
parents: 2
diff changeset
    82
    -classpath "${TESTSRC}${FS}P1.jar${PS}${TESTSRC}${FS}P2.jar" \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    ${TESTSRC}${FS}FailOverTest.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
if [ $? -ne 0 ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
${TESTJAVA}${FS}bin${FS}java \
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14342
diff changeset
    90
    ${TESTVMOPTS} \
3433
3b2490b7a752 6867657: Many JSN tests do not run under cygwin
wetmore
parents: 2
diff changeset
    91
    -classpath "${TESTSRC}${FS}P1.jar${PS}${TESTSRC}${FS}P2.jar${PS}." \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    FailOverTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
result=$?
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
if [ $result -eq 0 ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
  echo "Passed"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
  echo "Failed"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
exit $result