8169751: sun/security/krb5/auto/rcache_usemd5.sh fails on solaris
authorweijun
Wed, 16 Nov 2016 12:55:42 +0800
changeset 42108 1542d48cebeb
parent 42107 34cb644a6c91
child 42109 f7a57d034f22
child 42149 38bea40bb09b
8169751: sun/security/krb5/auto/rcache_usemd5.sh fails on solaris Reviewed-by: xuelei
jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java
jdk/test/sun/security/krb5/auto/rcache_usemd5.sh
--- a/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java	Wed Nov 09 13:37:19 2016 +0100
+++ b/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java	Wed Nov 16 12:55:42 2016 +0800
@@ -74,6 +74,13 @@
     private static List<Req> reqs = new ArrayList<>();
     private static String HOST = "localhost";
 
+    private static final String SERVICE;
+
+    static {
+        String tmp = System.getProperty("test.service");
+        SERVICE = (tmp == null) ? "service" : tmp;
+    }
+
     // Where should the rcache be saved. It seems KRB5RCACHEDIR is not
     // recognized on Solaris. Maybe version too low? I see 1.6.
     private static String cwd =
@@ -322,12 +329,12 @@
 
     // returns the service name
     private static String service(int p) {
-        return "service" + p + "/" + HOST;
+        return SERVICE + p + "/" + HOST;
     }
 
     // returns the dfl name for a service
     private static String dfl(int p) {
-        return "service" + p + (uid == -1 ? "" : ("_"+uid));
+        return SERVICE + p + (uid == -1 ? "" : ("_"+uid));
     }
 
     // generates an ap-req and save into reqs, returns the index
@@ -454,8 +461,8 @@
             actual = Boolean.valueOf(reply);
             csize = csize(r.service);
 
-            String label = String.format("%03d-CLIENT%d-SERVICE%d-%s-%s",
-                    i, r.client, r.service, acceptor.debug(), actual);
+            String label = String.format("%03d-client%d-%s%d-%s-%s",
+                    i, r.client, SERVICE, r.service, acceptor.debug(), actual);
 
             record(label, r);
             if (new File(cwd, dfl(r.service)).exists()) {
--- a/jdk/test/sun/security/krb5/auto/rcache_usemd5.sh	Wed Nov 09 13:37:19 2016 +0100
+++ b/jdk/test/sun/security/krb5/auto/rcache_usemd5.sh	Wed Nov 16 12:55:42 2016 +0800
@@ -24,7 +24,8 @@
 # @test
 # @bug 8168518
 # @library ../../../../java/security/testlibrary/ /test/lib
-# @run main/othervm/timeout=300 -Djdk.krb5.rcache.useMD5=true ReplayCacheTestProc
+# @run main/othervm/timeout=300 -Djdk.krb5.rcache.useMD5=true
+#           -Dtest.service=host ReplayCacheTestProc
 # @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.