8019410: sun/security/krb5/auto/ReplayCacheTestProc.java
authorweijun
Sat, 13 Jul 2013 08:47:49 +0800
changeset 18826 aba6cde7fafb
parent 18825 06636235cd12
child 18827 ecbd9c8bef12
8019410: sun/security/krb5/auto/ReplayCacheTestProc.java Reviewed-by: mullan
jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java
--- a/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java	Mon Jul 08 15:46:26 2013 -0400
+++ b/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java	Sat Jul 13 08:47:49 2013 +0800
@@ -98,6 +98,14 @@
             kdc.writeKtab(OneKDC.KTAB);
             KDC.saveConfig(OneKDC.KRB5_CONF, kdc);
 
+            if (mode != -1) {
+                // A special native server to check basic sanity
+                if (ns(-1).waitFor() != 0) {
+                    Proc.d("Native mode sanity check failed, revert to java");
+                    mode = -1;
+                }
+            }
+
             pc = Proc.create("ReplayCacheTestProc").debug("C")
                     .args("client")
                     .start();
@@ -164,6 +172,11 @@
                         result[i].csize);
             }
             if (!finalOut) throw new Exception();
+        } else if (args[0].equals("N-1")) {
+            // Native mode sanity check
+            Proc.d("Detect start");
+            Context s = Context.fromUserKtab("*", OneKDC.KTAB, true);
+            s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
         } else if (args[0].equals("client")) {
             while (true) {
                 String title = Proc.textIn();