changeset 51464:d96e6839e83d

Merge
author mikael
date Mon, 20 Aug 2018 14:19:30 -0700
parents df1012f6ba94 f729ca27cf9a
children e4ba2cfcfa92
files .hgtags make/conf/jib-profiles.js src/hotspot/cpu/x86/macroAssembler_x86.cpp src/hotspot/cpu/x86/macroAssembler_x86.hpp src/java.base/share/lib/security/cacerts test/hotspot/jtreg/ProblemList-graal.txt test/jdk/ProblemList.txt test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libfreebl3.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnspr4.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnss3.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnssckbi.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnssdbm3.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnssutil3.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libplc4.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libplds4.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libsoftokn3.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libsqlite3.dylib test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libssl3.dylib test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/freebl3.chk test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/freebl3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nspr4.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nspr4.lib test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nss3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nss3.lib test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssckbi.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssdbm3.chk test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssdbm3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssutil3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssutil3.lib test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/plc4.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/plc4.lib test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/plds4.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/plds4.lib test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/softokn3.chk test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/softokn3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/sqlite3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/ssl3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/ssl3.lib test/jdk/sun/security/pkcs11/nss/lib/windows-i586/freebl3.chk test/jdk/sun/security/pkcs11/nss/lib/windows-i586/freebl3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nspr4.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nspr4.lib test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nss3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nss3.lib test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssckbi.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssdbm3.chk test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssdbm3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssutil3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssutil3.lib test/jdk/sun/security/pkcs11/nss/lib/windows-i586/plc4.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/plc4.lib test/jdk/sun/security/pkcs11/nss/lib/windows-i586/plds4.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/plds4.lib test/jdk/sun/security/pkcs11/nss/lib/windows-i586/softokn3.chk test/jdk/sun/security/pkcs11/nss/lib/windows-i586/softokn3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/sqlite3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/ssl3.dll test/jdk/sun/security/pkcs11/nss/lib/windows-i586/ssl3.lib
diffstat 146 files changed, 1165 insertions(+), 664 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Aug 20 11:37:57 2018 -0700
+++ b/.hgtags	Mon Aug 20 14:19:30 2018 -0700
@@ -500,6 +500,7 @@
 ea900a7dc7d77dee30865c60eabd87fc24b1037c jdk-11+24
 331888ea4a788df801b1edf8836646cd25fc758b jdk-11+25
 945ba9278a272a5477ffb1b3ea1b04174fed8036 jdk-11+26
+9d7d74c6f2cbe522e39fa22dc557fdd3f79b32ad jdk-11+27
 69b438908512d3dfef5852c6a843a5778333a309 jdk-12+2
 990db216e7199b2ba9989d8fa20b657e0ca7d969 jdk-12+3
 499b873761d8e8a1cc4aa649daf04cbe98cbce77 jdk-12+4
--- a/make/conf/jib-profiles.js	Mon Aug 20 11:37:57 2018 -0700
+++ b/make/conf/jib-profiles.js	Mon Aug 20 14:19:30 2018 -0700
@@ -1171,7 +1171,7 @@
         args = concat(args,
                       // This needs to be changed when we start building release candidates
                       // with-version-pre must be set to ea for 'ea' and empty for fcs build
-                      "--with-version-pre=ea",
+                      "--with-version-pre=",
                       "--without-version-opt");
     } else {
         args = concat(args, "--with-version-opt=" + common.build_id);
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Mon Aug 20 11:37:57 2018 -0700
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Mon Aug 20 14:19:30 2018 -0700
@@ -3123,6 +3123,16 @@
   }
 }
 
+void MacroAssembler::push_zmm(XMMRegister reg) {
+  lea(rsp, Address(rsp, -64)); // Use lea to not affect flags
+  evmovdqul(Address(rsp, 0), reg, Assembler::AVX_512bit);
+}
+
+void MacroAssembler::pop_zmm(XMMRegister reg) {
+  evmovdqul(reg, Address(rsp, 0), Assembler::AVX_512bit);
+  lea(rsp, Address(rsp, 64)); // Use lea to not affect flags
+}
+
 void MacroAssembler::fremr(Register tmp) {
   save_rax(tmp);
   { Label L;
@@ -3848,33 +3858,25 @@
   } else if ((dst_enc < 16) && (src_enc < 16)) {
     Assembler::pcmpeqb(dst, src);
   } else if (src_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::pcmpeqb(xmm0, src);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   } else if (dst_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::pcmpeqb(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-  } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    pop_zmm(xmm0);
+  } else {
+    push_zmm(xmm0);
+    push_zmm(xmm1);
     movdqu(xmm0, src);
     movdqu(xmm1, dst);
     Assembler::pcmpeqb(xmm1, xmm0);
     movdqu(dst, xmm1);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
+    pop_zmm(xmm0);
   }
 }
 
@@ -3886,33 +3888,25 @@
   } else if ((dst_enc < 16) && (src_enc < 16)) {
     Assembler::pcmpeqw(dst, src);
   } else if (src_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::pcmpeqw(xmm0, src);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   } else if (dst_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::pcmpeqw(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-  } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    pop_zmm(xmm0);
+  } else {
+    push_zmm(xmm0);
+    push_zmm(xmm1);
     movdqu(xmm0, src);
     movdqu(xmm1, dst);
     Assembler::pcmpeqw(xmm1, xmm0);
     movdqu(dst, xmm1);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
+    pop_zmm(xmm0);
   }
 }
 
@@ -3921,13 +3915,11 @@
   if (dst_enc < 16) {
     Assembler::pcmpestri(dst, src, imm8);
   } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::pcmpestri(xmm0, src, imm8);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   }
 }
 
@@ -3937,33 +3929,25 @@
   if ((dst_enc < 16) && (src_enc < 16)) {
     Assembler::pcmpestri(dst, src, imm8);
   } else if (src_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::pcmpestri(xmm0, src, imm8);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   } else if (dst_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::pcmpestri(dst, xmm0, imm8);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-  } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    pop_zmm(xmm0);
+  } else {
+    push_zmm(xmm0);
+    push_zmm(xmm1);
     movdqu(xmm0, src);
     movdqu(xmm1, dst);
     Assembler::pcmpestri(xmm1, xmm0, imm8);
     movdqu(dst, xmm1);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
+    pop_zmm(xmm0);
   }
 }
 
@@ -3975,33 +3959,25 @@
   } else if ((dst_enc < 16) && (src_enc < 16)) {
     Assembler::pmovzxbw(dst, src);
   } else if (src_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::pmovzxbw(xmm0, src);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   } else if (dst_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::pmovzxbw(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-  } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    pop_zmm(xmm0);
+  } else {
+    push_zmm(xmm0);
+    push_zmm(xmm1);
     movdqu(xmm0, src);
     movdqu(xmm1, dst);
     Assembler::pmovzxbw(xmm1, xmm0);
     movdqu(dst, xmm1);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4012,13 +3988,11 @@
   } else if (dst_enc < 16) {
     Assembler::pmovzxbw(dst, src);
   } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::pmovzxbw(xmm0, src);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4027,12 +4001,10 @@
   if (src_enc < 16) {
     Assembler::pmovmskb(dst, src);
   } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::pmovmskb(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4042,31 +4014,23 @@
   if ((dst_enc < 16) && (src_enc < 16)) {
     Assembler::ptest(dst, src);
   } else if (src_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::ptest(xmm0, src);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   } else if (dst_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::ptest(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-  } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    pop_zmm(xmm0);
+  } else {
+    push_zmm(xmm0);
+    push_zmm(xmm1);
     movdqu(xmm0, src);
     movdqu(xmm1, dst);
     Assembler::ptest(xmm1, xmm0);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4221,13 +4185,11 @@
       evmovdqul(dst, xmm0, Assembler::AVX_512bit);
       evmovdqul(xmm0, src, Assembler::AVX_512bit);
     } else {
-      subptr(rsp, 64);
-      evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+      push_zmm(xmm0);
       evmovdqul(xmm0, nds, Assembler::AVX_512bit);
       vandps(xmm0, xmm0, negate_field, vector_len);
       evmovdqul(dst, xmm0, Assembler::AVX_512bit);
-      evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-      addptr(rsp, 64);
+      pop_zmm(xmm0);
     }
   }
 }
@@ -4258,13 +4220,11 @@
       evmovdqul(dst, xmm0, Assembler::AVX_512bit);
       evmovdqul(xmm0, src, Assembler::AVX_512bit);
     } else {
-      subptr(rsp, 64);
-      evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+      push_zmm(xmm0);
       evmovdqul(xmm0, nds, Assembler::AVX_512bit);
       vandpd(xmm0, xmm0, negate_field, vector_len);
       evmovdqul(dst, xmm0, Assembler::AVX_512bit);
-      evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-      addptr(rsp, 64);
+      pop_zmm(xmm0);
     }
   }
 }
@@ -4294,16 +4254,14 @@
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
   } else {
     // worse case scenario, all regs are in the upper bank
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    push_zmm(xmm1);
     evmovdqul(nds, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm1, src, Assembler::AVX_512bit);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vpaddb(xmm0, xmm0, xmm1, vector_len);
     evmovdqul(dst, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
   }
 }
 
@@ -4353,16 +4311,14 @@
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
   } else {
     // worse case scenario, all regs are in the upper bank
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    push_zmm(xmm1);
     evmovdqul(nds, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm1, src, Assembler::AVX_512bit);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vpaddw(xmm0, xmm0, xmm1, vector_len);
     evmovdqul(dst, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
   }
 }
 
@@ -4404,33 +4360,25 @@
   } else if ((dst_enc < 16) && (src_enc < 16)) {
     Assembler::vpbroadcastw(dst, src);
   } else if (src_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vpbroadcastw(xmm0, src);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   } else if (dst_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::vpbroadcastw(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-  } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    pop_zmm(xmm0);
+  } else {
+    push_zmm(xmm0);
+    push_zmm(xmm1);
     movdqu(xmm0, src);
     movdqu(xmm1, dst);
     Assembler::vpbroadcastw(xmm1, xmm0);
     movdqu(dst, xmm1);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4442,33 +4390,25 @@
   if ((dst_enc < 16) && (src_enc < 16)) {
     Assembler::vpcmpeqb(dst, nds, src, vector_len);
   } else if (src_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vpcmpeqb(xmm0, xmm0, src, vector_len);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   } else if (dst_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::vpcmpeqb(dst, dst, xmm0, vector_len);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-  } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    pop_zmm(xmm0);
+  } else {
+    push_zmm(xmm0);
+    push_zmm(xmm1);
     movdqu(xmm0, src);
     movdqu(xmm1, dst);
     Assembler::vpcmpeqb(xmm1, xmm1, xmm0, vector_len);
     movdqu(dst, xmm1);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4480,33 +4420,25 @@
   if ((dst_enc < 16) && (src_enc < 16)) {
     Assembler::vpcmpeqw(dst, nds, src, vector_len);
   } else if (src_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vpcmpeqw(xmm0, xmm0, src, vector_len);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   } else if (dst_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::vpcmpeqw(dst, dst, xmm0, vector_len);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-  } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    pop_zmm(xmm0);
+  } else {
+    push_zmm(xmm0);
+    push_zmm(xmm1);
     movdqu(xmm0, src);
     movdqu(xmm1, dst);
     Assembler::vpcmpeqw(xmm1, xmm1, xmm0, vector_len);
     movdqu(dst, xmm1);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4517,13 +4449,11 @@
   } else if (dst_enc < 16) {
     Assembler::vpmovzxbw(dst, src, vector_len);
   } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vpmovzxbw(xmm0, src, vector_len);
     movdqu(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4532,12 +4462,10 @@
   if (src_enc < 16) {
     Assembler::vpmovmskb(dst, src);
   } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::vpmovmskb(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4566,16 +4494,14 @@
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
   } else {
     // worse case scenario, all regs are in the upper bank
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    push_zmm(xmm1);
     evmovdqul(nds, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm1, src, Assembler::AVX_512bit);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vpmullw(xmm0, xmm0, xmm1, vector_len);
     evmovdqul(dst, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
   }
 }
 
@@ -4625,16 +4551,14 @@
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
   } else {
     // worse case scenario, all regs are in the upper bank
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    push_zmm(xmm1);
     evmovdqul(nds, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm1, src, Assembler::AVX_512bit);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vpsubb(xmm0, xmm0, xmm1, vector_len);
     evmovdqul(dst, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
   }
 }
 
@@ -4684,16 +4608,14 @@
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
   } else {
     // worse case scenario, all regs are in the upper bank
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    push_zmm(xmm1);
     evmovdqul(nds, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm1, src, Assembler::AVX_512bit);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vpsubw(xmm0, xmm0, xmm1, vector_len);
     evmovdqul(dst, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
   }
 }
 
@@ -4751,8 +4673,7 @@
     evmovdqul(dst, nds, Assembler::AVX_512bit);
   } else {
     // worse case scenario, all regs are in the upper bank
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    push_zmm(xmm1);
     evmovdqul(nds, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm1, shift, Assembler::AVX_512bit);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
@@ -4760,8 +4681,7 @@
     evmovdqul(xmm1, dst, Assembler::AVX_512bit);
     evmovdqul(dst, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
   }
 }
 
@@ -4819,8 +4739,7 @@
     evmovdqul(dst, nds, Assembler::AVX_512bit);
   } else {
     // worse case scenario, all regs are in the upper bank
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    push_zmm(xmm1);
     evmovdqul(nds, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm1, shift, Assembler::AVX_512bit);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
@@ -4828,8 +4747,7 @@
     evmovdqul(xmm1, dst, Assembler::AVX_512bit);
     evmovdqul(dst, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
   }
 }
 
@@ -4887,8 +4805,7 @@
     evmovdqul(dst, nds, Assembler::AVX_512bit);
   } else {
     // worse case scenario, all regs are in the upper bank
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    push_zmm(xmm1);
     evmovdqul(nds, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm1, shift, Assembler::AVX_512bit);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
@@ -4896,8 +4813,7 @@
     evmovdqul(xmm1, dst, Assembler::AVX_512bit);
     evmovdqul(dst, xmm0, Assembler::AVX_512bit);
     evmovdqul(xmm0, nds, Assembler::AVX_512bit);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
   }
 }
 
@@ -4928,31 +4844,23 @@
   if ((dst_enc < 16) && (src_enc < 16)) {
     Assembler::vptest(dst, src);
   } else if (src_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, dst, Assembler::AVX_512bit);
     Assembler::vptest(xmm0, src);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm0);
   } else if (dst_enc < 16) {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+    push_zmm(xmm0);
     evmovdqul(xmm0, src, Assembler::AVX_512bit);
     Assembler::vptest(dst, xmm0);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-  } else {
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-    subptr(rsp, 64);
-    evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+    pop_zmm(xmm0);
+  } else {
+    push_zmm(xmm0);
+    push_zmm(xmm1);
     movdqu(xmm0, src);
     movdqu(xmm1, dst);
     Assembler::vptest(xmm1, xmm0);
-    evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
-    evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-    addptr(rsp, 64);
+    pop_zmm(xmm1);
+    pop_zmm(xmm0);
   }
 }
 
@@ -4966,45 +4874,35 @@
       if (dst_enc < 16) {
         Assembler::punpcklbw(dst, src);
       } else {
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+        push_zmm(xmm0);
         evmovdqul(xmm0, dst, Assembler::AVX_512bit);
         Assembler::punpcklbw(xmm0, xmm0);
         evmovdqul(dst, xmm0, Assembler::AVX_512bit);
-        evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
+        pop_zmm(xmm0);
       }
     } else {
       if ((src_enc < 16) && (dst_enc < 16)) {
         Assembler::punpcklbw(dst, src);
       } else if (src_enc < 16) {
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+        push_zmm(xmm0);
         evmovdqul(xmm0, dst, Assembler::AVX_512bit);
         Assembler::punpcklbw(xmm0, src);
         evmovdqul(dst, xmm0, Assembler::AVX_512bit);
-        evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
+        pop_zmm(xmm0);
       } else if (dst_enc < 16) {
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+        push_zmm(xmm0);
         evmovdqul(xmm0, src, Assembler::AVX_512bit);
         Assembler::punpcklbw(dst, xmm0);
-        evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
+        pop_zmm(xmm0);
       } else {
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+        push_zmm(xmm0);
+        push_zmm(xmm1);
         evmovdqul(xmm0, dst, Assembler::AVX_512bit);
         evmovdqul(xmm1, src, Assembler::AVX_512bit);
         Assembler::punpcklbw(xmm0, xmm1);
         evmovdqul(dst, xmm0, Assembler::AVX_512bit);
-        evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
-        evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
+        pop_zmm(xmm1);
+        pop_zmm(xmm0);
       }
     }
   } else {
@@ -5020,12 +4918,10 @@
     if (dst_enc < 16) {
       Assembler::pshufd(dst, src, mode);
     } else {
-      subptr(rsp, 64);
-      evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+      push_zmm(xmm0);
       Assembler::pshufd(xmm0, src, mode);
       evmovdqul(dst, xmm0, Assembler::AVX_512bit);
-      evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-      addptr(rsp, 64);
+      pop_zmm(xmm0);
     }
   }
 }
@@ -5040,45 +4936,35 @@
       if (dst_enc < 16) {
         Assembler::pshuflw(dst, src, mode);
       } else {
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+        push_zmm(xmm0);
         evmovdqul(xmm0, dst, Assembler::AVX_512bit);
         Assembler::pshuflw(xmm0, xmm0, mode);
         evmovdqul(dst, xmm0, Assembler::AVX_512bit);
-        evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
+        pop_zmm(xmm0);
       }
     } else {
       if ((src_enc < 16) && (dst_enc < 16)) {
         Assembler::pshuflw(dst, src, mode);
       } else if (src_enc < 16) {
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+        push_zmm(xmm0);
         evmovdqul(xmm0, dst, Assembler::AVX_512bit);
         Assembler::pshuflw(xmm0, src, mode);
         evmovdqul(dst, xmm0, Assembler::AVX_512bit);
-        evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
+        pop_zmm(xmm0);
       } else if (dst_enc < 16) {
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+        push_zmm(xmm0);
         evmovdqul(xmm0, src, Assembler::AVX_512bit);
         Assembler::pshuflw(dst, xmm0, mode);
-        evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
+        pop_zmm(xmm0);
       } else {
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
-        subptr(rsp, 64);
-        evmovdqul(Address(rsp, 0), xmm1, Assembler::AVX_512bit);
+        push_zmm(xmm0);
+        push_zmm(xmm1);
         evmovdqul(xmm0, dst, Assembler::AVX_512bit);
         evmovdqul(xmm1, src, Assembler::AVX_512bit);
         Assembler::pshuflw(xmm0, xmm1, mode);
         evmovdqul(dst, xmm0, Assembler::AVX_512bit);
-        evmovdqul(xmm1, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
-        evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-        addptr(rsp, 64);
+        pop_zmm(xmm1);
+        pop_zmm(xmm0);
       }
     }
   } else {
@@ -5166,13 +5052,11 @@
   if (VM_Version::supports_avx512novl() &&
       (nds_upper_bank || dst_upper_bank)) {
     if (dst_upper_bank) {
-      subptr(rsp, 64);
-      evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+      push_zmm(xmm0);
       movflt(xmm0, nds);
       vxorps(xmm0, xmm0, src, Assembler::AVX_128bit);
       movflt(dst, xmm0);
-      evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-      addptr(rsp, 64);
+      pop_zmm(xmm0);
     } else {
       movflt(dst, nds);
       vxorps(dst, dst, src, Assembler::AVX_128bit);
@@ -5190,13 +5074,11 @@
   if (VM_Version::supports_avx512novl() &&
       (nds_upper_bank || dst_upper_bank)) {
     if (dst_upper_bank) {
-      subptr(rsp, 64);
-      evmovdqul(Address(rsp, 0), xmm0, Assembler::AVX_512bit);
+      push_zmm(xmm0);
       movdbl(xmm0, nds);
       vxorpd(xmm0, xmm0, src, Assembler::AVX_128bit);
       movdbl(dst, xmm0);
-      evmovdqul(xmm0, Address(rsp, 0), Assembler::AVX_512bit);
-      addptr(rsp, 64);
+      pop_zmm(xmm0);
     } else {
       movdbl(dst, nds);
       vxorpd(dst, dst, src, Assembler::AVX_128bit);
--- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Mon Aug 20 11:37:57 2018 -0700
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Mon Aug 20 14:19:30 2018 -0700
@@ -482,6 +482,10 @@
   // from register xmm0. Otherwise, the value is stored from the FPU stack.
   void store_double(Address dst);
 
+  // Save/restore ZMM (512bit) register on stack.
+  void push_zmm(XMMRegister reg);
+  void pop_zmm(XMMRegister reg);
+
   // pushes double TOS element of FPU stack on CPU stack; pops from FPU stack
   void push_fTOS();
 
--- a/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java	Mon Aug 20 14:19:30 2018 -0700
@@ -38,8 +38,7 @@
  * @since   1.4.1
  */
 enum ProtocolVersion {
-//    TLS13           (0x0304,    "TLSv1.3",      false),
-    TLS13           (SSLConfiguration.tls13VN,    "TLSv1.3",      false),
+    TLS13           (0x0304,    "TLSv1.3",      false),
     TLS12           (0x0303,    "TLSv1.2",      false),
     TLS11           (0x0302,    "TLSv1.1",      false),
     TLS10           (0x0301,    "TLSv1",        false),
--- a/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java	Mon Aug 20 14:19:30 2018 -0700
@@ -100,10 +100,6 @@
     static final boolean acknowledgeCloseNotify  = Utilities.getBooleanProperty(
             "jdk.tls.acknowledgeCloseNotify", false);
 
-// TODO: Please remove after TLS 1.3 draft interop testing
-// delete me
-static int tls13VN;
-
     // Is the extended_master_secret extension supported?
     static {
         boolean supportExtendedMasterSecret = Utilities.getBooleanProperty(
@@ -116,21 +112,6 @@
             }
         }
         useExtendedMasterSecret = supportExtendedMasterSecret;
-
-// delete me
-try {
-    tls13VN =
-        AccessController.doPrivileged(
-            new PrivilegedExceptionAction<Integer>() {
-                @Override
-                public Integer run() throws Exception {
-                    return Integer.parseInt(
-                        System.getProperty("jdk.tls13.version", "0304"), 16);
-                }
-            });
-} catch (PrivilegedActionException ex) {
-    // blank
-}
     }
 
     SSLConfiguration(SSLContextImpl sslContext, boolean isClientMode) {
Binary file src/java.base/share/lib/security/cacerts has changed
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, 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
@@ -25,15 +25,63 @@
 
 package com.apple.laf;
 
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.ImageIcon;
+import javax.swing.JRadioButton;
+import javax.swing.Icon;
+import javax.swing.AbstractButton;
+import javax.swing.AbstractAction;
+import javax.swing.KeyStroke;
+import javax.swing.DefaultButtonModel;
+import javax.swing.ButtonGroup;
+import javax.swing.ButtonModel;
 import javax.swing.plaf.ComponentUI;
 
-import apple.laf.JRSUIConstants.*;
+import java.awt.Component;
+import java.awt.AWTKeyStroke;
+import java.awt.KeyboardFocusManager;
 
-import com.apple.laf.AquaUtilControlSize.*;
-import com.apple.laf.AquaUtils.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.KeyEvent;
+
+import apple.laf.JRSUIConstants.Widget;
+import com.apple.laf.AquaUtilControlSize.SizeVariant;
+import com.apple.laf.AquaUtilControlSize.SizeDescriptor;
+import com.apple.laf.AquaUtils.RecyclableSingleton;
+import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Enumeration;
 
 public class AquaButtonRadioUI extends AquaButtonLabeledUI {
+    private KeyListener keyListener = null;
+
+    @SuppressWarnings("serial")
+    private class SelectPreviousBtn extends AbstractAction {
+        public SelectPreviousBtn() {
+            super("Previous");
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            AquaButtonRadioUI.this.selectRadioButton(e, false);
+        }
+    }
+
+    @SuppressWarnings("serial")
+    private class SelectNextBtn extends AbstractAction {
+        public SelectNextBtn() {
+            super("Next");
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            AquaButtonRadioUI.this.selectRadioButton(e, true);
+        }
+    }
+
     private static final RecyclableSingleton<AquaButtonRadioUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaButtonRadioUI>(AquaButtonRadioUI.class);
     private static final RecyclableSingleton<ImageIcon> sizingIcon = new RecyclableSingleton<ImageIcon>() {
         protected ImageIcon getInstance() {
@@ -45,7 +93,7 @@
         return instance.get();
     }
 
-    public static Icon getSizingRadioButtonIcon(){
+    public static Icon getSizingRadioButtonIcon() {
         return sizingIcon.get();
     }
 
@@ -67,4 +115,269 @@
             super(other);
         }
     }
+
+    private KeyListener createKeyListener() {
+        if (keyListener == null) {
+            keyListener = new KeyHandler();
+        }
+
+        return keyListener;
+    }
+
+    private boolean isValidRadioButtonObj(Object obj) {
+        return ((obj instanceof JRadioButton) &&
+                    ((JRadioButton)obj).isVisible() &&
+                    ((JRadioButton)obj).isEnabled());
+    }
+
+    @Override
+    protected void installListeners(AbstractButton button) {
+        super.installListeners(button);
+
+        //Only for JRadioButton
+        if (!(button instanceof JRadioButton))
+            return;
+
+        keyListener = createKeyListener();
+        button.addKeyListener(keyListener);
+
+        button.setFocusTraversalKeysEnabled(false);
+
+        button.getActionMap().put("Previous", new SelectPreviousBtn());
+        button.getActionMap().put("Next", new SelectNextBtn());
+
+        button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
+            put(KeyStroke.getKeyStroke("UP"), "Previous");
+        button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
+            put(KeyStroke.getKeyStroke("DOWN"), "Next");
+        button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
+            put(KeyStroke.getKeyStroke("LEFT"), "Previous");
+        button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
+            put(KeyStroke.getKeyStroke("RIGHT"), "Next");
+    }
+
+    @Override
+    protected void uninstallListeners(AbstractButton button) {
+        super.uninstallListeners(button);
+
+        //Only for JRadioButton
+        if (!(button instanceof JRadioButton))
+            return;
+
+        //Unmap actions from the arrow keys.
+        button.getActionMap().remove("Previous");
+        button.getActionMap().remove("Next");
+
+        button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
+            remove(KeyStroke.getKeyStroke("UP"));
+        button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
+            remove(KeyStroke.getKeyStroke("DOWN"));
+        button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
+            remove(KeyStroke.getKeyStroke("LEFT"));
+        button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
+            remove(KeyStroke.getKeyStroke("RIGHT"));
+
+        if (keyListener != null ) {
+            button.removeKeyListener(keyListener);
+            keyListener = null;
+        }
+    }
+
+    /**
+     * Select radio button based on "Previous" or "Next" operation
+     *
+     * @param event, the event object.
+     * @param next, indicate if it's next one
+     */
+    private void selectRadioButton(ActionEvent event, boolean next) {
+        Object eventSrc = event.getSource();
+
+        //Check whether the source is JRadioButton, if so, whether it is visible
+        if (!isValidRadioButtonObj(eventSrc))
+            return;
+
+        ButtonGroupInfo btnGroupInfo = new ButtonGroupInfo((JRadioButton)eventSrc);
+        btnGroupInfo.selectNewButton(next);
+    }
+
+    /**
+     * ButtonGroupInfo, used to get related info in button group
+     * for given radio button.
+     */
+    private class ButtonGroupInfo {
+        JRadioButton activeBtn = null;
+
+        JRadioButton firstBtn = null;
+        JRadioButton lastBtn = null;
+
+        JRadioButton previousBtn = null;
+        JRadioButton nextBtn = null;
+
+        HashSet<JRadioButton> btnsInGroup = null;
+        boolean srcFound = false;
+
+        public ButtonGroupInfo(JRadioButton btn) {
+            activeBtn = btn;
+            btnsInGroup = new HashSet<JRadioButton>();
+        }
+
+        //Check if given object is in the button group
+        boolean containsInGroup(Object obj) {
+            return btnsInGroup.contains(obj);
+        }
+
+        //Check if the next object to gain focus belongs
+        //to the button group or not
+        Component getFocusTransferBaseComponent(boolean next) {
+            return firstBtn;
+        }
+
+        boolean getButtonGroupInfo() {
+            if (activeBtn == null)
+                return false;
+
+            btnsInGroup.clear();
+
+            //Get the button model from ths source.
+            ButtonModel model = activeBtn.getModel();
+            if (!(model instanceof DefaultButtonModel))
+                return false;
+
+            // If the button model is DefaultButtonModel, and use it, otherwise return.
+            DefaultButtonModel bm = (DefaultButtonModel) model;
+
+            //get the ButtonGroup of the button from the button model
+            ButtonGroup group = bm.getGroup();
+            if (group == null)
+                return false;
+
+            Enumeration<AbstractButton> e = group.getElements();
+            if (e == null)
+                return false;
+
+            while (e.hasMoreElements()) {
+                AbstractButton curElement = e.nextElement();
+                if (!isValidRadioButtonObj(curElement))
+                    continue;
+
+                btnsInGroup.add((JRadioButton) curElement);
+
+                // If firstBtn is not set yet, curElement is that first button
+                if (null == firstBtn)
+                    firstBtn = (JRadioButton)curElement;
+
+                if (activeBtn == curElement)
+                    srcFound = true;
+                else if (!srcFound) {
+                    //The source has not been yet found and the current element
+                    // is the last previousBtn
+                    previousBtn = (JRadioButton) curElement;
+                } else if (nextBtn == null) {
+                    //The source has been found and the current element
+                    //is the next valid button of the list
+                    nextBtn = (JRadioButton) curElement;
+                }
+
+                //Set new last "valid" JRadioButton of the list
+                lastBtn = (JRadioButton)curElement;
+            }
+
+            return true;
+        }
+
+        /**
+         * Find the new radio button that focus needs to be
+         * moved to in the group, select the button
+         *
+         * @param next, indicate if it's arrow up/left or down/right
+         */
+        void selectNewButton(boolean next) {
+            if (!getButtonGroupInfo())
+                return;
+
+            if (srcFound) {
+                JRadioButton newSelectedBtn = null;
+                if (next) {
+                    //Select Next button. Cycle to the first button if the source
+                    //button is the last of the group.
+                    newSelectedBtn = (null == nextBtn) ? firstBtn : nextBtn;
+                } else {
+                    //Select previous button. Cycle to the last button if the source
+                    //button is the first button of the group.
+                    newSelectedBtn = (null == previousBtn) ? lastBtn: previousBtn;
+                }
+                if (newSelectedBtn != null && newSelectedBtn != activeBtn) {
+                    newSelectedBtn.requestFocusInWindow();
+                    newSelectedBtn.setSelected(true);
+                }
+            }
+        }
+
+        /**
+         * Find the button group the passed in JRadioButton belongs to, and
+         * move focus to next component of the last button in the group
+         * or previous compoennt of first button
+         *
+         * @param next, indicate if jump to next component or previous
+         */
+        void jumpToNextComponent(boolean next) {
+            if (!getButtonGroupInfo()) {
+                //In case the button does not belong to any group, it needs
+                //to be treated as a component
+                if (activeBtn != null) {
+                    lastBtn = activeBtn;
+                    firstBtn = activeBtn;
+                } else
+                    return;
+            }
+
+            //If next component in the parent window is not in the button
+            //group, current active button will be base, otherwise, the base
+            // will be first or last button in the button group
+            Component focusBase = getFocusTransferBaseComponent(next);
+            if (focusBase != null) {
+                if (next) {
+                    KeyboardFocusManager.
+                        getCurrentKeyboardFocusManager().focusNextComponent(focusBase);
+                } else {
+                    KeyboardFocusManager.
+                        getCurrentKeyboardFocusManager().focusPreviousComponent(focusBase);
+                }
+            }
+        }
+    }
+
+    /**
+     * Radiobutton KeyListener
+     */
+    private class KeyHandler implements KeyListener {
+        //This listener checks if the key event is a focus traversal key event
+        // on a radio button, consume the event if so and move the focus
+        // to next/previous component
+        @Override
+        public void keyPressed(KeyEvent e) {
+            AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e);
+            if (stroke != null && e.getSource() instanceof JRadioButton) {
+                JRadioButton source = (JRadioButton) e.getSource();
+                boolean next = isFocusTraversalKey(source,
+                                KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, stroke);
+                if (next || isFocusTraversalKey(source,
+                                KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, stroke)) {
+                                    e.consume();
+                                    ButtonGroupInfo btnGroupInfo = new ButtonGroupInfo(source);
+                                    btnGroupInfo.jumpToNextComponent(next);
+                }
+            }
+        }
+
+        private boolean isFocusTraversalKey(JComponent c, int id,
+                                                AWTKeyStroke stroke) {
+            Set<AWTKeyStroke> keys = c.getFocusTraversalKeys(id);
+            return keys != null && keys.contains(stroke);
+        }
+
+        @Override public void keyReleased(KeyEvent e) {}
+
+        @Override public void keyTyped(KeyEvent e) {}
+    }
 }
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Mon Aug 20 14:19:30 2018 -0700
@@ -378,7 +378,7 @@
 
         // Either java.awt.Frame or java.awt.Dialog can be resizable, however java.awt.Window is never resizable
         {
-            final boolean resizable = isTargetResizable() && isNativelyFocusableWindow();
+            final boolean resizable = isFrame ? ((Frame)target).isResizable() : (isDialog ? ((Dialog)target).isResizable() : false);
             styleBits = SET(styleBits, RESIZABLE, resizable);
             if (!resizable) {
                 styleBits = SET(styleBits, ZOOMABLE, false);
@@ -482,16 +482,6 @@
         return styleBits;
     }
 
-    private boolean isTargetResizable() {
-        if (target instanceof Frame) {
-            return ((Frame)target).isResizable();
-        } else if (target instanceof Dialog) {
-            return ((Dialog)target).isResizable();
-        }
-
-        return false;
-    }
-
     // this is the counter-point to -[CWindow _nativeSetStyleBit:]
     private void setStyleBits(final int mask, final boolean value) {
         execute(ptr -> nativeSetNSWindowStyleBits(ptr, mask, value ? mask : 0));
@@ -686,9 +676,10 @@
         // Manage the extended state when showing
         if (visible) {
             /* Frame or Dialog should be set property WINDOW_FULLSCREENABLE to true if the
-            Frame or Dialog is resizable and focusable.
+            Frame or Dialog is resizable.
             **/
-            final boolean resizable = isTargetResizable() && isNativelyFocusableWindow();
+            final boolean resizable = (target instanceof Frame) ? ((Frame)target).isResizable() :
+            ((target instanceof Dialog) ? ((Dialog)target).isResizable() : false);
             if (resizable) {
                 setCanFullscreen(true);
             }
@@ -823,10 +814,9 @@
 
     @Override
     public void setResizable(final boolean resizable) {
-        final boolean windowResizable = resizable && isNativelyFocusableWindow();
-        setCanFullscreen(windowResizable);
-        setStyleBits(RESIZABLE, windowResizable);
-        setStyleBits(ZOOMABLE, windowResizable);
+        setCanFullscreen(resizable);
+        setStyleBits(RESIZABLE, resizable);
+        setStyleBits(ZOOMABLE, resizable);
     }
 
     @Override
@@ -868,8 +858,8 @@
 
     @Override
     public void updateFocusableWindowState() {
-        setStyleBits(SHOULD_BECOME_KEY | SHOULD_BECOME_MAIN | RESIZABLE,
-                (isNativelyFocusableWindow() && isTargetResizable()));
+        final boolean isFocusable = isNativelyFocusableWindow();
+        setStyleBits(SHOULD_BECOME_KEY | SHOULD_BECOME_MAIN, isFocusable); // set both bits at once
     }
 
     @Override
--- a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java	Mon Aug 20 14:19:30 2018 -0700
@@ -40,6 +40,7 @@
 import java.net.http.HttpHeaders;
 import java.net.http.HttpResponse;
 import jdk.internal.net.http.ResponseContent.BodyParser;
+import jdk.internal.net.http.ResponseContent.UnknownLengthBodyParser;
 import jdk.internal.net.http.common.Log;
 import jdk.internal.net.http.common.Logger;
 import jdk.internal.net.http.common.MinimalFuture;
@@ -67,6 +68,7 @@
     private final BodyReader bodyReader; // used to read the body
     private final Http1AsyncReceiver asyncReceiver;
     private volatile EOFException eof;
+    private volatile BodyParser bodyParser;
     // max number of bytes of (fixed length) body to ignore on redirect
     private final static int MAX_IGNORE = 1024;
 
@@ -230,6 +232,10 @@
         return finished;
     }
 
+    /**
+     * Return known fixed content length or -1 if chunked, or -2 if no content-length
+     * information in which case, connection termination delimits the response body
+     */
     int fixupContentLen(int clen) {
         if (request.method().equalsIgnoreCase("HEAD") || responseCode == HTTP_NOT_MODIFIED) {
             return 0;
@@ -239,7 +245,11 @@
                        .equalsIgnoreCase("chunked")) {
                 return -1;
             }
-            return 0;
+            if (responseCode == 101) {
+                // this is a h2c or websocket upgrade, contentlength must be zero
+                return 0;
+            }
+            return -2;
         }
         return clen;
     }
@@ -401,7 +411,7 @@
                 // to prevent the SelectorManager thread from exiting until
                 // the body is fully read.
                 refCountTracker.acquire();
-                bodyReader.start(content.getBodyParser(
+                bodyParser = content.getBodyParser(
                     (t) -> {
                         try {
                             if (t != null) {
@@ -417,7 +427,8 @@
                                 connection.close();
                             }
                         }
-                    }));
+                    });
+                bodyReader.start(bodyParser);
                 CompletableFuture<State> bodyReaderCF = bodyReader.completion();
                 asyncReceiver.subscribe(bodyReader);
                 assert bodyReaderCF != null : "parsing not started";
@@ -723,6 +734,11 @@
 
         @Override
         public final void onReadError(Throwable t) {
+            if (t instanceof EOFException && bodyParser != null &&
+                    bodyParser instanceof UnknownLengthBodyParser) {
+                ((UnknownLengthBodyParser)bodyParser).complete();
+                return;
+            }
             t = wrapWithExtraDetail(t, parser::currentStateMessage);
             Http1Response.this.onReadError(t);
         }
--- a/src/java.net.http/share/classes/jdk/internal/net/http/ResponseContent.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/ResponseContent.java	Mon Aug 20 14:19:30 2018 -0700
@@ -75,6 +75,12 @@
         if (chunkedContentInitialized) {
             return chunkedContent;
         }
+        if (contentLength == -2) {
+            // HTTP/1.0 content
+            chunkedContentInitialized = true;
+            chunkedContent = false;
+            return chunkedContent;
+        }
         if (contentLength == -1) {
             String tc = headers.firstValue("Transfer-Encoding")
                                .orElse("");
@@ -111,7 +117,9 @@
         if (contentChunked()) {
             return new ChunkedBodyParser(onComplete);
         } else {
-            return new FixedLengthBodyParser(contentLength, onComplete);
+            return contentLength == -2
+                ? new UnknownLengthBodyParser(onComplete)
+                : new FixedLengthBodyParser(contentLength, onComplete);
         }
     }
 
@@ -392,6 +400,79 @@
 
     }
 
+    class UnknownLengthBodyParser implements BodyParser {
+        final Consumer<Throwable> onComplete;
+        final Logger debug = Utils.getDebugLogger(this::dbgString, Utils.DEBUG);
+        final String dbgTag = ResponseContent.this.dbgTag + "/UnknownLengthBodyParser";
+        volatile Throwable closedExceptionally;
+        volatile AbstractSubscription sub;
+        volatile int breceived = 0;
+
+        UnknownLengthBodyParser(Consumer<Throwable> onComplete) {
+            this.onComplete = onComplete;
+        }
+
+        String dbgString() {
+            return dbgTag;
+        }
+
+        @Override
+        public void onSubscribe(AbstractSubscription sub) {
+            if (debug.on())
+                debug.log("onSubscribe: " + pusher.getClass().getName());
+            pusher.onSubscribe(this.sub = sub);
+        }
+
+        @Override
+        public String currentStateMessage() {
+            return format("http1_0 content, bytes received: %d", breceived);
+        }
+
+        @Override
+        public void accept(ByteBuffer b) {
+            if (closedExceptionally != null) {
+                if (debug.on())
+                    debug.log("already closed: " + closedExceptionally);
+                return;
+            }
+            boolean completed = false;
+            try {
+                if (debug.on())
+                    debug.log("Parser got %d bytes ", b.remaining());
+
+                if (b.hasRemaining()) {
+                    // only reduce demand if we actually push something.
+                    // we would not have come here if there was no
+                    // demand.
+                    boolean hasDemand = sub.demand().tryDecrement();
+                    assert hasDemand;
+                    breceived += b.remaining();
+                    pusher.onNext(List.of(b.asReadOnlyBuffer()));
+                }
+            } catch (Throwable t) {
+                if (debug.on()) debug.log("Unexpected exception", t);
+                closedExceptionally = t;
+                if (!completed) {
+                    onComplete.accept(t);
+                }
+            }
+        }
+
+        /**
+         * Must be called externally when connection has closed
+         * and therefore no more bytes can be read
+         */
+        public void complete() {
+            // We're done! All data has been received.
+            if (debug.on())
+                debug.log("Parser got all expected bytes: completing");
+            assert closedExceptionally == null;
+            onFinished.run();
+            pusher.onComplete();
+            onComplete.accept(closedExceptionally); // should be null
+        }
+    }
+
     class FixedLengthBodyParser implements BodyParser {
         final int contentLength;
         final Consumer<Throwable> onComplete;
--- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -55,7 +55,8 @@
         Properties osProperty = Utils.getProperties(osName);
         try {
             ActionHelper helper = new ActionHelper(workdir, "config", osProperty, jdks);
-            return new ToolKit(helper, log, osName, "common");
+            // os-specific action set must be last, b/c they can kill the process
+            return new ToolKit(helper, log, "common", osName);
         } catch (InvalidValueException e) {
             throw new IllegalStateException("can't create tool kit", e);
         }
--- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -56,9 +56,6 @@
         pids.add(pid);
         for (Long p = pids.poll(); p != null; p = pids.poll()) {
             HtmlSection pidSection = section.createChildren("" + p);
-            for (ActionSet set : actions) {
-                set.gatherProcessInfo(pidSection, p);
-            }
             List<Long> children = helper.getChildren(pidSection, p);
             if (!children.isEmpty()) {
                 HtmlSection s = pidSection.createChildren("children");
@@ -67,6 +64,9 @@
                 }
                 pids.addAll(children);
             }
+            for (ActionSet set : actions) {
+                set.gatherProcessInfo(pidSection, p);
+            }
         }
     }
 }
--- a/test/failure_handler/src/share/conf/linux.properties	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/failure_handler/src/share/conf/linux.properties	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -52,9 +52,9 @@
 native.stack.args.delimiter=\0
 native.stack.params.repeat=6
 
-native.core.app=gcore
-native.core.args=-o ./core.%p %p
-native.core.params.timeout=3600000
+# has to be the last command
+native.core.app=kill
+native.core.args=-ABRT %p
 ################################################################################
 # environment info to gather
 ################################################################################
--- a/test/failure_handler/src/share/conf/mac.properties	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/failure_handler/src/share/conf/mac.properties	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -61,11 +61,9 @@
 native.stack.params.repeat=6
 native.stack.args=-c\0DevToolsSecurity --status | grep -q enabled && lldb -o 'attach %p' -o 'thread backtrace all' -o 'detach' -o 'quit'
 
-native.core.app=bash
-native.core.delimiter=\0
-native.core.args=-c\0gcore -o ./core.%p %p || \
-  (DevToolsSecurity --status | grep -q enabled && lldb --batch -o 'attach %p' -o 'process save-core core.%p' -o 'detach' -o 'quit')
-native.core.params.timeout=3600000
+# has to be the last command
+native.core.app=kill
+native.core.args=-ABRT %p
 ################################################################################
 # environment info to gather
 ################################################################################
--- a/test/failure_handler/src/share/conf/solaris.properties	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/failure_handler/src/share/conf/solaris.properties	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -51,9 +51,9 @@
 native.stack.args=-F %p
 native.stack.params.repeat=6
 
-native.core.app=gcore
-native.core.args=-F -o ./core %p
-native.core.params.timeout=3600000
+# has to be the last command
+native.core.app=kill
+native.core.args=-ABRT %p
 ################################################################################
 # environment info to gather
 ################################################################################
--- a/test/hotspot/jtreg/ProblemList-graal.txt	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/hotspot/jtreg/ProblemList-graal.txt	Mon Aug 20 14:19:30 2018 -0700
@@ -62,8 +62,6 @@
 gc/g1/plab/TestPLABPromotion.java                               8191048   generic-all
 gc/g1/plab/TestPLABResize.java                                  8191048   generic-all
 
-gc/TestNUMAPageSize.java                                        8194949   generic-all
-
 compiler/compilercontrol/directives/LogTest.java                8181753   generic-all
 
 gc/parallel/TestPrintGCDetailsVerbose.java                      8200186   macosx-all
--- a/test/jdk/ProblemList.txt	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/ProblemList.txt	Mon Aug 20 14:19:30 2018 -0700
@@ -147,7 +147,7 @@
 java/awt/EventQueue/6980209/bug6980209.java 8198615 macosx-all
 java/awt/Frame/ExceptionOnSetExtendedStateTest/ExceptionOnSetExtendedStateTest.java 8198237 macosx-all
 java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java 8144030 macosx-all
-java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java 7158623 macosx-all
+java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java 8208290 macosx-all
 java/awt/grab/EmbeddedFrameTest1/EmbeddedFrameTest1.java 7080150 macosx-all
 java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java 8168646 generic-all
 java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java 8198623 macosx-all
@@ -639,7 +639,7 @@
 sun/security/pkcs11/KeyGenerator/DESParity.java                 8204203 windows-all
 sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java          8204203 windows-all
 sun/security/pkcs11/KeyPairGenerator/TestDH2048.java            8204203 windows-all
-sun/security/pkcs11/KeyStore/SecretKeysBasic.sh                 8204203 windows-all
+sun/security/pkcs11/KeyStore/SecretKeysBasic.sh                 8204203,8209398 generic-all
 sun/security/pkcs11/Mac/MacKAT.java                             8204203 windows-all
 sun/security/pkcs11/Mac/MacSameTest.java                        8204203 windows-all
 sun/security/pkcs11/Mac/ReinitMac.java                          8204203 windows-all
--- a/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java	Mon Aug 20 14:19:30 2018 -0700
@@ -24,7 +24,7 @@
 /*
   @test
   @key headful
-  @bug 4980161 7158623 8204860
+  @bug 4980161 7158623 8204860 8208125
   @summary Setting focusable window state to false makes the maximized frame resizable
   @compile UnfocusableMaximizedFrameResizablity.java
   @run main UnfocusableMaximizedFrameResizablity
@@ -36,13 +36,10 @@
 import java.awt.AWTException;
 import java.awt.event.InputEvent;
 import java.awt.Robot;
-import javax.swing.JFrame;
-import javax.swing.SwingUtilities;
 
 public class UnfocusableMaximizedFrameResizablity {
 
     private static Frame frame;
-    private static JFrame jframe;
     private static Robot robot;
     private static boolean isProgInterruption = false;
     private static Thread mainThread = null;
@@ -55,65 +52,13 @@
             return;
         }
 
-        //Case 1: Setting frame resizable to true followed by focusable to false
-        frame = createFrame("Resizable Unfocusable frame");
-        frame.setResizable(true);
-        frame.setFocusableWindowState(false);
-        tryToResizeFrame(frame);
-
-        //Case 2: Setting frame focusable to false followed by resizable to true
-        frame = createFrame("Unfocusable Resizable frame");
-        frame.setFocusableWindowState(false);
-        frame.setResizable(true);
-        tryToResizeFrame(frame);
-
-        //Case 3: Testing JFrame fullscreen behaviour only on Mac OS
-        if (System.getProperty("os.name").toLowerCase().startsWith("mac")) {
-            SwingUtilities.invokeAndWait(new Runnable() {
-
-                Override
-                public void run() {
-                    jframe = createJFrame("Unfocusable Resizable JFrame");
-                    jframe.setFocusableWindowState(false);
-                    jframe.setResizable(true);
-                    Object prop1 = jframe.getRootPane().getClientProperty("apple.awt.fullscreenable");
-                    jframe.setVisible(false);
-                    jframe.setVisible(true);
-                    Object prop2 = jframe.getRootPane().getClientProperty("apple.awt.fullscreenable");
-
-                    if((prop1 != null && prop2 != null) && (!prop1.equals(prop2))) {
-                        jframe.dispose();
-                        cleanup();
-                        throw new RuntimeException("Non-focusable resizable JFrame is fullscreenable!!");
-                    }
-                }
-            });
-        }
-
-        cleanup();
-    }
-
-    private static JFrame createJFrame(String title) {
-        JFrame jframe = new JFrame(title);
-        jframe.setMaximizedBounds(new Rectangle(0, 0, 300, 300));
-        jframe.setSize(200, 200);
-        jframe.setVisible(true);
-        jframe.setExtendedState(Frame.MAXIMIZED_BOTH);
-
-        return jframe;
-    }
-
-    private static Frame createFrame(String title) {
-        Frame frame = new Frame(title);
+        frame = new Frame("Unfocusable frame");
         frame.setMaximizedBounds(new Rectangle(0, 0, 300, 300));
         frame.setSize(200, 200);
         frame.setVisible(true);
         frame.setExtendedState(Frame.MAXIMIZED_BOTH);
+        frame.setFocusableWindowState(false);
 
-        return frame;
-    }
-
-    private static void tryToResizeFrame(Frame frame) {
         try {
             robot = new Robot();
         } catch (AWTException e) {
@@ -144,11 +89,11 @@
             cleanup();
             throw new RuntimeException("The maximized unfocusable frame can be resized.");
         }
-
-        frame.dispose();
+        cleanup();
     }
 
     private static void cleanup() {
+        frame.dispose();
         isProgInterruption = true;
         mainThread.interrupt();
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java	Mon Aug 20 14:19:30 2018 -0700
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.URI;
+import java.net.SocketTimeoutException;
+import java.time.Duration;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ServerSocketFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLParameters;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import jdk.testlibrary.SimpleSSLContext;
+
+/**
+ * @test
+ * @bug 8207966
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.SimpleSSLContext
+ * @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest plain false
+ * @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest SSL false
+ * @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest plain true
+ * @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest SSL true
+ */
+
+public class UnknownBodyLengthTest {
+    static final byte[] BUF = new byte[32 * 10234 + 2];
+
+    volatile SSLContext ctx;
+    volatile ServerSocketFactory factory;
+    volatile String clientURL;
+    volatile int port;
+    final ServerSocket ss;
+
+    UnknownBodyLengthTest(boolean useSSL) throws Exception {
+        ctx = new SimpleSSLContext().get();
+        SSLContext.setDefault(ctx);
+        factory = useSSL ? SSLServerSocketFactory.getDefault()
+                         : ServerSocketFactory.getDefault();
+        ss = factory.createServerSocket();
+        ss.setReuseAddress(true);
+        ss.bind(new InetSocketAddress("127.0.0.1", 0));
+        System.out.println("ServerSocket = " + ss.getClass() + " " + ss);
+        port = ss.getLocalPort();
+        clientURL = (useSSL ? "https" : "http") + "://localhost:"
+            + Integer.toString(port) + "/test";
+    }
+
+    static void fillBuf(byte[] buf) {
+        for (int i=0; i<buf.length; i++)
+            buf[i] = (byte)i;
+    }
+
+    static void checkBuf(byte[] buf) {
+        if (buf.length != BUF.length)
+            throw new RuntimeException("buffer lengths not the same");
+        for (int i=0; i<buf.length; i++)
+            if (buf[i] != BUF[i])
+                throw new RuntimeException("error at position " + i);
+    }
+
+    void server(final boolean withContentLength) {
+        fillBuf(BUF);
+        try {
+            Socket s = ss.accept();
+            s.setTcpNoDelay(true);
+            s.setSoLinger(true, 1);
+            System.out.println("Accepted: "+s.getRemoteSocketAddress());
+            System.out.println("Accepted: "+s);
+            OutputStream os = s.getOutputStream();
+            InputStream is = s.getInputStream();
+            boolean done = false;
+            byte[] buf = new byte[1024];
+            String rsp = "";
+            while (!done) {
+                int c = is.read(buf);
+                if (c < 0) break;
+                String s1 = new String(buf, 0, c, "ISO-8859-1");
+                rsp += s1;
+                done = rsp.endsWith("!#!#");
+            }
+            String r = "HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Type:" +
+                       " text/xml; charset=UTF-8\r\n";
+            os.write(r.getBytes());
+            String chdr = "Content-Length: " + Integer.toString(BUF.length) +
+                     "\r\n";
+            System.out.println(chdr);
+            if(withContentLength)
+                os.write(chdr.getBytes());
+            os.write("\r\n".getBytes());
+            os.write(BUF);
+            if (is.available() > 0)
+                is.read(buf);
+            os.flush();
+            os.close();
+            s.shutdownOutput();
+            s.close();
+        } catch(final Throwable t) {
+          t.printStackTrace();
+        } finally {
+            try {ss.close(); } catch (Exception e) {}
+        }
+    }
+
+    void client(boolean useSSL) throws Exception {
+        SSLContext ctx = SSLContext.getDefault();
+        HttpClient.Builder clientB = HttpClient.newBuilder()
+            .version(HttpClient.Version.HTTP_2);
+        if (useSSL) {
+            clientB = clientB.sslContext(ctx)
+                .sslParameters(ctx.getSupportedSSLParameters());
+        }
+        final HttpClient client = clientB.build();
+
+        System.out.println("URL: " + clientURL);
+        final HttpResponse<byte[]> response = client
+            .send(HttpRequest
+                .newBuilder(new URI(clientURL))
+                .timeout(Duration.ofMillis(120_000))
+                .POST(HttpRequest.BodyPublishers.ofString("body!#!#"))
+                .build(), HttpResponse.BodyHandlers.ofByteArray());
+
+        System.out.println("Received reply: " + response.statusCode());
+        byte[] bb = response.body();
+        checkBuf(bb);
+    }
+
+    public static void main(final String[] args) throws Exception {
+        boolean ssl = args[0].equals("SSL");
+        boolean fixedlen = args[1].equals("true");
+        UnknownBodyLengthTest test = new UnknownBodyLengthTest(ssl);
+        test.run(ssl, fixedlen);
+    }
+
+    public void run(boolean ssl, boolean fixedlen) throws Exception {
+        new Thread(()->server(fixedlen)).start();
+        client(ssl);
+    }
+}
--- a/test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, 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
@@ -26,7 +26,7 @@
  * @key headful
  * @library ../../regtesthelpers
  * @build Util
- * @bug 8033699 8154043 8167160
+ * @bug 8033699 8154043 8167160 8208640
  * @summary  Incorrect radio button behavior when pressing tab key
  * @run main bug8033699
  */
@@ -59,12 +59,9 @@
     private static JRadioButton radioBtnSingle;
 
     public static void main(String args[]) throws Throwable {
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
+        SwingUtilities.invokeAndWait(() -> {
                 changeLAF();
                 createAndShowGUI();
-            }
         });
 
         robot = new Robot();
@@ -96,19 +93,14 @@
         // down key circle back to first button in grouped radio button
         runTest8();
 
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                mainFrame.dispose();
-            }
-        });
+        SwingUtilities.invokeAndWait(() -> mainFrame.dispose());
     }
 
     private static void changeLAF() {
         String currentLAF = UIManager.getLookAndFeel().toString();
         System.out.println(currentLAF);
         currentLAF = currentLAF.toLowerCase();
-        if (currentLAF.contains("aqua") || currentLAF.contains("nimbus")) {
+        if (currentLAF.contains("nimbus")) {
             try {
                 UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
             } catch (Exception ex) {
@@ -167,13 +159,10 @@
         hitKey(robot, KeyEvent.VK_TAB);
         hitKey(robot, KeyEvent.VK_TAB);
 
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtnSingle) {
-                    System.out.println("Radio Button Group Go To Next Component through Tab Key failed");
-                    throw new RuntimeException("Focus is not on Radio Button Single as Expected");
-                }
+        SwingUtilities.invokeAndWait(() -> {
+            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtnSingle) {
+                System.out.println("Radio Button Group Go To Next Component through Tab Key failed");
+                throw new RuntimeException("Focus is not on Radio Button Single as Expected");
             }
         });
     }
@@ -181,13 +170,10 @@
     // Non-Grouped Radio button as a single component when traversing through tab key
     private static void runTest2() throws Exception {
         hitKey(robot, KeyEvent.VK_TAB);
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != btnEnd) {
-                    System.out.println("Non Grouped Radio Button Go To Next Component through Tab Key failed");
-                    throw new RuntimeException("Focus is not on Button End as Expected");
-                }
+        SwingUtilities.invokeAndWait(() -> {
+            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != btnEnd) {
+                System.out.println("Non Grouped Radio Button Go To Next Component through Tab Key failed");
+                throw new RuntimeException("Focus is not on Button End as Expected");
             }
         });
     }
@@ -197,13 +183,10 @@
         hitKey(robot, KeyEvent.VK_SHIFT, KeyEvent.VK_TAB);
         hitKey(robot, KeyEvent.VK_SHIFT, KeyEvent.VK_TAB);
         hitKey(robot, KeyEvent.VK_SHIFT, KeyEvent.VK_TAB);
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtn1) {
-                    System.out.println("Radio button Group/Non Grouped Radio Button SHIFT-Tab Key Test failed");
-                    throw new RuntimeException("Focus is not on Radio Button A as Expected");
-                }
+        SwingUtilities.invokeAndWait(() -> {
+            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtn1) {
+                System.out.println("Radio button Group/Non Grouped Radio Button SHIFT-Tab Key Test failed");
+                throw new RuntimeException("Focus is not on Radio Button A as Expected");
             }
         });
     }
@@ -212,13 +195,10 @@
     private static void runTest4() throws Exception {
         hitKey(robot, KeyEvent.VK_DOWN);
         hitKey(robot, KeyEvent.VK_RIGHT);
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtn3) {
-                    System.out.println("Radio button Group UP/LEFT Arrow Key Move Focus Failed");
-                    throw new RuntimeException("Focus is not on Radio Button C as Expected");
-                }
+        SwingUtilities.invokeAndWait(() -> {
+            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtn3) {
+                System.out.println("Radio button Group UP/LEFT Arrow Key Move Focus Failed");
+                throw new RuntimeException("Focus is not on Radio Button C as Expected");
             }
         });
     }
@@ -226,13 +206,10 @@
     private static void runTest5() throws Exception {
         hitKey(robot, KeyEvent.VK_UP);
         hitKey(robot, KeyEvent.VK_LEFT);
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtn1) {
-                    System.out.println("Radio button Group Left/Up Arrow Key Move Focus Failed");
-                    throw new RuntimeException("Focus is not on Radio Button A as Expected");
-                }
+        SwingUtilities.invokeAndWait(() -> {
+            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtn1) {
+                System.out.println("Radio button Group Left/Up Arrow Key Move Focus Failed");
+                throw new RuntimeException("Focus is not on Radio Button A as Expected");
             }
         });
     }
@@ -240,39 +217,30 @@
     private static void runTest6() throws Exception {
         hitKey(robot, KeyEvent.VK_UP);
         hitKey(robot, KeyEvent.VK_UP);
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtn2) {
-                    System.out.println("Radio button Group Circle Back To First Button Test");
-                    throw new RuntimeException("Focus is not on Radio Button B as Expected");
-                }
+        SwingUtilities.invokeAndWait(() -> {
+            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtn2) {
+                System.out.println("Radio button Group Circle Back To First Button Test");
+                throw new RuntimeException("Focus is not on Radio Button B as Expected");
             }
         });
     }
 
     private static void runTest7() throws Exception {
         hitKey(robot, KeyEvent.VK_TAB);
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != btnMiddle) {
-                    System.out.println("Separate Component added in button group layout");
-                    throw new RuntimeException("Focus is not on Middle Button as Expected");
-                }
+        SwingUtilities.invokeAndWait(() -> {
+            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != btnMiddle) {
+                System.out.println("Separate Component added in button group layout");
+                throw new RuntimeException("Focus is not on Middle Button as Expected");
             }
         });
     }
 
     private static void runTest8() throws Exception {
         hitKey(robot, KeyEvent.VK_TAB);
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtnSingle) {
-                    System.out.println("Separate Component added in button group layout");
-                    throw new RuntimeException("Focus is not on Radio Button Single as Expected");
-                }
+        SwingUtilities.invokeAndWait(() -> {
+            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != radioBtnSingle) {
+                System.out.println("Separate Component added in button group layout");
+                throw new RuntimeException("Focus is not on Radio Button Single as Expected");
             }
         });
     }
--- a/test/jdk/lib/security/cacerts/VerifyCACerts.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/lib/security/cacerts/VerifyCACerts.java	Mon Aug 20 14:19:30 2018 -0700
@@ -25,6 +25,7 @@
 /**
  * @test
  * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 8199779 8209452
+ *      8209506
  * @summary Check root CA entries in cacerts file
  */
 import java.io.File;
@@ -41,7 +42,7 @@
             + File.separator + "security" + File.separator + "cacerts";
 
     // The numbers of certs now.
-    private static final int COUNT = 90;
+    private static final int COUNT = 92;
 
     // map of cert alias to SHA-256 fingerprint
     private static final Map<String, String> FINGERPRINT_MAP
@@ -227,6 +228,10 @@
                     "CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B");
             put("globalsigneccrootcar5 [jdk]",
                     "17:9F:BC:14:8A:3D:D0:0F:D2:4E:A1:34:58:CC:43:BF:A7:F5:9C:81:82:D7:83:A5:13:F6:EB:EC:10:0C:89:24");
+            put("globalsigneccrootcar4 [jdk]",
+                    "BE:C9:49:11:C2:95:56:76:DB:6C:0A:55:09:86:D7:6E:3B:A0:05:66:7C:44:2C:97:62:B4:FB:B7:73:DE:22:8C");
+            put("globalsignr2ca [jdk]",
+                    "CA:42:DD:41:74:5F:D0:B8:1E:B9:02:36:2C:F9:D8:BF:71:9D:A1:BD:1B:1E:FC:94:6F:5B:4C:99:F4:2C:1B:9E");
         }
     };
 
--- a/test/jdk/sun/security/ec/TestEC.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/ec/TestEC.java	Mon Aug 20 14:19:30 2018 -0700
@@ -30,6 +30,7 @@
  * @test
  * @bug 6840752 8168078
  * @summary  Provide out-of-the-box support for ECC algorithms
+ * @library /test/lib
  * @library ../pkcs11
  * @library ../pkcs11/ec
  * @library ../pkcs11/sslecc
--- a/test/jdk/sun/security/pkcs11/Cipher/JNICheck.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Cipher/JNICheck.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 8063700
+ * @library /test/lib
  * @run main/othervm -Xcheck:jni JNICheck
  */
 
--- a/test/jdk/sun/security/pkcs11/Cipher/ReinitCipher.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Cipher/ReinitCipher.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm ReinitCipher
--- a/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, 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
@@ -26,7 +26,7 @@
  * @bug 6687725
  * @summary Test internal PKCS5Padding impl with various error conditions.
  * @author Valerie Peng
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestPKCS5PaddingError
  * @run main/othervm TestPKCS5PaddingError sm
--- a/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4898468 6994008
  * @summary basic test for RSA cipher
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestRSACipher
--- a/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -26,7 +26,7 @@
  * @bug 6572331 6994008
  * @summary basic test for RSA cipher key wrapping functionality
  * @author Valerie Peng
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestRSACipherWrap
  * @run main/othervm TestRSACipherWrap sm
--- a/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, 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
@@ -26,7 +26,7 @@
  * @bug 6994008
  * @summary basic test for RSA/ECB/NoPadding cipher
  * @author Valerie Peng
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestRawRSACipher
--- a/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -26,7 +26,7 @@
  * @bug 4898461 6604496
  * @summary basic test for symmetric ciphers with padding
  * @author Valerie Peng
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestSymmCiphers
--- a/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -26,7 +26,7 @@
  * @bug 4898484 6604496 8001284
  * @summary basic test for symmetric ciphers with no padding
  * @author Valerie Peng
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestSymmCiphersNoPad
--- a/test/jdk/sun/security/pkcs11/Config/ReadConfInUTF16Env.sh	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Config/ReadConfInUTF16Env.sh	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -24,6 +24,7 @@
 # @test
 # @bug 8187023
 # @summary Pkcs11 config file should be assumed in ISO-8859-1
+# @library /test/lib
 # @build ReadConfInUTF16Env
 # @run shell ReadConfInUTF16Env.sh
 
--- a/test/jdk/sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -25,7 +25,7 @@
  * @test
  * @bug 8072452
  * @summary Support DHE sizes up to 8192-bits and DSA sizes up to 3072-bits
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm SupportedDHKeys
  * @run main/othervm SupportedDHKeys sm
--- a/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4921804 6324825
  * @summary Verify that DH works properly
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm -Djdk.crypto.KeyAgreement.legacyKDF=true TestDH
  * @run main/othervm -Djdk.crypto.KeyAgreement.legacyKDF=true TestDH sm
--- a/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -25,7 +25,7 @@
  * @test
  * @bug 7146728
  * @summary Interop test for DH with secret that has a leading 0x00 byte
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestInterop
  * @run main/othervm TestInterop sm
--- a/test/jdk/sun/security/pkcs11/KeyAgreement/TestShort.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyAgreement/TestShort.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4942494 7146728
  * @summary KAT test for DH (normal and with secret that has leading a 0x00 byte)
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestShort
  * @run main/othervm TestShort sm
--- a/test/jdk/sun/security/pkcs11/KeyAgreement/UnsupportedDHKeys.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyAgreement/UnsupportedDHKeys.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -25,7 +25,7 @@
  * @test
  * @bug 8072452
  * @summary Support DHE sizes up to 8192-bits and DSA sizes up to 3072-bits
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm UnsupportedDHKeys
  * @run main/othervm UnsupportedDHKeys sm
--- a/test/jdk/sun/security/pkcs11/KeyGenerator/DESParity.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyGenerator/DESParity.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4898479
  * @summary Verify that the parity bits are set correctly
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm DESParity
--- a/test/jdk/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4917233 6461727 6490213 6720456
  * @summary test the KeyGenerator
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestKeyGenerator
  * @run main/othervm TestKeyGenerator sm
--- a/test/jdk/sun/security/pkcs11/KeyPairGenerator/TestDH2048.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyPairGenerator/TestDH2048.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -26,7 +26,7 @@
  * @bug 7196382 8072452
  * @summary Ensure that DH key pairs can be generated for 512 - 8192 bits
  * @author Valerie Peng
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestDH2048
  * @run main/othervm TestDH2048 sm
--- a/test/jdk/sun/security/pkcs11/KeyStore/Basic.sh	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyStore/Basic.sh	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 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,6 +23,7 @@
 
 # @test
 # @bug 4938185
+# @library /test/lib
 # @summary KeyStore support for NSS cert/key databases
 #
 # @run shell Basic.sh
@@ -60,7 +61,8 @@
 echo TESTSRC=${TESTSRC}
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
-echo echo COMPILEJAVA=${COMPILEJAVA}
+echo COMPILEJAVA=${COMPILEJAVA}
+echo CPAPPEND=${CPAPPEND}
 echo ""
 
 # get command from input args -
@@ -168,16 +170,17 @@
 
 if [ "${RECOMPILE}" = "yes" ] ; then
     ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
-	-classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
-	-d ${TESTCLASSES} \
-	${TESTSRC}${FS}Basic.java \
-	${TESTSRC}${FS}..${FS}PKCS11Test.java
+  -classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
+  -d ${TESTCLASSES} \
+  ${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib${FS}jdk${FS}test${FS}lib${FS}artifacts${FS}*.java \
+  ${TESTSRC}${FS}Basic.java \
+  ${TESTSRC}${FS}..${FS}PKCS11Test.java
 fi
 
 # run test
 
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-	-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
+	-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar${PS}${CPAPPEND} \
 	-DDIR=${TESTSRC}${FS}BasicData \
 	-DCUSTOM_DB_DIR=${TESTCLASSES} \
 	-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${TOKEN}.txt \
--- a/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.sh	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.sh	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 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
@@ -25,7 +25,7 @@
 # @bug 4938185 7106773
 # @summary KeyStore support for NSS cert/key databases
 #          512 bits RSA key cannot work with SHA384 and SHA512
-#
+# @library /test/lib
 # @run shell ClientAuth.sh
 
 # set a few environment variables so that the shell-script can run stand-alone
@@ -47,6 +47,7 @@
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
 echo COMPILEJAVA=${COMPILEJAVA}
+echo CPAPPEND=${CPAPPEND}
 echo ""
 
 OS=`uname -s`
@@ -128,13 +129,14 @@
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
     -classpath ${TESTSRC} \
     -d ${TESTCLASSES} \
+    ${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib${FS}jdk${FS}test${FS}lib${FS}artifacts${FS}*.java \
     ${TESTSRC}${FS}ClientAuth.java \
     ${TESTSRC}${FS}..${FS}PKCS11Test.java
 
 # run test
 echo "Run ClientAuth TLSv1 ..."
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-    -classpath ${TESTCLASSES} \
+    -classpath ${TESTCLASSES}${PS}${CPAPPEND} \
     -DDIR=${TESTSRC}${FS}ClientAuthData${FS} \
     -DCUSTOM_DB_DIR=${TESTCLASSES} \
     -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \
@@ -155,7 +157,7 @@
 # run test
 echo "Run ClientAuth TLSv1.1 ..."
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-    -classpath ${TESTCLASSES} \
+    -classpath ${TESTCLASSES}${PS}${CPAPPEND} \
     -DDIR=${TESTSRC}${FS}ClientAuthData${FS} \
     -DCUSTOM_DB_DIR=${TESTCLASSES} \
     -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \
@@ -176,7 +178,7 @@
 # run test with specified TLS protocol and cipher suite
 echo "Run ClientAuth TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA"
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-    -classpath ${TESTCLASSES} \
+    -classpath ${TESTCLASSES}${PS}${CPAPPEND} \
     -DDIR=${TESTSRC}${FS}ClientAuthData${FS} \
     -DCUSTOM_DB_DIR=${TESTCLASSES} \
     -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \
--- a/test/jdk/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -25,7 +25,7 @@
 # @bug 6599979
 # @summary Ensure that re-assigning the alias works
 #
-# @library ..
+# @library /test/lib ..
 # @build SecretKeysBasic
 # @run shell SecretKeysBasic.sh
 #
@@ -52,6 +52,7 @@
 echo TESTSRC=${TESTSRC}
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
+echo CPAPPEND=${CPAPPEND}
 echo ""
 
 #DEBUG=sunpkcs11,pkcs11keystore
@@ -130,9 +131,9 @@
     ${MKDIR} ${TESTCLASSES}${FS}pkcs11_softtoken${FS}public
 
     echo ${CP} ${TESTSRC}${FS}BasicData${FS}pkcs11_softtoken${FS}objstore_info \
-	${TESTCLASSES}${FS}pkcs11_softtoken
+    ${TESTCLASSES}${FS}pkcs11_softtoken
     ${CP} ${TESTSRC}${FS}BasicData${FS}pkcs11_softtoken${FS}objstore_info \
-	${TESTCLASSES}${FS}pkcs11_softtoken
+    ${TESTCLASSES}${FS}pkcs11_softtoken
 
     echo ${CHMOD} +w ${TESTCLASSES}${FS}pkcs11_softtoken${FS}objstore_info
     ${CHMOD} 600 ${TESTCLASSES}${FS}pkcs11_softtoken${FS}objstore_info
@@ -142,16 +143,16 @@
 # run test
 cd ${TESTSRC}
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-	-DDIR=${TESTSRC}${FS}BasicData${FS} \
+        -DDIR=${TESTSRC}${FS}BasicData${FS} \
         -classpath \
-        ${TESTCLASSES}${PS}${TESTCLASSES}${FS}..${PS}${TESTSRC}${FS}loader.jar \
+        ${TESTCLASSES}${PS}${TESTCLASSES}${FS}..${PS}${TESTSRC}${FS}loader.jar${PS}${CPAPPEND} \
         -DCUSTOM_DB_DIR=${TESTCLASSES} \
         -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${token}.txt \
-	-DNO_DEFAULT=true \
-	-DNO_DEIMOS=true \
-	-DTOKEN=${token} \
-	-Djava.security.debug=${DEBUG} \
-	SecretKeysBasic
+        -DNO_DEFAULT=true \
+        -DNO_DEIMOS=true \
+        -DTOKEN=${token} \
+        -Djava.security.debug=${DEBUG} \
+        SecretKeysBasic
 
 #	-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${token}.txt \
 
--- a/test/jdk/sun/security/pkcs11/KeyStore/Solaris.sh	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/KeyStore/Solaris.sh	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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,6 +23,7 @@
 
 # @test
 # @bug 5038659
+# @library /test/lib
 # @summary Enable PKCS#11 KeyStore for SunPKCS11-Solaris
 #
 # @run shell Solaris.sh
@@ -138,17 +139,18 @@
     cd ${TESTCLASSES}
     ${RM} *.class
     ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
-	-classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
-	-d ${TESTCLASSES} \
-	${TESTSRC}${FS}Basic.java \
-	${TESTSRC}${FS}..${FS}PKCS11Test.java
+    -classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
+    -d ${TESTCLASSES} \
+    ${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib${FS}jdk${FS}test${FS}lib${FS}artifacts${FS}*.java \
+    ${TESTSRC}${FS}Basic.java \
+    ${TESTSRC}${FS}..${FS}PKCS11Test.java
 fi
 
 # run test
 
 cd ${TESTSRC}
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-	-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
+	-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar${PS}${CPAPPEND} \
 	-DDIR=${TESTSRC}${FS}BasicData${FS} \
 	-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-solaris.txt \
 	-DNO_DEFAULT=true \
--- a/test/jdk/sun/security/pkcs11/Mac/MacKAT.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Mac/MacKAT.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4846410 6313661 4963723
  * @summary Basic known-answer-test for Hmac algorithms
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm MacKAT
  * @run main/othervm MacKAT sm
--- a/test/jdk/sun/security/pkcs11/Mac/MacSameTest.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Mac/MacSameTest.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -26,7 +26,7 @@
  * @bug 8048603
  * @summary Check if doFinal and update operation result in same Mac
  * @author Yu-Ching Valerie Peng, Bill Situ, Alexander Fomin
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm MacSameTest
  * @run main/othervm MacSameTest sm
--- a/test/jdk/sun/security/pkcs11/Mac/ReinitMac.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Mac/ReinitMac.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm ReinitMac
--- a/test/jdk/sun/security/pkcs11/MessageDigest/ByteBuffers.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/MessageDigest/ByteBuffers.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary Test the MessageDigest.update(ByteBuffer) method
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm ByteBuffers
--- a/test/jdk/sun/security/pkcs11/MessageDigest/DigestKAT.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/MessageDigest/DigestKAT.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary Basic known-answer-test for all our MessageDigest algorithms
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm DigestKAT
  * @run main/othervm DigestKAT sm
--- a/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm ReinitDigest
--- a/test/jdk/sun/security/pkcs11/MessageDigest/TestCloning.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/MessageDigest/TestCloning.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -26,7 +26,7 @@
  * @bug 6414899
  * @summary Ensure the cloning functionality works.
  * @author Valerie Peng
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestCloning
--- a/test/jdk/sun/security/pkcs11/PKCS11Test.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java	Mon Aug 20 14:19:30 2018 -0700
@@ -53,6 +53,10 @@
 import java.util.ServiceLoader;
 import java.util.Set;
 
+import jdk.test.lib.artifacts.Artifact;
+import jdk.test.lib.artifacts.ArtifactResolver;
+import jdk.test.lib.artifacts.ArtifactResolverException;
+
 public abstract class PKCS11Test {
 
     private boolean enableSM = false;
@@ -300,15 +304,8 @@
     }
 
     static String getNSSLibDir(String library) throws Exception {
-        String osName = props.getProperty("os.name");
-        if (osName.startsWith("Win")) {
-            osName = "Windows";
-        } else if (osName.equals("Mac OS X")) {
-            osName = "MacOSX";
-        }
-        String osid = osName + "-"
-                + props.getProperty("os.arch") + "-" + props.getProperty("sun.arch.data.model");
-        String[] nssLibDirs = osMap.get(osid);
+        String osid = getOsId();
+        String[] nssLibDirs = getNssLibPaths(osid);
         if (nssLibDirs == null) {
             System.out.println("Warning: unsupported OS: " + osid
                     + ", please initialize NSS librarys location firstly, skipping test");
@@ -323,6 +320,7 @@
             if (new File(dir).exists() &&
                 new File(dir + System.mapLibraryName(library)).exists()) {
                 nssLibDir = dir;
+                System.out.println("nssLibDir: " + nssLibDir);
                 System.setProperty("pkcs11test.nss.libdir", nssLibDir);
                 break;
             }
@@ -334,6 +332,18 @@
         return nssLibDir;
     }
 
+    private static String getOsId() {
+        String osName = props.getProperty("os.name");
+        if (osName.startsWith("Win")) {
+            osName = "Windows";
+        } else if (osName.equals("Mac OS X")) {
+            osName = "MacOSX";
+        }
+        String osid = osName + "-" + props.getProperty("os.arch") + "-"
+                + props.getProperty("sun.arch.data.model");
+        return osid;
+    }
+
     static boolean isBadNSSVersion(Provider p) {
         double nssVersion = getNSSVersion();
         if (isNSS(p) && nssVersion >= 3.11 && nssVersion < 3.12) {
@@ -644,34 +654,74 @@
         return false;
     }
 
-    private static final Map<String,String[]> osMap;
+    private static Map<String,String[]> osMap;
 
     // Location of the NSS libraries on each supported platform
-    static {
+    private static Map<String, String[]> getOsMap() {
+        if (osMap != null) {
+            return osMap;
+        }
+
         osMap = new HashMap<>();
-        osMap.put("SunOS-sparc-32", new String[]{"/usr/lib/mps/"});
-        osMap.put("SunOS-sparcv9-64", new String[]{"/usr/lib/mps/64/"});
-        osMap.put("SunOS-x86-32", new String[]{"/usr/lib/mps/"});
-        osMap.put("SunOS-amd64-64", new String[]{"/usr/lib/mps/64/"});
-        osMap.put("Linux-i386-32", new String[]{
-            "/usr/lib/i386-linux-gnu/", "/usr/lib32/", "/usr/lib/"});
-        osMap.put("Linux-amd64-64", new String[]{
-            "/usr/lib/x86_64-linux-gnu/", "/usr/lib/x86_64-linux-gnu/nss/",
-            "/usr/lib64/"});
-        osMap.put("Linux-ppc64-64", new String[]{"/usr/lib64/"});
-        osMap.put("Linux-ppc64le-64", new String[]{"/usr/lib64/"});
-        osMap.put("Linux-s390x-64", new String[]{"/usr/lib64/"});
-        osMap.put("Windows-x86-32", new String[]{
-            PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)});
-        osMap.put("Windows-amd64-64", new String[]{
-            PKCS11_BASE + "/nss/lib/windows-amd64/".replace('/', SEP)});
-        osMap.put("MacOSX-x86_64-64", new String[]{
-            PKCS11_BASE + "/nss/lib/macosx-x86_64/"});
-        osMap.put("Linux-arm-32", new String[]{
-            "/usr/lib/arm-linux-gnueabi/nss/",
-            "/usr/lib/arm-linux-gnueabihf/nss/"});
-        osMap.put("Linux-aarch64-64", new String[]{
-            "/usr/lib/aarch64-linux-gnu/", "/usr/lib/aarch64-linux-gnu/nss/"});
+        osMap.put("SunOS-sparc-32", new String[] { "/usr/lib/mps/" });
+        osMap.put("SunOS-sparcv9-64", new String[] { "/usr/lib/mps/64/" });
+        osMap.put("SunOS-x86-32", new String[] { "/usr/lib/mps/" });
+        osMap.put("SunOS-amd64-64", new String[] { "/usr/lib/mps/64/" });
+        osMap.put("Linux-i386-32", new String[] {
+                "/usr/lib/i386-linux-gnu/",
+                "/usr/lib32/",
+                "/usr/lib/" });
+        osMap.put("Linux-amd64-64", new String[] {
+                "/usr/lib/x86_64-linux-gnu/",
+                "/usr/lib/x86_64-linux-gnu/nss/",
+                "/usr/lib64/" });
+        osMap.put("Linux-ppc64-64", new String[] { "/usr/lib64/" });
+        osMap.put("Linux-ppc64le-64", new String[] { "/usr/lib64/" });
+        osMap.put("Linux-s390x-64", new String[] { "/usr/lib64/" });
+        osMap.put("Windows-x86-32", new String[] {});
+        osMap.put("Windows-amd64-64", new String[] {});
+        osMap.put("MacOSX-x86_64-64", new String[] {});
+        osMap.put("Linux-arm-32", new String[] {
+                "/usr/lib/arm-linux-gnueabi/nss/",
+                "/usr/lib/arm-linux-gnueabihf/nss/" });
+        osMap.put("Linux-aarch64-64", new String[] {
+                "/usr/lib/aarch64-linux-gnu/",
+                "/usr/lib/aarch64-linux-gnu/nss/" });
+        return osMap;
+    }
+
+    private static String[] getNssLibPaths(String osId) {
+        String[] preferablePaths = getPreferableNssLibPaths(osId);
+        if (preferablePaths.length != 0) {
+            return preferablePaths;
+        } else {
+            return getOsMap().get(osId);
+        }
+    }
+
+    private static String[] getPreferableNssLibPaths(String osId) {
+        List<String> nssLibPaths = new ArrayList<>();
+
+        String customNssLibPaths = System.getProperty("test.nss.lib.paths");
+        if (customNssLibPaths == null) {
+            // If custom local NSS lib path is not provided,
+            // try to download NSS libs from artifactory
+            String path = fetchNssLib(osId);
+            if (path != null) {
+                nssLibPaths.add(path);
+            }
+        } else {
+            String[] paths = customNssLibPaths.split(",");
+            for (String path : paths) {
+                if (!path.endsWith(File.separator)) {
+                    nssLibPaths.add(path + File.separator);
+                } else {
+                    nssLibPaths.add(path);
+                }
+            }
+        }
+
+        return nssLibPaths.toArray(new String[nssLibPaths.size()]);
     }
 
     private final static char[] hexDigits = "0123456789abcdef".toCharArray();
@@ -797,4 +847,60 @@
         }
         return data;
     }
+
+    private static String fetchNssLib(String osId) {
+        switch (osId) {
+        case "Windows-x86-32":
+            return fetchNssLib(WINDOWS_X86.class);
+
+        case "Windows-amd64-64":
+            return fetchNssLib(WINDOWS_X64.class);
+
+        case "MacOSX-x86_64-64":
+            return fetchNssLib(MACOSX_X64.class);
+
+        default:
+            return null;
+        }
+    }
+
+    private static String fetchNssLib(Class<?> clazz) {
+        String path = null;
+        try {
+            path = ArtifactResolver.resolve(clazz).entrySet().stream()
+                    .findAny().get().getValue() + File.separator + "nsslib"
+                    + File.separator;
+        } catch (ArtifactResolverException e) {
+            Throwable cause = e.getCause();
+            if (cause == null) {
+                System.out.println("Cannot resolve artifact, "
+                        + "please check if JIB jar is present in classpath.");
+            } else {
+                throw new RuntimeException("Fetch artifact failed: " + clazz
+                        + "\nPlease make sure the artifact is available.");
+            }
+        }
+        return path;
+    }
+
+    @Artifact(
+            organization = "jpg.tests.jdk.nsslib",
+            name = "nsslib-windows_x64",
+            revision = "3.35",
+            extension = "zip")
+    private static class WINDOWS_X64 { }
+
+    @Artifact(
+            organization = "jpg.tests.jdk.nsslib",
+            name = "nsslib-windows_x86",
+            revision = "3.35",
+            extension = "zip")
+    private static class WINDOWS_X86 { }
+
+    @Artifact(
+            organization = "jpg.tests.jdk.nsslib",
+            name = "nsslib-macosx_x64",
+            revision = "3.35",
+            extension = "zip")
+    private static class MACOSX_X64 { }
 }
--- a/test/jdk/sun/security/pkcs11/Provider/Absolute.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Provider/Absolute.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, 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,7 +23,7 @@
 /*
  * @test
  * @bug 7003952 7191662
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @summary load DLLs and launch executables using fully qualified path
  */
--- a/test/jdk/sun/security/pkcs11/Provider/ConfigQuotedString.sh	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Provider/ConfigQuotedString.sh	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -48,6 +48,7 @@
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
 echo COMPILEJAVA=${COMPILEJAVA}
+echo CPAPPEND=${CPAPPEND}
 echo ""
 
 # let java test exit if platform unsupported
@@ -105,13 +106,14 @@
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -classpath ${TESTSRC}${FS}.. \
         -d ${TESTCLASSES} \
+        ${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib${FS}jdk${FS}test${FS}lib${FS}artifacts${FS}*.java \
         ${TESTSRC}${FS}ConfigQuotedString.java \
         ${TESTSRC}${FS}..${FS}PKCS11Test.java
 
 # run test
 
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-        -classpath ${TESTCLASSES} \
+        -classpath ${TESTCLASSES}${PS}${CPAPPEND} \
         -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ConfigQuotedString-nss.txt \
         -Dtest.src=${TESTSRC} \
         -Dtest.classes=${TESTCLASSES} \
--- a/test/jdk/sun/security/pkcs11/Provider/Login.sh	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Provider/Login.sh	Mon Aug 20 14:19:30 2018 -0700
@@ -49,6 +49,7 @@
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
 echo COMPILEJAVA=${COMPILEJAVA}
+echo CPAPPEND=${CPAPPEND}
 echo ""
 
 # let java test exit if platform unsupported
@@ -114,13 +115,14 @@
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -classpath ${TESTSRC}${FS}.. \
         -d ${TESTCLASSES} \
+        ${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib${FS}jdk${FS}test${FS}lib${FS}artifacts${FS}*.java \
         ${TESTSRC}${FS}Login.java \
         ${TESTSRC}${FS}..${FS}PKCS11Test.java
 
 # run test
 
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-        -classpath ${TESTCLASSES} \
+        -classpath ${TESTCLASSES}${PS}${CPAPPEND} \
         -DCUSTOM_DB_DIR=${TESTCLASSES} \
         -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}Login-nss.txt \
         -DNO_DEFAULT=true \
--- a/test/jdk/sun/security/pkcs11/README	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/README	Mon Aug 20 14:19:30 2018 -0700
@@ -1,13 +1,33 @@
 This README is to keep a list facts and known workaround for the pkcs11 java tests
 perform as a result of bugs or features in NSS or other pkcs11 libraries.
 
+- How to get NSS libraries?
+The libraries come from the following sources.
+
+1. Specified by system property test.nss.lib.paths
+System property test.nss.lib.paths can specify a set of absolute paths to
+the local NSS library directories. The paths are separated by comma.
+
+2. Pre-built NSS libraries from artifactory server
+If the value of system property test.nss.lib.paths is not set, the tests will try
+to download pre-built NSS libraries from artifactory server. Currently, the
+tests only looks for libraries for Windows and MacOSX platforms on artifactory.
+Please note that JIB jar MUST be present in classpath when downloading the
+libraries.
+
+3. System NSS libraries
+If both of the above sources are not available, the tests will try to search
+for the libraries in some system paths. The paths are platform-specific. Note
+that, there is no such system path on Windows and MacOSX platforms. On these
+platforms, it has to use source 1 or 2.
+
 - NSS ECC None/Basic/Extended
 The tests detect the NSS library support for Elliptic Curves as to not
 report incorrect failures.  PKCS11 reports back CKR_DOMAIN_PARAMS_INVALID
 when the curve is not supported.
 
 - Default libsoftokn3.so
-By default PKCS11Test.java will look for libsoftokn3.so.  There are a number of
+By default PKCS11Test.java will look for libsoftokn3.so. There are a number of
 tests, particularly in Secmod, that need libnss3.so.  The method useNSS() in
 PKCS11test.java is to change the search and version checking to libnss3.
 
@@ -17,6 +37,6 @@
 read incorrectly. KeyStore/SecretKeysBasic.java tiggers this bug and
 knows to avoid it.
 
-- A number of EC tests fail because of a DER bug in NSS 3.11.  The best guess
+- A number of EC tests fail because of a DER bug in NSS 3.11. The best guess
 is Mozilla bug 480280.  Those tests that abort execution with a PASS result
 are:  TestECDH2, TestECDSA, TestECDSA2 and TestECGenSpec.
--- a/test/jdk/sun/security/pkcs11/SampleTest.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/SampleTest.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4000000
  * @summary XXX todo
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  */
 
--- a/test/jdk/sun/security/pkcs11/Secmod/AddPrivateKey.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Secmod/AddPrivateKey.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -26,7 +26,7 @@
  * @bug 6414980
  * @summary Test that the PKCS#11 KeyStore handles RSA, DSA, and EC keys
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm AddPrivateKey
  * @run main/othervm AddPrivateKey sm policy
@@ -63,6 +63,11 @@
     private static final byte[] DATA = generateData(DATA_LENGTH);
 
     public static void main(String[] args) throws Exception {
+        if (args.length > 1 && "sm".equals(args[0])) {
+            System.setProperty("java.security.policy",
+                    BASE + File.separator + args[1]);
+        }
+
         if (initSecmod() == false) {
             return;
         }
@@ -77,8 +82,6 @@
         Security.addProvider(p);
 
         if (args.length > 1 && "sm".equals(args[0])) {
-            System.setProperty("java.security.policy",
-                    BASE + File.separator + args[1]);
             System.setSecurityManager(new SecurityManager());
         }
 
--- a/test/jdk/sun/security/pkcs11/Secmod/AddTrustedCert.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Secmod/AddTrustedCert.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6298106
  * @summary make sure we can add a trusted cert to the NSS KeyStore module
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm AddTrustedCert
  * @run main/othervm AddTrustedCert sm policy
@@ -48,6 +48,11 @@
 public class AddTrustedCert extends SecmodTest {
 
     public static void main(String[] args) throws Exception {
+        if (args.length > 1 && "sm".equals(args[0])) {
+            System.setProperty("java.security.policy",
+                    BASE + File.separator + args[1]);
+        }
+
         if (initSecmod() == false) {
             return;
         }
--- a/test/jdk/sun/security/pkcs11/Secmod/Crypto.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Secmod/Crypto.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6329006
  * @summary verify that NSS no-db mode works correctly
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm Crypto
  * @run main/othervm Crypto sm policy
--- a/test/jdk/sun/security/pkcs11/Secmod/GetPrivateKey.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Secmod/GetPrivateKey.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -27,7 +27,7 @@
  * @summary make sure we can access the NSS softtoken KeyStore
  *          and use a private key
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm GetPrivateKey
  * @run main/othervm GetPrivateKey sm policy
@@ -47,6 +47,11 @@
 public class GetPrivateKey extends SecmodTest {
 
     public static void main(String[] args) throws Exception {
+        if (args.length > 1 && "sm".equals(args[0])) {
+            System.setProperty("java.security.policy",
+                    BASE + File.separator + args[1]);
+        }
+
         if (initSecmod() == false) {
             return;
         }
@@ -58,8 +63,6 @@
         Security.addProvider(p);
 
         if (args.length > 1 && "sm".equals(args[0])) {
-            System.setProperty("java.security.policy",
-                    BASE + File.separator + args[1]);
             System.setSecurityManager(new SecurityManager());
         }
 
--- a/test/jdk/sun/security/pkcs11/Secmod/JksSetPrivateKey.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Secmod/JksSetPrivateKey.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -26,7 +26,7 @@
  * @bug 6269847
  * @summary store a NSS PKCS11 PrivateKeyEntry to JKS KeyStore throws confusing NPE
  * @author Wang Weijun
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm JksSetPrivateKey
  * @run main/othervm JksSetPrivateKey sm policy
@@ -46,6 +46,11 @@
 public class JksSetPrivateKey extends SecmodTest {
 
     public static void main(String[] args) throws Exception {
+        if (args.length > 1 && "sm".equals(args[0])) {
+            System.setProperty("java.security.policy",
+                    BASE + File.separator + args[1]);
+        }
+
         if (initSecmod() == false) {
             return;
         }
@@ -57,8 +62,6 @@
         Security.addProvider(p);
 
         if (args.length > 1 && "sm".equals(args[0])) {
-            System.setProperty("java.security.policy",
-                    BASE + File.separator + args[1]);
             System.setSecurityManager(new SecurityManager());
         }
 
--- a/test/jdk/sun/security/pkcs11/Secmod/LoadKeystore.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Secmod/LoadKeystore.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -25,7 +25,7 @@
  * @test
  * @bug 8048622 8134232
  * @summary Checks that PKCS#11 keystore can't be loaded with wrong password
- * @library ../
+ * @library /test/lib ../
  * @modules jdk.crypto.cryptoki
  * @run main/othervm LoadKeystore
  * @run main/othervm LoadKeystore sm policy
@@ -43,6 +43,11 @@
 public class LoadKeystore extends SecmodTest {
 
     public static void main(String[] args) throws Exception {
+        if (args.length > 1 && "sm".equals(args[0])) {
+            System.setProperty("java.security.policy",
+                    BASE + File.separator + args[1]);
+        }
+
         if (!initSecmod()) {
             return;
         }
@@ -55,8 +60,6 @@
         Security.addProvider(p);
 
         if (args.length > 1 && "sm".equals(args[0])) {
-            System.setProperty("java.security.policy",
-                    BASE + File.separator + args[1]);
             System.setSecurityManager(new SecurityManager());
         }
 
--- a/test/jdk/sun/security/pkcs11/Secmod/TestNssDbSqlite.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Secmod/TestNssDbSqlite.java	Mon Aug 20 14:19:30 2018 -0700
@@ -28,7 +28,7 @@
  * @summary Test NSS DB Sqlite
  * @comment There is no NSS on Aix.
  * @requires os.family != "aix"
- * @library ../
+ * @library /test/lib ../
  * @modules java.base/sun.security.rsa
  *          java.base/sun.security.provider
  *          java.base/sun.security.jca
--- a/test/jdk/sun/security/pkcs11/Secmod/TrustAnchors.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Secmod/TrustAnchors.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6298106 6275523 6420252 8059627
  * @summary make sure we can access the NSS trust anchor module
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TrustAnchors
  * @run main/othervm TrustAnchors sm policy
--- a/test/jdk/sun/security/pkcs11/SecureRandom/Basic.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/SecureRandom/Basic.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6246411
  * @summary basic test for PKCS#11 SecureRandom
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm Basic
--- a/test/jdk/sun/security/pkcs11/SecureRandom/TestDeserialization.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/SecureRandom/TestDeserialization.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, 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
@@ -25,7 +25,7 @@
  * @test
  * @bug 6837847
  * @summary Ensure a deserialized PKCS#11 SecureRandom is functional.
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  */
 
--- a/test/jdk/sun/security/pkcs11/Serialize/SerializeProvider.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Serialize/SerializeProvider.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4921802
  * @summary Test that the SunPKCS11 provider can be serialized
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  */
 
--- a/test/jdk/sun/security/pkcs11/Signature/ByteBuffers.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Signature/ByteBuffers.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary Test the Signature.update(ByteBuffer) method
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm ByteBuffers
--- a/test/jdk/sun/security/pkcs11/Signature/ReinitSignature.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Signature/ReinitSignature.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary test that reinitializing Signatures works correctly
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main ReinitSignature
--- a/test/jdk/sun/security/pkcs11/Signature/TestDSA.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Signature/TestDSA.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary basic test of SHA1withDSA and RawDSA signing/verifying
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestDSA
--- a/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java	Mon Aug 20 14:19:30 2018 -0700
@@ -26,7 +26,7 @@
  * @bug 7200306 8029158
  * @summary verify that P11Signature impl will error out when initialized
  * with unsupported key sizes
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestDSAKeyLength
--- a/test/jdk/sun/security/pkcs11/Signature/TestRSAKeyLength.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/Signature/TestRSAKeyLength.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, 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
@@ -26,7 +26,7 @@
  * @bug 6695485
  * @summary Make sure initSign/initVerify() check RSA key lengths
  * @author Yu-Ching Valerie Peng
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestRSAKeyLength
  * @run main/othervm TestRSAKeyLength sm
--- a/test/jdk/sun/security/pkcs11/ec/ReadCertificates.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/ec/ReadCertificates.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -27,7 +27,7 @@
  * @summary Make sure that we can parse certificates using various named curves
  *   and verify their signatures
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @library ../../../../java/security/testlibrary
  * @modules jdk.crypto.cryptoki
  * @run main/othervm ReadCertificates
--- a/test/jdk/sun/security/pkcs11/ec/ReadPKCS12.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/ec/ReadPKCS12.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -26,7 +26,7 @@
  * @bug 6405536
  * @summary Verify that we can parse ECPrivateKeys from PKCS#12 and use them
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @library ../../../../java/security/testlibrary
  * @key randomness
  * @modules jdk.crypto.cryptoki
--- a/test/jdk/sun/security/pkcs11/ec/TestCurves.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/ec/TestCurves.java	Mon Aug 20 14:19:30 2018 -0700
@@ -26,7 +26,7 @@
  * @bug 6405536 6414980
  * @summary Basic consistency test for all curves using ECDSA and ECDH
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki/sun.security.pkcs11.wrapper
  * @run main/othervm TestCurves
  * @run main/othervm TestCurves sm
--- a/test/jdk/sun/security/pkcs11/ec/TestECDH.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/ec/TestECDH.java	Mon Aug 20 14:19:30 2018 -0700
@@ -26,7 +26,7 @@
  * @bug 6405536
  * @summary Basic known answer test for ECDH
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @library ../../../../java/security/testlibrary
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestECDH
--- a/test/jdk/sun/security/pkcs11/ec/TestECDH2.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/ec/TestECDH2.java	Mon Aug 20 14:19:30 2018 -0700
@@ -26,7 +26,7 @@
  * @bug 6405536
  * @summary basic test of ECDSA signatures for P-256 and P-384 from the
  * example data in "Suite B Implementer's Guide to FIPS 186-3".
- * @library ..
+ * @library /test/lib ..
  * @library ../../../../java/security/testlibrary
  * @modules java.base/sun.security.util
  *          jdk.crypto.cryptoki
--- a/test/jdk/sun/security/pkcs11/ec/TestECDSA.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/ec/TestECDSA.java	Mon Aug 20 14:19:30 2018 -0700
@@ -26,7 +26,7 @@
  * @bug 6405536 8042967
  * @summary basic test of SHA1withECDSA and NONEwithECDSA signing/verifying
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @library ../../../../java/security/testlibrary
  * @key randomness
  * @modules jdk.crypto.cryptoki
--- a/test/jdk/sun/security/pkcs11/ec/TestECDSA2.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/ec/TestECDSA2.java	Mon Aug 20 14:19:30 2018 -0700
@@ -26,7 +26,7 @@
  * @bug 6405536
  * @summary basic test of ECDSA signatures for P-256 and P-384 from the
  * example data in "Suite B Implementer's Guide to FIPS 186-3".
- * @library ..
+ * @library /test/lib ..
  * @library ../../../../java/security/testlibrary
  * @modules java.base/sun.security.util
  *          jdk.crypto.cryptoki
--- a/test/jdk/sun/security/pkcs11/ec/TestECGenSpec.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/ec/TestECGenSpec.java	Mon Aug 20 14:19:30 2018 -0700
@@ -26,7 +26,7 @@
  * @bug 6405536
  * @summary Verify that we can use ECGenParameterSpec
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestECGenSpec
  * @run main/othervm TestECGenSpec sm
--- a/test/jdk/sun/security/pkcs11/ec/TestKeyFactory.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/ec/TestKeyFactory.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -26,7 +26,7 @@
  * @bug 6405536
  * @summary Test the P11ECKeyFactory
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestKeyFactory
  * @run main/othervm TestKeyFactory sm
--- a/test/jdk/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -25,7 +25,7 @@
  * @test
  * @bug 6313675 6323647 8028192
  * @summary Verify that all ciphersuites work in FIPS mode
- * @library ..
+ * @library /test/lib ..
  * @author Andreas Sterbenz
  * @modules java.base/com.sun.net.ssl.internal.ssl
  * @run main/manual ClientJSSEServerJSSE
--- a/test/jdk/sun/security/pkcs11/fips/TrustManagerTest.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/fips/TrustManagerTest.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6323647
  * @summary Verify that the SunJSSE trustmanager works correctly in FIPS mode
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules java.base/com.sun.net.ssl.internal.ssl
  * @run main/othervm TrustManagerTest
  * @run main/othervm TrustManagerTest sm TrustManagerTest.policy
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libfreebl3.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnspr4.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnss3.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnssckbi.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnssdbm3.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libnssutil3.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libplc4.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libplds4.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libsoftokn3.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libsqlite3.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/macosx-x86_64/libssl3.dylib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/freebl3.chk has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/freebl3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nspr4.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nspr4.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nss3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nss3.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssckbi.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssdbm3.chk has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssdbm3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssutil3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/nssutil3.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/plc4.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/plc4.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/plds4.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/plds4.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/softokn3.chk has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/softokn3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/sqlite3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/ssl3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-amd64/ssl3.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/freebl3.chk has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/freebl3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nspr4.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nspr4.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nss3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nss3.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssckbi.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssdbm3.chk has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssdbm3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssutil3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/nssutil3.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/plc4.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/plc4.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/plds4.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/plds4.lib has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/softokn3.chk has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/softokn3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/sqlite3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/ssl3.dll has changed
Binary file test/jdk/sun/security/pkcs11/nss/lib/windows-i586/ssl3.lib has changed
--- a/test/jdk/sun/security/pkcs11/rsa/KeyWrap.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/rsa/KeyWrap.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6231216
  * @summary Verify key wrapping (of extractable keys) works for RSA/PKCS1
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm KeyWrap
--- a/test/jdk/sun/security/pkcs11/rsa/TestCACerts.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/rsa/TestCACerts.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary Test the new RSA provider can verify all the RSA certs in the cacerts file
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @library ../../../../java/security/testlibrary
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestCACerts
--- a/test/jdk/sun/security/pkcs11/rsa/TestKeyFactory.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/rsa/TestKeyFactory.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary Test KeyFactory of the new RSA provider
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestKeyFactory
  * @run main/othervm TestKeyFactory sm rsakeys.ks.policy
--- a/test/jdk/sun/security/pkcs11/rsa/TestSignatures.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/rsa/TestSignatures.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,7 @@
  * @bug 4856966
  * @summary Test signing/verifying using all the signature algorithms
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @key randomness
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestSignatures
--- a/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java	Mon Aug 20 14:19:30 2018 -0700
@@ -31,7 +31,7 @@
  * @bug 6405536
  * @summary Verify that all ciphersuites work (incl. ECC using NSS crypto)
  * @author Andreas Sterbenz
- * @library .. ../../../../javax/net/ssl/TLSCommon
+ * @library /test/lib .. ../../../../javax/net/ssl/TLSCommon
  * @library ../../../../java/security/testlibrary
  * @modules jdk.crypto.cryptoki
  * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1"
--- a/test/jdk/sun/security/pkcs11/tls/TestKeyMaterial.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/tls/TestKeyMaterial.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6316539 8136355
  * @summary Known-answer-test for TlsKeyMaterial generator
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules java.base/sun.security.internal.spec
  *          jdk.crypto.cryptoki
  * @run main/othervm TestKeyMaterial
--- a/test/jdk/sun/security/pkcs11/tls/TestLeadingZeroesP11.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/tls/TestLeadingZeroesP11.java	Mon Aug 20 14:19:30 2018 -0700
@@ -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
@@ -25,7 +25,7 @@
  * @test
  * @bug 8014618
  * @summary Need to strip leading zeros in TlsPremasterSecret of DHKeyAgreement
- * @library ..
+ * @library /test/lib ..
  * @author Pasi Eronen
  * @modules jdk.crypto.cryptoki
  * @run main/othervm TestLeadingZeroesP11
--- a/test/jdk/sun/security/pkcs11/tls/TestMasterSecret.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/tls/TestMasterSecret.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6316539 8136355
  * @summary Known-answer-test for TlsMasterSecret generator
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules java.base/sun.security.internal.interfaces
  *          java.base/sun.security.internal.spec
  *          jdk.crypto.cryptoki
--- a/test/jdk/sun/security/pkcs11/tls/TestPRF.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/tls/TestPRF.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6316539 6345251
  * @summary Basic known-answer-test for TlsPrf
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules java.base/sun.security.internal.spec
  *          jdk.crypto.cryptoki
  * @run main/othervm TestPRF
--- a/test/jdk/sun/security/pkcs11/tls/TestPremaster.java	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/pkcs11/tls/TestPremaster.java	Mon Aug 20 14:19:30 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,7 +26,7 @@
  * @bug 6316539 8136355
  * @summary Basic tests for TlsRsaPremasterSecret generator
  * @author Andreas Sterbenz
- * @library ..
+ * @library /test/lib ..
  * @modules java.base/sun.security.internal.spec
  *          jdk.crypto.cryptoki
  * @run main/othervm TestPremaster
--- a/test/jdk/sun/security/tools/keytool/autotest.sh	Mon Aug 20 11:37:57 2018 -0700
+++ b/test/jdk/sun/security/tools/keytool/autotest.sh	Mon Aug 20 14:19:30 2018 -0700
@@ -86,9 +86,6 @@
             "/usr/lib/nss/libsoftokn3.so"`
     fi
     ;;
-  Darwin )
-    LIBNAME="$TESTSRC/../../pkcs11/nss/lib/macosx-x86_64/libsoftokn3.dylib"
-    ;;
   * )
     echo "Will not run test on: ${OS}"
     exit 0;