Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/sun/security/tools/policytool/i18n.sh
38853 views
#1# Copyright (c) 2000, 2013, 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 434837025# @bug 801527426# @bug 801527627# @bug 801615828# @summary policytool not i18n compliant29#30# @run applet/manual=done i18n.html31# @run shell/timeout=1200 i18n.sh32# @run applet/manual=yesno i18n.html3334# set a few environment variables so that the shell-script can run stand-alone35# in the source directory36if [ "${TESTSRC}" = "" ] ; then37TESTSRC="."38fi39if [ "${TESTCLASSES}" = "" ] ; then40TESTCLASSES="."41fi42if [ "${TESTJAVA}" = "" ] ; then43echo "TESTJAVA not set. Test cannot execute."44echo "FAILED!!!"45exit 146fi4748# set platform-dependent variables49OS=`uname -s`50case "$OS" in51SunOS | Linux | Darwin | AIX )52NULL=/dev/null53PS=":"54FS="/"55;;56CYGWIN* )57NULL=/dev/null58PS=";"59FS="/"60;;61Windows* )62NULL=NUL63PS=";"64FS="\\"65;;66* )67echo "Unrecognized system!"68exit 1;69;;70esac7172# the test code7374echo "HELLO!"7576echo "Checking for $HOME/.java.policy"7778# 801527479if [ -f $HOME/.java.policy ]; then80echo "You have a .java.policy file in your HOME directory"81echo "The file must be removed before running this test"82exit 183fi8485${TESTJAVA}${FS}bin${FS}keytool -genkeypair -alias hello -dname CN=Hello \86-storepass changeit -keypass changeit -keystore ks87echo changeit > good88echo badpass > bad89${TESTJAVA}${FS}bin${FS}policytool9091exit $?92939495