Path: blob/jdk8u272-b10-aarch32-20201026/jdk/test/java/net/URLPermission/nstest/lookup.sh
48795 views
#!/bin/sh1#2# Copyright (c) 2013, 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 it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 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 USA20# or visit www.oracle.com if you need additional information or have any21# questions.22#2324# @test25# @library /lib/testlibrary26# @build jdk.testlibrary.*27# @compile -XDignore.symbol.file=true SimpleNameService.java28# LookupTest.java SimpleNameServiceDescriptor.java29# @run shell/timeout=50 lookup.sh30#3132OS=`uname -s`33case ${OS} in34Windows_* | CYGWIN*)35PS=";"36FS="\\"37;;38*)39PS=":"40FS="/"41;;42esac4344port=`${TESTJAVA}/bin/java -cp ${TESTCLASSPATH} LookupTest -getport`4546cat << POLICY > policy47grant {48permission java.net.URLPermission "http://allowedAndFound.com:${port}/-", "*:*";49permission java.net.URLPermission "http://allowedButNotfound.com:${port}/-", "*:*";50permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";51permission java.util.PropertyPermission "java.io.tmpdir", "read";5253// needed for HttpServer54permission "java.net.SocketPermission" "localhost:1024-", "resolve,accept";55};56POLICY5758${TESTJAVA}/bin/java ${TESTVMOPTS} \59-Djava.security.policy=file:./policy \60-Dsun.net.spi.nameservice.provider.1=simple,sun \61-cp ${TESTCLASSPATH}${PS}${TESTSRC} LookupTest -runtest ${port}626364