8194486: Several krb5 tests failed in Mac.
authorssahoo
Thu, 25 Jan 2018 05:57:22 -0800
changeset 48668 2da4a52715d8
parent 48667 f2344724a475
child 48669 51d97ee431ff
8194486: Several krb5 tests failed in Mac. Summary: Several tests failed due to improper host service Reviewed-by: weijun
test/jdk/sun/security/krb5/auto/AcceptPermissions.java
test/jdk/sun/security/krb5/auto/AcceptorSubKey.java
test/jdk/sun/security/krb5/auto/Addresses.java
test/jdk/sun/security/krb5/auto/AddressesAndNameType.java
test/jdk/sun/security/krb5/auto/Basic.java
test/jdk/sun/security/krb5/auto/BasicKrb5Test.java
test/jdk/sun/security/krb5/auto/BasicProc.java
test/jdk/sun/security/krb5/auto/BogusKDC.java
test/jdk/sun/security/krb5/auto/CleanState.java
test/jdk/sun/security/krb5/auto/CrossRealm.java
test/jdk/sun/security/krb5/auto/DiffNameSameKey.java
test/jdk/sun/security/krb5/auto/DiffSaltParams.java
test/jdk/sun/security/krb5/auto/DupEtypes.java
test/jdk/sun/security/krb5/auto/DynamicKeytab.java
test/jdk/sun/security/krb5/auto/EmptyPassword.java
test/jdk/sun/security/krb5/auto/FileKeyTab.java
test/jdk/sun/security/krb5/auto/ForwardableCheck.java
test/jdk/sun/security/krb5/auto/Forwarded.java
test/jdk/sun/security/krb5/auto/GSS.java
test/jdk/sun/security/krb5/auto/GSSUnbound.java
test/jdk/sun/security/krb5/auto/HttpNegotiateServer.java
test/jdk/sun/security/krb5/auto/IgnoreChannelBinding.java
test/jdk/sun/security/krb5/auto/KDC.java
test/jdk/sun/security/krb5/auto/KPEquals.java
test/jdk/sun/security/krb5/auto/KdcPolicy.java
test/jdk/sun/security/krb5/auto/KeyPermissions.java
test/jdk/sun/security/krb5/auto/KeyTabCompat.java
test/jdk/sun/security/krb5/auto/KrbTicket.java
test/jdk/sun/security/krb5/auto/KvnoNA.java
test/jdk/sun/security/krb5/auto/LifeTimeInSeconds.java
test/jdk/sun/security/krb5/auto/LoginModuleOptions.java
test/jdk/sun/security/krb5/auto/LoginNoPass.java
test/jdk/sun/security/krb5/auto/LongLife.java
test/jdk/sun/security/krb5/auto/MSOID2.java
test/jdk/sun/security/krb5/auto/ModuleName.java
test/jdk/sun/security/krb5/auto/MoreKvno.java
test/jdk/sun/security/krb5/auto/NewInquireTypes.java
test/jdk/sun/security/krb5/auto/NewSalt.java
test/jdk/sun/security/krb5/auto/NoInitNoKeytab.java
test/jdk/sun/security/krb5/auto/NonMutualSpnego.java
test/jdk/sun/security/krb5/auto/NoneReplayCacheTest.java
test/jdk/sun/security/krb5/auto/NullRenewUntil.java
test/jdk/sun/security/krb5/auto/OkAsDelegate.java
test/jdk/sun/security/krb5/auto/OkAsDelegateXRealm.java
test/jdk/sun/security/krb5/auto/OnlyDesLogin.java
test/jdk/sun/security/krb5/auto/PrincipalNameEquals.java
test/jdk/sun/security/krb5/auto/RRC.java
test/jdk/sun/security/krb5/auto/RefreshKrb5Config.java
test/jdk/sun/security/krb5/auto/Renew.java
test/jdk/sun/security/krb5/auto/Renewal.java
test/jdk/sun/security/krb5/auto/ReplayCacheTest.java
test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java
test/jdk/sun/security/krb5/auto/S4U2proxy.java
test/jdk/sun/security/krb5/auto/S4U2proxyGSS.java
test/jdk/sun/security/krb5/auto/S4U2self.java
test/jdk/sun/security/krb5/auto/S4U2selfAsServer.java
test/jdk/sun/security/krb5/auto/S4U2selfAsServerGSS.java
test/jdk/sun/security/krb5/auto/S4U2selfGSS.java
test/jdk/sun/security/krb5/auto/SPNEGO.java
test/jdk/sun/security/krb5/auto/SSL.java
test/jdk/sun/security/krb5/auto/SSLwithPerms.java
test/jdk/sun/security/krb5/auto/SaslBasic.java
test/jdk/sun/security/krb5/auto/SaslGSS.java
test/jdk/sun/security/krb5/auto/SaslUnbound.java
test/jdk/sun/security/krb5/auto/SpnegoLifeTime.java
test/jdk/sun/security/krb5/auto/SpnegoReqFlags.java
test/jdk/sun/security/krb5/auto/Test5653.java
test/jdk/sun/security/krb5/auto/TicketSName.java
test/jdk/sun/security/krb5/auto/TwoOrThree.java
test/jdk/sun/security/krb5/auto/TwoPrinces.java
test/jdk/sun/security/krb5/auto/TwoTab.java
test/jdk/sun/security/krb5/auto/UnboundSSL.java
test/jdk/sun/security/krb5/auto/UnboundSSLMultipleKeys.java
test/jdk/sun/security/krb5/auto/UnboundSSLPrincipalProperty.java
test/jdk/sun/security/krb5/auto/UnboundService.java
test/jdk/sun/security/krb5/auto/Unreachable.java
test/jdk/sun/security/krb5/auto/UseCacheAndStoreKey.java
test/jdk/sun/security/krb5/auto/W83.java
test/jdk/sun/security/krb5/auto/principalProperty/TestHosts
test/jdk/sun/security/krb5/auto/rcache_usemd5.sh
--- a/test/jdk/sun/security/krb5/auto/AcceptPermissions.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/AcceptPermissions.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 9999999
+ * @bug 8005447 8194486
  * @summary default principal can act as anyone
+ * @library /test/lib
  * @compile -XDignore.symbol.file AcceptPermissions.java
- * @run main/othervm AcceptPermissions two
- * @run main/othervm AcceptPermissions unbound
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AcceptPermissions two
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AcceptPermissions unbound
  */
 
 import java.nio.file.Files;
--- a/test/jdk/sun/security/krb5/auto/AcceptorSubKey.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/AcceptorSubKey.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 7077646
+ * @bug 7077646 8194486
  * @summary gssapi wrap for CFX per-message tokens always set FLAG_ACCEPTOR_SUBKEY
+ * @library /test/lib
  * @compile -XDignore.symbol.file AcceptorSubKey.java
- * @run main/othervm AcceptorSubKey 0
- * @run main/othervm AcceptorSubKey 4
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AcceptorSubKey 0
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AcceptorSubKey 4
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/Addresses.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/Addresses.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8031111
+ * @bug 8031111 8194486
  * @summary fix krb5 caddr
+ * @library /test/lib
  * @compile -XDignore.symbol.file Addresses.java
- * @run main/othervm Addresses
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Addresses
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/AddressesAndNameType.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/AddressesAndNameType.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 4501327 4868379 8039132
- * @run main/othervm AddressesAndNameType 1
- * @run main/othervm AddressesAndNameType 2
- * @run main/othervm AddressesAndNameType 3
+ * @bug 4501327 4868379 8039132 8194486
  * @summary noaddresses settings and server name type
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AddressesAndNameType 1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AddressesAndNameType 2
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AddressesAndNameType 3
  */
 
 import java.net.InetAddress;
--- a/test/jdk/sun/security/krb5/auto/Basic.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/Basic.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7152176
+ * @bug 7152176 8194486
  * @summary More krb5 tests
+ * @library /test/lib
  * @compile -XDignore.symbol.file Basic.java
- * @run main/othervm Basic
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Basic
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/BasicKrb5Test.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/BasicKrb5Test.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,45 +23,57 @@
 
 /*
  * @test
- * @bug 6706974 8014628
+ * @bug 6706974 8014628 8194486
  * @summary Add krb5 test infrastructure
+ * @library /test/lib
  * @compile -XDignore.symbol.file BasicKrb5Test.java
- * @run main/othervm BasicKrb5Test
- * @run main/othervm BasicKrb5Test des-cbc-crc
- * @run main/othervm BasicKrb5Test des-cbc-md5
- * @run main/othervm BasicKrb5Test des3-cbc-sha1
- * @run main/othervm BasicKrb5Test aes128-sha1
- * @run main/othervm BasicKrb5Test aes256-sha1
- * @run main/othervm BasicKrb5Test aes128-sha2
- * @run main/othervm BasicKrb5Test aes256-sha2
- * @run main/othervm BasicKrb5Test rc4-hmac
- * @run main/othervm BasicKrb5Test -s
- * @run main/othervm BasicKrb5Test des-cbc-crc -s
- * @run main/othervm BasicKrb5Test des-cbc-md5 -s
- * @run main/othervm BasicKrb5Test des3-cbc-sha1 -s
- * @run main/othervm BasicKrb5Test aes128-sha1 -s
- * @run main/othervm BasicKrb5Test aes256-sha1 -s
- * @run main/othervm BasicKrb5Test aes128-sha2 -s
- * @run main/othervm BasicKrb5Test aes256-sha2 -s
- * @run main/othervm BasicKrb5Test rc4-hmac -s
- * @run main/othervm BasicKrb5Test -C
- * @run main/othervm BasicKrb5Test des-cbc-crc -C
- * @run main/othervm BasicKrb5Test des-cbc-md5 -C
- * @run main/othervm BasicKrb5Test des3-cbc-sha1 -C
- * @run main/othervm BasicKrb5Test aes128-sha1 -C
- * @run main/othervm BasicKrb5Test aes256-sha1 -C
- * @run main/othervm BasicKrb5Test aes128-sha2 -C
- * @run main/othervm BasicKrb5Test aes256-sha2 -C
- * @run main/othervm BasicKrb5Test rc4-hmac -C
- * @run main/othervm BasicKrb5Test -s -C
- * @run main/othervm BasicKrb5Test des-cbc-crc -s -C
- * @run main/othervm BasicKrb5Test des-cbc-md5 -s -C
- * @run main/othervm BasicKrb5Test des3-cbc-sha1 -s -C
- * @run main/othervm BasicKrb5Test aes128-sha1 -s -C
- * @run main/othervm BasicKrb5Test aes256-sha1 -s -C
- * @run main/othervm BasicKrb5Test aes128-sha2 -s -C
- * @run main/othervm BasicKrb5Test aes256-sha2 -s -C
- * @run main/othervm BasicKrb5Test rc4-hmac -s -C
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-crc
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-md5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des3-cbc-sha1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha2
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha2
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test rc4-hmac
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-crc -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-md5 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des3-cbc-sha1 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha1 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha1 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha2 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha2 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test rc4-hmac -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-crc -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-md5 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des3-cbc-sha1 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha1 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha1 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha2 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha2 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test rc4-hmac -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des-cbc-crc -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des-cbc-md5 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des3-cbc-sha1 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   aes128-sha1 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   aes256-sha1 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   aes128-sha2 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   aes256-sha2 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   rc4-hmac -s -C
  */
 
 import org.ietf.jgss.GSSName;
--- a/test/jdk/sun/security/krb5/auto/BasicProc.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/BasicProc.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,13 @@
 
 /*
  * @test
- * @bug 8009977 8186884
+ * @bug 8009977 8186884 8194486
  * @summary A test to launch multiple Java processes using either Java GSS
  *          or native GSS
- * @library ../../../../java/security/testlibrary/
+ * @library ../../../../java/security/testlibrary/ /test/lib
  * @compile -XDignore.symbol.file BasicProc.java
- * @run main/othervm BasicProc launcher
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicProc launcher
  */
 
 import java.nio.file.Files;
@@ -304,6 +305,7 @@
      */
     private static Proc proc(String lib) throws Exception {
         Proc p = Proc.create("BasicProc")
+                .inheritProp("jdk.net.hosts.file")
                 .prop("java.security.manager", "")
                 .perm(new javax.security.auth.AuthPermission("doAs"));
         if (lib != null) {
--- a/test/jdk/sun/security/krb5/auto/BogusKDC.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/BogusKDC.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,10 +33,12 @@
 
 /*
  * @test
- * @bug 4515853 8075297
+ * @bug 4515853 8075297 8194486
  * @summary Checks that Kerberos client tries slave KDC
  *          if master KDC is not responding
- * @run main/othervm BogusKDC
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BogusKDC
  */
 public class BogusKDC {
 
--- a/test/jdk/sun/security/krb5/auto/CleanState.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/CleanState.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6716534
+ * @bug 6716534 8194486
+ * @summary Krb5LoginModule has not cleaned temp info between authentication attempts
+ * @library /test/lib
  * @compile -XDignore.symbol.file CleanState.java
- * @run main/othervm CleanState
- * @summary Krb5LoginModule has not cleaned temp info between authentication attempts
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts CleanState
  */
 import com.sun.security.auth.module.Krb5LoginModule;
 import java.util.HashMap;
--- a/test/jdk/sun/security/krb5/auto/CrossRealm.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/CrossRealm.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6706974
+ * @bug 6706974 8194486
+ * @summary Add krb5 test infrastructure
+ * @library /test/lib
  * @compile -XDignore.symbol.file CrossRealm.java
- * @run main/othervm CrossRealm
- * @summary Add krb5 test infrastructure
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts CrossRealm
  */
 import java.io.File;
 import java.io.FileOutputStream;
--- a/test/jdk/sun/security/krb5/auto/DiffNameSameKey.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/DiffNameSameKey.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 8005447
+ * @bug 8005447 8194486
  * @summary default principal can act as anyone
+ * @library /test/lib
  * @compile -XDignore.symbol.file DiffNameSameKey.java
- * @run main/othervm/fail DiffNameSameKey a
- * @run main/othervm DiffNameSameKey b
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts DiffNameSameKey a
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DiffNameSameKey b
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/DiffSaltParams.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/DiffSaltParams.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,13 @@
 
 /*
  * @test
- * @bug 8186831
+ * @bug 8186831 8194486
  * @summary Kerberos ignores PA-DATA with a non-null s2kparams
+ * @library /test/lib
  * @compile -XDignore.symbol.file DiffSaltParams.java
- * @run main/othervm -Dsun.security.krb5.debug=true DiffSaltParams
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Dsun.security.krb5.debug=true
+ *      -Djdk.net.hosts.file=TestHosts DiffSaltParams
  */
 
 public class DiffSaltParams {
--- a/test/jdk/sun/security/krb5/auto/DupEtypes.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/DupEtypes.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,14 +23,16 @@
 
 /*
  * @test
- * @bug 7067974
+ * @bug 7067974 8194486
  * @summary multiple ETYPE-INFO-ENTRY with same etype and different salt
+ * @library /test/lib
  * @compile -XDignore.symbol.file DupEtypes.java
- * @run main/othervm DupEtypes 1
- * @run main/othervm DupEtypes 2
- * @run main/othervm/fail DupEtypes 3
- * @run main/othervm DupEtypes 4
- * @run main/othervm DupEtypes 5
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DupEtypes 1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DupEtypes 2
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts DupEtypes 3
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DupEtypes 4
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DupEtypes 5
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/DynamicKeytab.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/DynamicKeytab.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6894072
+ * @bug 6894072 8194486
+ * @summary always refresh keytab
+ * @library /test/lib
  * @compile -XDignore.symbol.file DynamicKeytab.java
- * @run main/othervm DynamicKeytab
- * @summary always refresh keytab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DynamicKeytab
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/EmptyPassword.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/EmptyPassword.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6879540
+ * @bug 6879540 8194486
  * @summary enable empty password for kerberos 5
+ * @library /test/lib
  * @compile -XDignore.symbol.file EmptyPassword.java
- * @run main/othervm EmptyPassword
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts EmptyPassword
  */
 
 public class EmptyPassword {
--- a/test/jdk/sun/security/krb5/auto/FileKeyTab.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/FileKeyTab.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7152121
+ * @bug 7152121 8194486
  * @summary Krb5LoginModule no longer handles keyTabNames with "file:" prefix
+ * @library /test/lib
  * @compile -XDignore.symbol.file FileKeyTab.java
- * @run main/othervm FileKeyTab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts FileKeyTab
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/ForwardableCheck.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/ForwardableCheck.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8022582
+ * @bug 8022582 8194486
  * @summary Relax response flags checking in sun.security.krb5.KrbKdcRep.check.
+ * @library /test/lib
  * @compile -XDignore.symbol.file ForwardableCheck.java
- * @run main/othervm ForwardableCheck
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts ForwardableCheck
  */
 
 import org.ietf.jgss.GSSException;
--- a/test/jdk/sun/security/krb5/auto/Forwarded.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/Forwarded.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8031111
+ * @bug 8031111 8194486
  * @summary fix krb5 caddr
+ * @library /test/lib
  * @compile -XDignore.symbol.file Forwarded.java
- * @run main/othervm Forwarded
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Forwarded
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/GSS.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/GSS.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7152176
+ * @bug 7152176 8194486
  * @summary More krb5 tests
+ * @library /test/lib
  * @compile -XDignore.symbol.file GSS.java
- * @run main/othervm GSS
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts GSS
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/GSSUnbound.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/GSSUnbound.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8001104
+ * @bug 8001104 8194486
  * @summary Unbound SASL service: the GSSAPI/krb5 mech
+ * @library /test/lib
  * @compile -XDignore.symbol.file GSSUnbound.java
- * @run main/othervm GSSUnbound
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts GSSUnbound
  */
 
 import java.security.Security;
--- a/test/jdk/sun/security/krb5/auto/HttpNegotiateServer.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/HttpNegotiateServer.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6578647 6829283 8171340
+ * @bug 6578647 6829283 8171340 8194486
  * @modules java.base/sun.security.util
  *          java.security.jgss/sun.security.krb5.internal:+open
  *          java.security.jgss/sun.security.jgss
@@ -35,11 +35,13 @@
  *          jdk.security.auth
  *          jdk.security.jgss
  *          jdk.httpserver
- * @run main/othervm HttpNegotiateServer
  * @summary Undefined requesting URL in java.net.Authenticator
  *          .getPasswordAuthentication()
  * @summary HTTP/Negotiate: Authenticator triggered again when
  *          user cancels the first one
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts HttpNegotiateServer
  */
 
 import com.sun.net.httpserver.Headers;
--- a/test/jdk/sun/security/krb5/auto/IgnoreChannelBinding.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/IgnoreChannelBinding.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6851973
- * @run main/othervm IgnoreChannelBinding
+ * @bug 6851973 8194486
  * @summary ignore incoming channel binding if acceptor does not set one
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts IgnoreChannelBinding
  */
 
 import java.net.InetAddress;
--- a/test/jdk/sun/security/krb5/auto/KDC.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/KDC.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -241,14 +241,6 @@
         CHECK_ADDRESSES,
     };
 
-    static {
-        if (System.getProperty("jdk.net.hosts.file") == null) {
-            String hostsFileName
-                    = System.getProperty("test.src", ".") + "/TestHosts";
-            System.setProperty("jdk.net.hosts.file", hostsFileName);
-        }
-    }
-
     /**
      * A standalone KDC server.
      */
--- a/test/jdk/sun/security/krb5/auto/KPEquals.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/KPEquals.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8015669
+ * @bug 8015669 8194486
  * @summary KerberosPrincipal::equals should ignore name-type
+ * @library /test/lib
  * @compile -XDignore.symbol.file KPEquals.java
- * @run main/othervm KPEquals
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KPEquals
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/KdcPolicy.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/KdcPolicy.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,10 +38,12 @@
 
 /*
  * @test
- * @bug 8164656 8181461
- * @run main/othervm KdcPolicy udp
- * @run main/othervm KdcPolicy tcp
+ * @bug 8164656 8181461 8194486
  * @summary krb5.kdc.bad.policy test
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KdcPolicy udp
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KdcPolicy tcp
  */
 public class KdcPolicy {
 
--- a/test/jdk/sun/security/krb5/auto/KeyPermissions.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/KeyPermissions.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8004488
+ * @bug 8004488 8194486
  * @summary wrong permissions checked in krb5
+ * @library /test/lib
  * @compile -XDignore.symbol.file KeyPermissions.java
- * @run main/othervm KeyPermissions
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KeyPermissions
  */
 
 import java.security.AccessControlException;
--- a/test/jdk/sun/security/krb5/auto/KeyTabCompat.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/KeyTabCompat.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,12 @@
 
 /*
  * @test
- * @bug 6894072
- * @bug 8004488
+ * @bug 6894072 8004488 8194486
+ * @summary always refresh keytab
+ * @library /test/lib
  * @compile -XDignore.symbol.file KeyTabCompat.java
- * @run main/othervm KeyTabCompat
- * @summary always refresh keytab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KeyTabCompat
  */
 
 import javax.security.auth.kerberos.KerberosKey;
--- a/test/jdk/sun/security/krb5/auto/KrbTicket.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/KrbTicket.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,9 +35,11 @@
 
 /*
  * @test
- * @bug 6857795 8075299
+ * @bug 6857795 8075299 8194486
  * @summary Checks Kerberos ticket properties
- * @run main/othervm KrbTicket
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KrbTicket
  */
 public class KrbTicket {
 
--- a/test/jdk/sun/security/krb5/auto/KvnoNA.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/KvnoNA.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7197159
+ * @bug 7197159 8194486
+ * @summary accept different kvno if there no match
+ * @library /test/lib
  * @compile -XDignore.symbol.file KvnoNA.java
- * @run main/othervm KvnoNA
- * @summary accept different kvno if there no match
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KvnoNA
  */
 
 import org.ietf.jgss.GSSException;
--- a/test/jdk/sun/security/krb5/auto/LifeTimeInSeconds.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/LifeTimeInSeconds.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6857802
- * @run main/othervm LifeTimeInSeconds
+ * @bug 6857802 8194486
  * @summary GSS getRemainingInitLifetime method returns milliseconds not seconds
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts LifeTimeInSeconds
  */
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSManager;
--- a/test/jdk/sun/security/krb5/auto/LoginModuleOptions.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/LoginModuleOptions.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6765491
- * @run main/othervm LoginModuleOptions
+ * @bug 6765491 8194486
  * @summary Krb5LoginModule a little too restrictive, and the doc is not clear.
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts LoginModuleOptions
  */
 import com.sun.security.auth.module.Krb5LoginModule;
 import java.util.HashMap;
--- a/test/jdk/sun/security/krb5/auto/LoginNoPass.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/LoginNoPass.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8028351
+ * @bug 8028351 8194486
  * @summary JWS doesn't get authenticated when using kerberos auth proxy
+ * @library /test/lib
  * @compile -XDignore.symbol.file LoginNoPass.java
- * @run main/othervm LoginNoPass
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts LoginNoPass
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/LongLife.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/LongLife.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8131051
+ * @bug 8131051 8194486
  * @summary KDC might issue a renewable ticket even if not requested
+ * @library /test/lib
  * @compile -XDignore.symbol.file LongLife.java
- * @run main/othervm LongLife
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts LongLife
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/MSOID2.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/MSOID2.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8078439
+ * @bug 8078439 8194486
  * @summary SPNEGO auth fails if client proposes MS krb5 OID
+ * @library /test/lib
  * @compile -XDignore.symbol.file MSOID2.java
- * @run main/othervm MSOID2
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts MSOID2
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/ModuleName.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/ModuleName.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8164437
+ * @bug 8164437 8194486
  * @summary GSSContext type when jdk.security.jgss is not available
  * @library /test/lib
  * @compile -XDignore.symbol.file ModuleName.java
@@ -33,7 +33,8 @@
  *        jdk.test.lib.JDKToolLauncher
  *        jdk.test.lib.Platform
  *        jdk.test.lib.process.*
- * @run main/othervm ModuleName
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts ModuleName
  */
 
 import jdk.test.lib.process.ProcessTools;
@@ -58,6 +59,7 @@
                             arg.startsWith("--add-opens="))
                     .forEach(cmd::add);
             cmd.addAll(List.of(
+                    "-Djdk.net.hosts.file=TestHosts",
                     "-Dtest.src=" + System.getProperty("test.src"),
                     "--add-modules",
                         "java.base,java.security.jgss,jdk.security.auth",
--- a/test/jdk/sun/security/krb5/auto/MoreKvno.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/MoreKvno.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6893158 6907425 7197159
- * @run main/othervm MoreKvno
+ * @bug 6893158 6907425 7197159 8194486
  * @summary AP_REQ check should use key version number
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts MoreKvno
  */
 
 import org.ietf.jgss.GSSException;
--- a/test/jdk/sun/security/krb5/auto/NewInquireTypes.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/NewInquireTypes.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8043071
+ * @bug 8043071 8194486
  * @summary Expose session key and KRB_CRED through extended GSS-API
+ * @library /test/lib
  * @compile -XDignore.symbol.file NewInquireTypes.java
- * @run main/othervm NewInquireTypes
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NewInquireTypes
  */
 
 import com.sun.security.jgss.ExtendedGSSContext;
--- a/test/jdk/sun/security/krb5/auto/NewSalt.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/NewSalt.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 6960894
+ * @bug 6960894 8194486
  * @summary Better AS-REQ creation and processing
- * @run main/othervm NewSalt
- * @run main/othervm -Dnopreauth NewSalt
- * @run main/othervm -Donlyonepreauth NewSalt
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NewSalt
+ * @run main/othervm -Dnopreauth -Djdk.net.hosts.file=TestHosts NewSalt
+ * @run main/othervm -Donlyonepreauth -Djdk.net.hosts.file=TestHosts NewSalt
  */
 
 import java.util.Locale;
--- a/test/jdk/sun/security/krb5/auto/NoInitNoKeytab.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/NoInitNoKeytab.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7089889
+ * @bug 7089889 8194486
  * @summary Krb5LoginModule.login() throws an exception if used without a keytab
+ * @library /test/lib
  * @compile -XDignore.symbol.file NoInitNoKeytab.java
- * @run main/othervm NoInitNoKeytab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NoInitNoKeytab
  */
 
 import java.io.FileOutputStream;
--- a/test/jdk/sun/security/krb5/auto/NonMutualSpnego.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/NonMutualSpnego.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6733095
- * @run main/othervm NonMutualSpnego
+ * @bug 6733095 8194486
  * @summary Failure when SPNEGO request non-Mutual
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NonMutualSpnego
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/NoneReplayCacheTest.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/NoneReplayCacheTest.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,14 @@
 
 /*
  * @test
- * @bug 8001326
- * @run main/othervm NoneReplayCacheTest
+ * @bug 8001326 8194486
  * @summary the replaycache type none cannot stop an authenticator replay,
  * but it can stop a message replay when s.s.k.acceptor.subkey is true.
  * You should not really use none in production environment. This test merely
  * shows there can be other protections when replay cache is not working fine.
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NoneReplayCacheTest
  */
 
 import org.ietf.jgss.GSSException;
--- a/test/jdk/sun/security/krb5/auto/NullRenewUntil.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/NullRenewUntil.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,14 @@
 
 /*
  * @test
- * @bug 8186576
+ * @bug 8186576 8194486
  * @summary KerberosTicket does not properly handle renewable tickets
  *          at the end of their lifetime
  * @library /test/lib
  * @compile -XDignore.symbol.file NullRenewUntil.java
- * @run main/othervm -Dtest.set.null.renew NullRenewUntil
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.set.null.renew NullRenewUntil
  */
 
 import jdk.test.lib.Asserts;
--- a/test/jdk/sun/security/krb5/auto/OkAsDelegate.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/OkAsDelegate.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,29 +23,49 @@
 
 /*
  * @test
- * @bug 6853328 7172701
- * @run main/othervm OkAsDelegate false true true false false false
+ * @bug 6853328 7172701 8194486
+ * @summary Support OK-AS-DELEGATE flag
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
+ *      false true true false false false
  *      FORWARDABLE ticket not allowed, always fail
- * @run main/othervm OkAsDelegate true false false false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
+ *      true false false false false false
  *      Service ticket no OK-AS-DELEGATE. Request nothing, gain nothing
- * @run main/othervm OkAsDelegate true false true false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
+ *      true false true false false false
  *      Service ticket no OK-AS-DELEGATE. Request deleg policy, gain nothing
- * @run main/othervm OkAsDelegate true true false true false true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
+ *      true true false true false true
  *      Service ticket no OK-AS-DELEGATE. Request deleg, granted
- * @run main/othervm OkAsDelegate true true true true false true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      OkAsDelegate true true true true false true
  *      Service ticket no OK-AS-DELEGATE. Request deleg and deleg policy, granted, with info not by policy
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true false true true true true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
+ *      true false true true true true
  *      Service ticket has OK-AS-DELEGATE. Request deleg policy, granted
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true true true true true true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
+ *      true true true true true true
  *      Service ticket has OK-AS-DELEGATE. granted, with info by policy
- * @run main/othervm -Dtest.spnego OkAsDelegate false true true false false false
- * @run main/othervm -Dtest.spnego OkAsDelegate true false false false false false
- * @run main/othervm -Dtest.spnego OkAsDelegate true false true false false false
- * @run main/othervm -Dtest.spnego OkAsDelegate true true false true false true
- * @run main/othervm -Dtest.spnego OkAsDelegate true true true true false true
- * @run main/othervm -Dtest.spnego -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true false true true true true
- * @run main/othervm -Dtest.spnego -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true true true true true true
- * @summary Support OK-AS-DELEGATE flag
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate false true true false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate true false false false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate true false true false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate true true false true false true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate true true true true false true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
+ *      true false true true true true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
+ *      true true true true true true
  */
 import com.sun.security.jgss.ExtendedGSSContext;
 import org.ietf.jgss.GSSContext;
--- a/test/jdk/sun/security/krb5/auto/OkAsDelegateXRealm.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/OkAsDelegateXRealm.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,16 +23,23 @@
 
 /*
  * @test
- * @bug 6853328 7172701
- * @run main/othervm OkAsDelegateXRealm false
+ * @bug 6853328 7172701 8194486
+ * @summary Support OK-AS-DELEGATE flag
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegateXRealm false
  *      KDC no OK-AS-DELEGATE, fail
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegateXRealm true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegateXRealm true
  *      KDC set OK-AS-DELEGATE for all, succeed
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local OkAsDelegateXRealm false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local
+ *      OkAsDelegateXRealm false
  *      KDC set OK-AS-DELEGATE for host/host.r3.local only, fail
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local,krbtgt/R2,krbtgt/R3 OkAsDelegateXRealm true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local,krbtgt/R2,krbtgt/R3
+ *      OkAsDelegateXRealm true
  *      KDC set OK-AS-DELEGATE for all three, succeed
- * @summary Support OK-AS-DELEGATE flag
  */
 import java.io.FileOutputStream;
 import java.io.IOException;
--- a/test/jdk/sun/security/krb5/auto/OnlyDesLogin.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/OnlyDesLogin.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,13 @@
 
 /*
  * @test
- * @bug 8014310
- * @summary JAAS/Krb5LoginModule using des encytypes failure with NPE after JDK-8012679
+ * @bug 8014310 8194486
+ * @summary JAAS/Krb5LoginModule using des encytypes failure with NPE
+ *          after JDK-8012679
+ * @library /test/lib
  * @compile -XDignore.symbol.file OnlyDesLogin.java
- * @run main/othervm OnlyDesLogin
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OnlyDesLogin
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/PrincipalNameEquals.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/PrincipalNameEquals.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7061379
+ * @bug 7061379 8194486
  * @summary [Kerberos] Cross-realm authentication fails, due to nameType problem
+ * @library /test/lib
  * @compile -XDignore.symbol.file PrincipalNameEquals.java
- * @run main/othervm PrincipalNameEquals
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts PrincipalNameEquals
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/RRC.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/RRC.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7077640
+ * @bug 7077640 8194486
  * @summary gss wrap for cfx doesn't handle rrc != 0
+ * @library /test/lib
  * @compile -XDignore.symbol.file RRC.java
- * @run main/othervm RRC
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts RRC
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/RefreshKrb5Config.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/RefreshKrb5Config.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,10 +31,12 @@
 
 /*
  * @test
- * @bug 4745056 8075297
+ * @bug 4745056 8075297 8194486
  * @summary Checks if refreshKrb5Config is set to true for Krb5LoginModule,
  *          then configuration will be refreshed before login() method is called
- * @run main/othervm RefreshKrb5Config
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts RefreshKrb5Config
  */
 public class RefreshKrb5Config {
 
--- a/test/jdk/sun/security/krb5/auto/Renew.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/Renew.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,15 @@
 
 /*
  * @test
- * @bug 8058290
+ * @bug 8058290 8194486
  * @summary JAAS Krb5LoginModule has suspect ticket-renewal logic,
  *          relies on clockskew grace
+ * @library /test/lib
  * @compile -XDignore.symbol.file Renew.java
- * @run main/othervm Renew 1
- * @run main/othervm Renew 2
- * @run main/othervm Renew 3
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Renew 1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Renew 2
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Renew 3
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/Renewal.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/Renewal.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,13 @@
 
 /*
  * @test
- * @bug 8044500
+ * @bug 8044500 8194486
  * @summary Add kinit options and krb5.conf flags that allow users to
  *          obtain renewable tickets and specify ticket lifetimes
- * @library ../../../../java/security/testlibrary/
+ * @library ../../../../java/security/testlibrary/ /test/lib
  * @compile -XDignore.symbol.file Renewal.java
- * @run main/othervm Renewal
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Renewal
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/ReplayCacheTest.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/ReplayCacheTest.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7118809 8001326
- * @run main/othervm ReplayCacheTest jvm
- * @run main/othervm ReplayCacheTest dfl
+ * @bug 7118809 8001326 8194486
  * @summary rcache deadlock
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts ReplayCacheTest jvm
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts ReplayCacheTest dfl
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 7152176 8168518 8172017 8014628
+ * @bug 7152176 8168518 8172017 8014628 8194486
  * @summary More krb5 tests
  * @library ../../../../java/security/testlibrary/ /test/lib
  * @build jdk.test.lib.Platform
- * @run main/othervm/timeout=300 ReplayCacheTestProc
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm/timeout=300 -Djdk.net.hosts.file=TestHosts
+ *      ReplayCacheTestProc
  */
 
 import java.io.*;
@@ -160,6 +162,7 @@
             }
 
             pi = Proc.create("ReplayCacheTestProc").debug("C")
+                    .inheritProp("jdk.net.hosts.file")
                     .args("initiator")
                     .start();
 
@@ -372,9 +375,11 @@
         }
         if (type.startsWith("J")) {
             if (lib == null) {
-                p = Proc.create("ReplayCacheTestProc");
+                p = Proc.create("ReplayCacheTestProc")
+                        .inheritProp("jdk.net.hosts.file");
             } else {
-                p = Proc.create("ReplayCacheTestProc", lib);
+                p = Proc.create("ReplayCacheTestProc", lib)
+                        .inheritProp("jdk.net.hosts.file");
             }
             p.prop("sun.security.krb5.rcache", "dfl")
                     .prop("java.io.tmpdir", cwd);
@@ -387,6 +392,7 @@
                     .env("KRB5_CONFIG", OneKDC.KRB5_CONF)
                     .env("KRB5_KTNAME", OneKDC.KTAB)
                     .env("KRB5RCACHEDIR", cwd)
+                    .inheritProp("jdk.net.hosts.file")
                     .prop("sun.security.jgss.native", "true")
                     .prop("javax.security.auth.useSubjectCredsOnly", "false")
                     .prop("sun.security.nativegss.debug", "true");
--- a/test/jdk/sun/security/krb5/auto/S4U2proxy.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/S4U2proxy.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 6355584 8044215
+ * @bug 6355584 8044215 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2proxy.java
- * @run main/othervm S4U2proxy krb5
- * @run main/othervm S4U2proxy spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts S4U2proxy krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts S4U2proxy spnego
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/S4U2proxyGSS.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/S4U2proxyGSS.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,15 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2proxyGSS.java
- * @run main/othervm -Djavax.security.auth.useSubjectCredsOnly=false S4U2proxyGSS krb5
- * @run main/othervm -Djavax.security.auth.useSubjectCredsOnly=false S4U2proxyGSS spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Djavax.security.auth.useSubjectCredsOnly=false S4U2proxyGSS krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Djavax.security.auth.useSubjectCredsOnly=false S4U2proxyGSS spnego
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/S4U2self.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/S4U2self.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,16 +23,25 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2self.java
- * @run main/othervm -Dsun.security.krb5.debug=false S4U2self krb5 0
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 1
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 2
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 3
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 4
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 5
- * @run main/othervm -Dsun.security.krb5.debug=false S4U2self spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 0
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 1
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 2
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 3
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 4
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self spnego
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/S4U2selfAsServer.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/S4U2selfAsServer.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2selfAsServer.java
- * @run main/othervm S4U2selfAsServer krb5
- * @run main/othervm S4U2selfAsServer spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts S4U2selfAsServer krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts S4U2selfAsServer spnego
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/S4U2selfAsServerGSS.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/S4U2selfAsServerGSS.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,17 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2selfAsServerGSS.java
- * @run main/othervm -Djavax.security.auth.useSubjectCredsOnly=false S4U2selfAsServerGSS krb5
- * @run main/othervm -Djavax.security.auth.useSubjectCredsOnly=false S4U2selfAsServerGSS spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Djavax.security.auth.useSubjectCredsOnly=false
+ *      S4U2selfAsServerGSS krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Djavax.security.auth.useSubjectCredsOnly=false
+ *      S4U2selfAsServerGSS spnego
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/S4U2selfGSS.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/S4U2selfGSS.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,15 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2selfGSS.java
- * @run main/othervm -Dsun.security.krb5.debug=false S4U2selfGSS krb5
- * @run main/othervm -Dsun.security.krb5.debug=false S4U2selfGSS spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2selfGSS krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2selfGSS spnego
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/SPNEGO.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/SPNEGO.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7040151
+ * @bug 7040151 8194486
  * @summary SPNEGO GSS code does not parse tokens in accordance to RFC 2478
+ * @library /test/lib
  * @compile -XDignore.symbol.file SPNEGO.java
- * @run main/othervm SPNEGO
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SPNEGO
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/SSL.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/SSL.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,19 +23,32 @@
 
 /*
  * @test
- * @bug 6894643 6913636 8005523 8025123
+ * @bug 6894643 6913636 8005523 8025123 8194486
  * @summary Test JSSE Kerberos ciphersuite
- * @run main/othervm SSL TLS_KRB5_WITH_RC4_128_SHA
- * @run main/othervm SSL TLS_KRB5_WITH_RC4_128_SHA unbound
- * @run main/othervm SSL TLS_KRB5_WITH_RC4_128_SHA unbound sni
- * @run main/othervm SSL TLS_KRB5_WITH_3DES_EDE_CBC_SHA
- * @run main/othervm SSL TLS_KRB5_WITH_3DES_EDE_CBC_MD5
- * @run main/othervm SSL TLS_KRB5_WITH_DES_CBC_SHA
- * @run main/othervm SSL TLS_KRB5_WITH_DES_CBC_MD5
- * @run main/othervm SSL TLS_KRB5_EXPORT_WITH_RC4_40_SHA
- * @run main/othervm SSL TLS_KRB5_EXPORT_WITH_RC4_40_MD5
- * @run main/othervm SSL TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA
- * @run main/othervm SSL TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_RC4_128_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_RC4_128_SHA unbound
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_RC4_128_SHA unbound sni
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_3DES_EDE_CBC_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_3DES_EDE_CBC_MD5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_DES_CBC_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_DES_CBC_MD5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_EXPORT_WITH_RC4_40_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_EXPORT_WITH_RC4_40_MD5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5
  */
 import java.io.*;
 import java.security.Permission;
--- a/test/jdk/sun/security/krb5/auto/SSLwithPerms.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/SSLwithPerms.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,11 @@
 
 /*
  * @test
- * @bug 8038089
+ * @bug 8038089 8194486
  * @summary TLS optional support for Kerberos cipher suites needs to be re-examined
- * @library ../../../../java/security/testlibrary/
- * @run main/othervm SSLwithPerms
+ * @library ../../../../java/security/testlibrary/ /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSLwithPerms
  */
 import java.io.*;
 import javax.net.ssl.*;
--- a/test/jdk/sun/security/krb5/auto/SaslBasic.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/SaslBasic.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,14 @@
 
 /*
  * @test
- * @bug 7110803 8170732
+ * @bug 7110803 8170732 8194486
  * @summary SASL service for multiple hostnames
+ * @library /test/lib
  * @compile -XDignore.symbol.file SaslBasic.java
- * @run main/othervm SaslBasic bound auth-int
- * @run main/othervm SaslBasic unbound auth-conf
- * @run main/othervm SaslBasic bound auth
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslBasic bound auth-int
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslBasic unbound auth-conf
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslBasic bound auth
  */
 import java.io.IOException;
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/SaslGSS.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/SaslGSS.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 8012082 8019267
+ * @bug 8012082 8019267 8194486
  * @summary SASL: auth-conf negotiated, but unencrypted data is accepted,
   *         reset to unencrypt
+ * @library /test/lib
  * @compile -XDignore.symbol.file SaslGSS.java
- * @run main/othervm SaslGSS
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslGSS
  */
 
 import javax.security.auth.callback.Callback;
--- a/test/jdk/sun/security/krb5/auto/SaslUnbound.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/SaslUnbound.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,14 +23,16 @@
 
 /*
  * @test
- * @bug 8001104
+ * @bug 8001104 8194486
  * @summary Unbound SASL service: the GSSAPI/krb5 mech
+ * @library /test/lib
  * @compile -XDignore.symbol.file SaslUnbound.java
- * @run main/othervm SaslUnbound 0
- * @run main/othervm/fail SaslUnbound 1
- * @run main/othervm/fail SaslUnbound 2
- * @run main/othervm/fail SaslUnbound 3
- * @run main/othervm/fail SaslUnbound 4
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslUnbound 0
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts SaslUnbound 1
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts SaslUnbound 2
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts SaslUnbound 3
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts SaslUnbound 4
  */
 import java.io.IOException;
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/SpnegoLifeTime.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/SpnegoLifeTime.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8000653
+ * @bug 8000653 8194486
  * @summary SPNEGO tests fail at context.getDelegCred().getRemainingInitLifetime(mechOid)
+ * @library /test/lib
  * @compile -XDignore.symbol.file SpnegoLifeTime.java
- * @run main/othervm SpnegoLifeTime
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SpnegoLifeTime
  */
 
 import org.ietf.jgss.Oid;
--- a/test/jdk/sun/security/krb5/auto/SpnegoReqFlags.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/SpnegoReqFlags.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6815182
- * @run main/othervm SpnegoReqFlags
+ * @bug 6815182 8194486
  * @summary GSSAPI/SPNEGO does not work with server using MIT Kerberos library
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SpnegoReqFlags
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/Test5653.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/Test5653.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6895424
- * @run main/othervm Test5653
+ * @bug 6895424 8194486
  * @summary RFC 5653
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Test5653
  */
 
 import org.ietf.jgss.GSSContext;
--- a/test/jdk/sun/security/krb5/auto/TicketSName.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/TicketSName.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,13 @@
 
 /*
  * @test
- * @bug 8178794
+ * @bug 8178794 8194486
  * @summary krb5 client should ignore sname in incoming tickets
+ * @library /test/lib
  * @compile -XDignore.symbol.file TicketSName.java
- * @run main/othervm -Dtest.kdc.diff.sname TicketSName
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.kdc.diff.sname
+ *      TicketSName
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/TwoOrThree.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/TwoOrThree.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,14 +23,16 @@
 
 /*
  * @test
- * @bug 8005447
+ * @bug 8005447 8194486
  * @summary default principal can act as anyone
+ * @library /test/lib
  * @compile -XDignore.symbol.file TwoOrThree.java
- * @run main/othervm TwoOrThree first first
- * @run main/othervm/fail TwoOrThree first second
- * @run main/othervm TwoOrThree - first
- * @run main/othervm TwoOrThree - second
- * @run main/othervm/fail TwoOrThree - third
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoOrThree first first
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts TwoOrThree first second
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoOrThree - first
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoOrThree - second
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts TwoOrThree - third
  */
 
 import java.nio.file.Files;
--- a/test/jdk/sun/security/krb5/auto/TwoPrinces.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/TwoPrinces.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6894072
+ * @bug 6894072 8194486
+ * @summary always refresh keytab
+ * @library /test/lib
  * @compile -XDignore.symbol.file TwoPrinces.java
- * @run main/othervm TwoPrinces
- * @summary always refresh keytab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoPrinces
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/TwoTab.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/TwoTab.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7152176
+ * @bug 7152176 8194486
  * @summary More krb5 tests
+ * @library /test/lib
  * @compile -XDignore.symbol.file TwoTab.java
- * @run main/othervm TwoTab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoTab
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/UnboundSSL.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/UnboundSSL.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,13 +31,15 @@
 
 /*
  * @test
- * @bug 8025123
+ * @bug 8025123 8194486
  * @summary Checks if an unbound server can handle connections
  *          only for allowed service principals
- * @run main/othervm/policy=unbound.ssl.policy UnboundSSL
- *                              unbound.ssl.jaas.conf server_star
- * @run main/othervm/policy=unbound.ssl.policy UnboundSSL
- *                              unbound.ssl.jaas.conf server_multiple_principals
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm/policy=unbound.ssl.policy -Djdk.net.hosts.file=TestHosts
+ *      UnboundSSL unbound.ssl.jaas.conf server_star
+ * @run main/othervm/policy=unbound.ssl.policy -Djdk.net.hosts.file=TestHosts
+ *      UnboundSSL unbound.ssl.jaas.conf server_multiple_principals
  */
 public class UnboundSSL {
 
--- a/test/jdk/sun/security/krb5/auto/UnboundSSLMultipleKeys.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/UnboundSSLMultipleKeys.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,11 +31,13 @@
 
 /*
  * @test
- * @bug 8025123
+ * @bug 8025123 8194486
  * @summary Checks if an unbound server pick up a correct key from keytab
- * @run main/othervm UnboundSSLMultipleKeys
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLMultipleKeys
  *                              unbound.ssl.jaas.conf server_star
- * @run main/othervm UnboundSSLMultipleKeys
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLMultipleKeys
  *                              unbound.ssl.jaas.conf server_multiple_principals
  */
 public class UnboundSSLMultipleKeys {
--- a/test/jdk/sun/security/krb5/auto/UnboundSSLPrincipalProperty.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/UnboundSSLPrincipalProperty.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,12 +30,14 @@
 
 /*
  * @test
- * @bug 8025123
+ * @bug 8025123 8194486
  * @summary Checks if an unbound server uses a service principal
  *          from sun.security.krb5.principal system property if specified
- * @run main/othervm UnboundSSLPrincipalProperty
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLPrincipalProperty
  *                              unbound.ssl.jaas.conf server_star
- * @run main/othervm UnboundSSLPrincipalProperty
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLPrincipalProperty
  *                              unbound.ssl.jaas.conf server_multiple_principals
  */
 public class UnboundSSLPrincipalProperty {
--- a/test/jdk/sun/security/krb5/auto/UnboundService.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/UnboundService.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,17 +23,26 @@
 
 /*
  * @test
- * @bug 8001104
+ * @bug 8001104 8194486
  * @summary Unbound SASL service: the GSSAPI/krb5 mech
+ * @library /test/lib
  * @compile -XDignore.symbol.file UnboundService.java
- * @run main/othervm UnboundService null null
- * @run main/othervm UnboundService server/host.rabbit.hole null
- * @run main/othervm UnboundService server/host.rabbit.hole@RABBIT.HOLE null
- * @run main/othervm/fail UnboundService backend/host.rabbit.hole null
- * @run main/othervm UnboundService null server@host.rabbit.hole
- * @run main/othervm UnboundService server/host.rabbit.hole server@host.rabbit.hole
- * @run main/othervm UnboundService server/host.rabbit.hole@RABBIT.HOLE server@host.rabbit.hole
- * @run main/othervm/fail UnboundService backend/host.rabbit.hole server@host.rabbit.hole
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService null null
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      server/host.rabbit.hole null
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      server/host.rabbit.hole@RABBIT.HOLE null
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts UnboundService
+ *      backend/host.rabbit.hole null
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      null server@host.rabbit.hole
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      server/host.rabbit.hole server@host.rabbit.hole
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      server/host.rabbit.hole@RABBIT.HOLE server@host.rabbit.hole
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts UnboundService
+ *      backend/host.rabbit.hole server@host.rabbit.hole
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/Unreachable.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/Unreachable.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7162687 8015595
+ * @bug 7162687 8015595 8194486
  * @summary enhance KDC server availability detection
+ * @library /test/lib
  * @compile -XDignore.symbol.file Unreachable.java
- * @run main/othervm Unreachable
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Unreachable
  */
 import java.net.PortUnreachableException;
 import java.net.SocketTimeoutException;
--- a/test/jdk/sun/security/krb5/auto/UseCacheAndStoreKey.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/UseCacheAndStoreKey.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 7201053
+ * @bug 7201053 8194486
  * @summary Krb5LoginModule shows NPE when both useTicketCache and storeKey
  *          are set to true
+ * @library /test/lib
  * @compile -XDignore.symbol.file UseCacheAndStoreKey.java
- * @run main/othervm UseCacheAndStoreKey
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UseCacheAndStoreKey
  */
 
 import java.io.FileOutputStream;
--- a/test/jdk/sun/security/krb5/auto/W83.java	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/W83.java	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 6932525 6951366 6959292
+ * @bug 6932525 6951366 6959292 8194486
  * @summary kerberos login failure on win2008 with AD set to win2000 compat mode
  * and cannot login if session key and preauth does not use the same etype
- * @run main/othervm -D6932525 W83
- * @run main/othervm -D6959292 W83
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -D6932525 -Djdk.net.hosts.file=TestHosts W83
+ * @run main/othervm -D6959292 -Djdk.net.hosts.file=TestHosts W83
  */
 import com.sun.security.auth.module.Krb5LoginModule;
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/principalProperty/TestHosts	Thu Jan 25 12:06:00 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-127.0.0.1 localhost
--- a/test/jdk/sun/security/krb5/auto/rcache_usemd5.sh	Thu Jan 25 12:06:00 2018 +0000
+++ b/test/jdk/sun/security/krb5/auto/rcache_usemd5.sh	Thu Jan 25 05:57:22 2018 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,11 +22,13 @@
 #
 
 # @test
-# @bug 8168518
-# @library ../../../../java/security/testlibrary/ /test/lib
-# @build jdk.test.lib.Platform
-# @run main/othervm/timeout=300 -Djdk.krb5.rcache.useMD5=true
-#           -Dtest.service=host ReplayCacheTestProc
+# @bug 8168518 8194486
 # @summary  testing jdk.krb5.rcache.useMD5. This action is put in a separate
 #           test so that ReplayCacheTestProc.java can be launched with special
 #           test.* system properties easily.
+# @library ../../../../java/security/testlibrary/ /test/lib
+# @build jdk.test.lib.Platform
+# @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+# @run main/othervm/timeout=300 -Djdk.krb5.rcache.useMD5=true
+#           -Djdk.net.hosts.file=TestHosts
+#           -Dtest.service=host ReplayCacheTestProc