test/jdk/sun/security/krb5/auto/BasicProc.java
changeset 48668 2da4a52715d8
parent 47227 8052fa06e1b7
child 49682 2918e1146106
equal deleted inserted replaced
48667:f2344724a475 48668:2da4a52715d8
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8009977 8186884
    26  * @bug 8009977 8186884 8194486
    27  * @summary A test to launch multiple Java processes using either Java GSS
    27  * @summary A test to launch multiple Java processes using either Java GSS
    28  *          or native GSS
    28  *          or native GSS
    29  * @library ../../../../java/security/testlibrary/
    29  * @library ../../../../java/security/testlibrary/ /test/lib
    30  * @compile -XDignore.symbol.file BasicProc.java
    30  * @compile -XDignore.symbol.file BasicProc.java
    31  * @run main/othervm BasicProc launcher
    31  * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
       
    32  * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicProc launcher
    32  */
    33  */
    33 
    34 
    34 import java.nio.file.Files;
    35 import java.nio.file.Files;
    35 import java.nio.file.Paths;
    36 import java.nio.file.Paths;
    36 import java.nio.file.attribute.PosixFilePermission;
    37 import java.nio.file.attribute.PosixFilePermission;
   302      *
   303      *
   303      * @param lib the library. Null is Java. "" is default native lib.
   304      * @param lib the library. Null is Java. "" is default native lib.
   304      */
   305      */
   305     private static Proc proc(String lib) throws Exception {
   306     private static Proc proc(String lib) throws Exception {
   306         Proc p = Proc.create("BasicProc")
   307         Proc p = Proc.create("BasicProc")
       
   308                 .inheritProp("jdk.net.hosts.file")
   307                 .prop("java.security.manager", "")
   309                 .prop("java.security.manager", "")
   308                 .perm(new javax.security.auth.AuthPermission("doAs"));
   310                 .perm(new javax.security.auth.AuthPermission("doAs"));
   309         if (lib != null) {
   311         if (lib != null) {
   310             p.env("KRB5_CONFIG", CONF)
   312             p.env("KRB5_CONFIG", CONF)
   311                     .env("KRB5_TRACE", "/dev/stderr")
   313                     .env("KRB5_TRACE", "/dev/stderr")