8228645: Don't run sun/security/pkcs11/Cipher/TestKATForGCM.java on buggy NSS solaris versions
authorcoffeys
Mon, 29 Jul 2019 08:17:26 +0000
changeset 57563 2116221e2dde
parent 57562 e2b758f8e77a
child 57564 0a8436eda2fa
8228645: Don't run sun/security/pkcs11/Cipher/TestKATForGCM.java on buggy NSS solaris versions Reviewed-by: valeriep
test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java
--- a/test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java	Fri Jul 26 15:05:24 2019 +0200
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java	Mon Jul 29 08:17:26 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, 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
@@ -314,8 +314,20 @@
                     ", no support for " + transformation);
             return;
         }
-        if (execute(testValues, c)) {
-            System.out.println("Test Passed!");
+        try {
+            if (execute(testValues, c)) {
+                System.out.println("Test Passed!");
+            }
+        } catch (Exception e) {
+            double ver = getNSSInfo("nss");
+            if (ver < 3.251d && p.getName().contains("SunPKCS11-NSS") &&
+                System.getProperty("os.name").equals("SunOS")) {
+                // buggy behaviour from solaris on 11.2 OS (nss < 3.251)
+                System.out.println("Skipping: SunPKCS11-NSS: Old NSS: " + ver);
+                return; // OK
+            } else {
+                throw e;
+            }
         }
     }
 }