# HG changeset patch # User weijun # Date 1479272142 -28800 # Node ID 1542d48cebebda57292bcf2038f1d553cc17ad45 # Parent 34cb644a6c91c86875d3678c42cc917818242f12 8169751: sun/security/krb5/auto/rcache_usemd5.sh fails on solaris Reviewed-by: xuelei diff -r 34cb644a6c91 -r 1542d48cebeb jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java --- 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 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()) { diff -r 34cb644a6c91 -r 1542d48cebeb jdk/test/sun/security/krb5/auto/rcache_usemd5.sh --- 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.