test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java
changeset 48668 2da4a52715d8
parent 48651 67abfee27e69
child 53273 bbc79e0ec9ee
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 7152176 8168518 8172017 8014628
    26  * @bug 7152176 8168518 8172017 8014628 8194486
    27  * @summary More krb5 tests
    27  * @summary More krb5 tests
    28  * @library ../../../../java/security/testlibrary/ /test/lib
    28  * @library ../../../../java/security/testlibrary/ /test/lib
    29  * @build jdk.test.lib.Platform
    29  * @build jdk.test.lib.Platform
    30  * @run main/othervm/timeout=300 ReplayCacheTestProc
    30  * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
       
    31  * @run main/othervm/timeout=300 -Djdk.net.hosts.file=TestHosts
       
    32  *      ReplayCacheTestProc
    31  */
    33  */
    32 
    34 
    33 import java.io.*;
    35 import java.io.*;
    34 import java.nio.BufferUnderflowException;
    36 import java.nio.BufferUnderflowException;
    35 import java.nio.channels.SeekableByteChannel;
    37 import java.nio.channels.SeekableByteChannel;
   158                     }
   160                     }
   159                 }
   161                 }
   160             }
   162             }
   161 
   163 
   162             pi = Proc.create("ReplayCacheTestProc").debug("C")
   164             pi = Proc.create("ReplayCacheTestProc").debug("C")
       
   165                     .inheritProp("jdk.net.hosts.file")
   163                     .args("initiator")
   166                     .args("initiator")
   164                     .start();
   167                     .start();
   165 
   168 
   166             int na = libs.length * numPerType;  // total number of acceptors
   169             int na = libs.length * numPerType;  // total number of acceptors
   167             pa = new Proc[na];
   170             pa = new Proc[na];
   370             label = type.substring(0, pos);
   373             label = type.substring(0, pos);
   371             lib = type.substring(pos + 1);
   374             lib = type.substring(pos + 1);
   372         }
   375         }
   373         if (type.startsWith("J")) {
   376         if (type.startsWith("J")) {
   374             if (lib == null) {
   377             if (lib == null) {
   375                 p = Proc.create("ReplayCacheTestProc");
   378                 p = Proc.create("ReplayCacheTestProc")
       
   379                         .inheritProp("jdk.net.hosts.file");
   376             } else {
   380             } else {
   377                 p = Proc.create("ReplayCacheTestProc", lib);
   381                 p = Proc.create("ReplayCacheTestProc", lib)
       
   382                         .inheritProp("jdk.net.hosts.file");
   378             }
   383             }
   379             p.prop("sun.security.krb5.rcache", "dfl")
   384             p.prop("sun.security.krb5.rcache", "dfl")
   380                     .prop("java.io.tmpdir", cwd);
   385                     .prop("java.io.tmpdir", cwd);
   381             String useMD5 = System.getProperty("jdk.krb5.rcache.useMD5");
   386             String useMD5 = System.getProperty("jdk.krb5.rcache.useMD5");
   382             if (useMD5 != null) {
   387             if (useMD5 != null) {
   385         } else {
   390         } else {
   386             p = Proc.create("ReplayCacheTestProc")
   391             p = Proc.create("ReplayCacheTestProc")
   387                     .env("KRB5_CONFIG", OneKDC.KRB5_CONF)
   392                     .env("KRB5_CONFIG", OneKDC.KRB5_CONF)
   388                     .env("KRB5_KTNAME", OneKDC.KTAB)
   393                     .env("KRB5_KTNAME", OneKDC.KTAB)
   389                     .env("KRB5RCACHEDIR", cwd)
   394                     .env("KRB5RCACHEDIR", cwd)
       
   395                     .inheritProp("jdk.net.hosts.file")
   390                     .prop("sun.security.jgss.native", "true")
   396                     .prop("sun.security.jgss.native", "true")
   391                     .prop("javax.security.auth.useSubjectCredsOnly", "false")
   397                     .prop("javax.security.auth.useSubjectCredsOnly", "false")
   392                     .prop("sun.security.nativegss.debug", "true");
   398                     .prop("sun.security.nativegss.debug", "true");
   393             if (lib != null) {
   399             if (lib != null) {
   394                 String libDir = lib.substring(0, lib.lastIndexOf('/'));
   400                 String libDir = lib.substring(0, lib.lastIndexOf('/'));