jdk/test/java/net/URLPermission/nstest/lookup.sh
author michaelm
Thu, 07 Nov 2013 10:22:11 +0000
changeset 21621 3101c2e7e705
child 21644 12edcc716b48
permissions -rw-r--r--
8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient Reviewed-by: chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21621
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
     1
#!/bin/sh
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
     2
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
     3
#
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
     4
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
     5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
     6
#
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
     7
# This code is free software; you can redistribute it and/or modify it
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
     8
# under the terms of the GNU General Public License version 2 only, as
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
     9
# published by the Free Software Foundation.
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    10
#
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    15
# accompanied this code).
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    16
#
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    20
#
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    23
# questions.
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    24
#
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    25
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    26
# @test
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    27
# @library /lib/testlibrary
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    28
# @compile -XDignore.symbol.file=true SimpleNameService.java
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    29
#            LookupTest.java SimpleNameServiceDescriptor.java
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    30
# @run shell/timeout=50 lookup.sh
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    31
#
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    32
DIR=`pwd`
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    33
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    34
port=`${TESTJAVA}/bin/java -cp ${TESTCLASSES} LookupTest -getport`
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    35
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    36
cat << POLICY > policy
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    37
grant {
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    38
    permission java.net.URLPermission "http://allowedAndFound.com:${port}/-", "*:*";
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    39
    permission java.net.URLPermission "http://allowedButNotfound.com:${port}/-", "*:*";
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    40
    permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    41
    permission java.util.PropertyPermission "java.io.tmpdir", "read";
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    42
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    43
    // needed for HttpServer
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    44
    permission "java.net.SocketPermission" "localhost:1024-", "resolve,accept";
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    45
};
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    46
POLICY
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    47
3101c2e7e705 8027881: test/java/net/URLPermission/nstest/LookupTest.java failing intermittently, output insufficient
michaelm
parents:
diff changeset
    48
${TESTJAVA}/bin/java -Djava.security.policy=file://${DIR}/policy -Dsun.net.spi.nameservice.provider.1=simple,sun -cp ${TESTCLASSES}:${TESTSRC} LookupTest -runtest $port