Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/lib/security/java.policy/Ext_AllPolicy.sh
38840 views
#1# Copyright (c) 1999, 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 421503525# @summary standard extensions path is hard-coded in default system policy file26#27# @build Ext_AllPolicy28# @run shell Ext_AllPolicy.sh2930#31# For testing extenions, the classes live in jar files, and therefore32# we shouldn't be able to find the raw class file.33#3435# set a few environment variables so that the shell-script can run stand-alone36# in the source directory37if [ "${TESTSRC}" = "" ] ; then38TESTSRC="."39fi40if [ "${TESTCLASSES}" = "" ] ; then41TESTCLASSES="."42fi43if [ "${TESTJAVA}" = "" ] ; then44echo "TESTJAVA not set. Test cannot execute."45echo "FAILED!!!"46exit 147fi48if [ "${COMPILEJAVA}" = "" ]; then49COMPILEJAVA="${TESTJAVA}"50fi5152# set platform-dependent variables53OS=`uname -s`54case "$OS" in55SunOS | Linux | Darwin | AIX )56NULL=/dev/null57PS=":"58FS="/"59;;60CYGWIN* )61NULL=/dev/null62PS=";"63FS="/"64;;65Windows_95 | Windows_98 | Windows_NT )66NULL=NUL67PS=";"68FS="\\"69;;70* )71echo "Unrecognized system!"72exit 1;73;;74esac7576# the test code7778cd ${TESTCLASSES}79${COMPILEJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS} -cvf Ext_AllPolicy.jar Ext_AllPolicy.class8081rm Ext_AllPolicy.class82${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \83-Djava.security.manager -Djava.ext.dirs="${TESTCLASSES}" Ext_AllPolicy8485exit $?868788