< prev index next >

test/sun/security/krb5/config/ConfPlusProp.java

Print this page
rev 11886 : 8077102: dns_lookup_realm should be false by default

@@ -33,10 +33,16 @@
 import sun.security.krb5.Config;
 
 public class ConfPlusProp {
     Config config;
     public static void main(String[] args) throws Exception {
+        if (System.getenv("USERDNSDOMAIN") != null ||
+                System.getenv("LOGONSERVER") != null) {
+            System.out.println(
+                    "Looks like a Windows machine in a domain. Skip test.");
+            return;
+        }
         new ConfPlusProp().run();
     }
 
     void refresh() throws Exception {
         Config.refresh();

@@ -88,28 +94,13 @@
         checkDefaultRealm(null);
         check("R1", "k12");
         check("R2", "old");
         check("R3", null);
 
-        int version = System.getProperty("java.version").charAt(2) - '0';
-        System.out.println("JDK version is " + version);
-
-        // Zero-config is supported since 1.7
-        if (version >= 7) {
-            // Point to a non-existing file
-            System.setProperty("java.security.krb5.conf", "i-am-not-a file");
-            refresh();
-
-            // Default realm might come from DNS
-            //checkDefaultRealm(null);
-            check("R1", null);
-            check("R2", null);
-            check("R3", null);
             if (config.get("libdefaults", "forwardable") != null) {
                 throw new Exception("Extra config error");
             }
-        }
 
         // Add prop
         System.setProperty("java.security.krb5.realm", "R2");
         System.setProperty("java.security.krb5.kdc", "k2");
 

@@ -134,18 +125,10 @@
         checkDefaultRealm("R2");
         check("R1", "k12");
         check("R2", "k2");
         check("R3", "k2");
 
-        // Point to a non-existing file
-        System.setProperty("java.security.krb5.conf", "i-am-not-a file");
-        refresh();
-
-        checkDefaultRealm("R2");
-        check("R1", "k2");
-        check("R2", "k2");
-        check("R3", "k2");
         if (config.get("libdefaults", "forwardable") != null) {
             throw new Exception("Extra config error");
         }
     }
 }
< prev index next >