Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/sun/security/tools/keytool/SecretKeyKS.sh
38854 views
#1# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#2223# @test24# @bug 469407625# @summary KeyTool throws ArrayIndexOutOfBoundsException for listing26# SecretKey entries in non-verbose mode.27# @author Valerie Peng28#29# @run shell SecretKeyKS.sh30# set a few environment variables so that the shell-script can run stand-alone31# in the source directory32if [ "${TESTSRC}" = "" ] ; then33TESTSRC="."34fi35if [ "${TESTCLASSES}" = "" ] ; then36TESTCLASSES="."37fi38if [ "${TESTJAVA}" = "" ] ; then39echo "TESTJAVA not set. Test cannot execute."40echo "FAILED!!!"41exit 142fi4344# set platform-dependent variables45OS=`uname -s`46case "$OS" in47SunOS | Linux | Darwin | AIX )48NULL=/dev/null49PS=":"50FS="/"51;;52CYGWIN* )53NULL=/dev/null54PS=";"55FS="/"56;;57Windows_* )58NULL=NUL59PS=";"60FS="\\"61;;62* )63echo "Unrecognized operating system!"64exit 1;65;;66esac6768# the test code6970${TESTJAVA}${FS}bin${FS}keytool -list -keystore ${TESTSRC}${FS}SecretKeyKS.jks -storepass password7172exit $?737475