8133318: Exclude intermittent failing PKCS11 tests on Solaris SPARC 11.1 and earlier
Reviewed-by: mullan
--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java Wed Aug 12 14:38:09 2015 +0100
@@ -630,4 +630,18 @@
return algorithms;
}
+ /**
+ * Get the identifier for the operating system distribution
+ */
+ public String getDistro() {
+
+ try (BufferedReader in =
+ new BufferedReader(new InputStreamReader(
+ Runtime.getRuntime().exec("uname -v").getInputStream()))) {
+
+ return in.readLine();
+ } catch (Exception e) {
+ return "";
+ }
+ }
}
--- a/jdk/test/sun/security/pkcs11/Signature/ByteBuffers.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/Signature/ByteBuffers.java Wed Aug 12 14:38:09 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -42,6 +42,22 @@
}
public void main(Provider p) throws Exception {
+
+ /*
+ * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+ * when running SunPKCS11-Solaris provider (8044554)
+ */
+ if (p.getName().equals("SunPKCS11-Solaris") &&
+ System.getProperty("os.name").equals("SunOS") &&
+ System.getProperty("os.arch").equals("sparcv9") &&
+ System.getProperty("os.version").compareTo("5.11") <= 0 &&
+ getDistro().compareTo("11.2") < 0) {
+
+ System.out.println("SunPKCS11-Solaris provider requires " +
+ "Solaris SPARC 11.2 or later, skipping");
+ return;
+ }
+
Random random = new Random();
int n = 10 * 1024;
byte[] t = new byte[n];
--- a/jdk/test/sun/security/pkcs11/Signature/ReinitSignature.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/Signature/ReinitSignature.java Wed Aug 12 14:38:09 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -28,6 +28,306 @@
* @author Andreas Sterbenz
* @library ..
* @key randomness
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
*/
import java.util.*;
@@ -41,6 +341,22 @@
}
public void main(Provider p) throws Exception {
+
+ /*
+ * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+ * when running SunPKCS11-Solaris (8044554)
+ */
+ if (p.getName().equals("SunPKCS11-Solaris") &&
+ System.getProperty("os.name").equals("SunOS") &&
+ System.getProperty("os.arch").equals("sparcv9") &&
+ System.getProperty("os.version").compareTo("5.11") <= 0 &&
+ getDistro().compareTo("11.2") < 0) {
+
+ System.out.println("SunPKCS11-Solaris provider requires " +
+ "Solaris SPARC 11.2 or later, skipping");
+ return;
+ }
+
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
kpg.initialize(512);
KeyPair kp = kpg.generateKeyPair();
--- a/jdk/test/sun/security/pkcs11/Signature/TestDSA.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/Signature/TestDSA.java Wed Aug 12 14:38:09 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -110,6 +110,21 @@
System.out.println("Testing provider " + provider + "...");
+ /*
+ * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+ * when running SunPKCS11-Solaris (8044554)
+ */
+ if (provider.getName().equals("SunPKCS11-Solaris") &&
+ System.getProperty("os.name").equals("SunOS") &&
+ System.getProperty("os.arch").equals("sparcv9") &&
+ System.getProperty("os.version").compareTo("5.11") <= 0 &&
+ getDistro().compareTo("11.2") < 0) {
+
+ System.out.println("SunPKCS11-Solaris provider requires " +
+ "Solaris SPARC 11.2 or later, skipping");
+ return;
+ }
+
if (provider.getService("Signature", "SHA1withDSA") == null) {
System.out.println("DSA not supported, skipping");
return;
--- a/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java Wed Aug 12 14:38:09 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -46,6 +46,21 @@
return;
}
+ /*
+ * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+ * when running SunPKCS11-Solaris (8044554)
+ */
+ if (provider.getName().equals("SunPKCS11-Solaris") &&
+ System.getProperty("os.name").equals("SunOS") &&
+ System.getProperty("os.arch").equals("sparcv9") &&
+ System.getProperty("os.version").compareTo("5.11") <= 0 &&
+ getDistro().compareTo("11.2") < 0) {
+
+ System.out.println("SunPKCS11-Solaris provider requires " +
+ "Solaris SPARC 11.2 or later, skipping");
+ return;
+ }
+
KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", "SUN");
kpg.initialize(2048, new SecureRandom());
KeyPair pair = kpg.generateKeyPair();
--- a/jdk/test/sun/security/pkcs11/Signature/TestRSAKeyLength.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/Signature/TestRSAKeyLength.java Wed Aug 12 14:38:09 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -36,6 +36,22 @@
main(new TestRSAKeyLength());
}
public void main(Provider p) throws Exception {
+
+ /*
+ * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+ * when running SunPKCS11-Solaris (8044554)
+ */
+ if (p.getName().equals("SunPKCS11-Solaris") &&
+ System.getProperty("os.name").equals("SunOS") &&
+ System.getProperty("os.arch").equals("sparcv9") &&
+ System.getProperty("os.version").compareTo("5.11") <= 0 &&
+ getDistro().compareTo("11.2") < 0) {
+
+ System.out.println("SunPKCS11-Solaris provider requires " +
+ "Solaris SPARC 11.2 or later, skipping");
+ return;
+ }
+
boolean isValidKeyLength[] = { true, true, true, false, false };
String algos[] = { "SHA1withRSA", "SHA224withRSA", "SHA256withRSA",
"SHA384withRSA", "SHA512withRSA" };
--- a/jdk/test/sun/security/pkcs11/ec/TestCurves.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/ec/TestCurves.java Wed Aug 12 14:38:09 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, 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
@@ -58,6 +58,21 @@
return;
}
+ /*
+ * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+ * when running SunPKCS11-Solaris (8044554)
+ */
+ if (p.getName().equals("SunPKCS11-Solaris") &&
+ System.getProperty("os.name").equals("SunOS") &&
+ System.getProperty("os.arch").equals("sparcv9") &&
+ System.getProperty("os.version").compareTo("5.11") <= 0 &&
+ getDistro().compareTo("11.2") < 0) {
+
+ System.out.println("SunPKCS11-Solaris provider requires " +
+ "Solaris SPARC 11.2 or later, skipping");
+ return;
+ }
+
// Check if this is sparc for later failure avoidance.
boolean sparc = false;
if (System.getProperty("os.arch").equals("sparcv9")) {
--- a/jdk/test/sun/security/pkcs11/ec/TestECDSA.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/ec/TestECDSA.java Wed Aug 12 14:38:09 2015 +0100
@@ -124,6 +124,21 @@
}
/*
+ * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+ * when running SunPKCS11-Solaris (8044554)
+ */
+ if (provider.getName().equals("SunPKCS11-Solaris") &&
+ System.getProperty("os.name").equals("SunOS") &&
+ System.getProperty("os.arch").equals("sparcv9") &&
+ System.getProperty("os.version").compareTo("5.11") <= 0 &&
+ getDistro().compareTo("11.2") < 0) {
+
+ System.out.println("SunPKCS11-Solaris provider requires " +
+ "Solaris SPARC 11.2 or later, skipping");
+ return;
+ }
+
+ /*
* PKCS11Test.main will remove this provider if needed
*/
Providers.setAt(provider, 1);
--- a/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java Wed Aug 12 14:38:09 2015 +0100
@@ -47,6 +47,22 @@
}
public void main(Provider p) throws Exception {
+
+ /*
+ * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+ * when running SunPKCS11-Solaris (8044554)
+ */
+ if (p.getName().equals("SunPKCS11-Solaris") &&
+ System.getProperty("os.name").equals("SunOS") &&
+ System.getProperty("os.arch").equals("sparcv9") &&
+ System.getProperty("os.version").compareTo("5.11") <= 0 &&
+ getDistro().compareTo("11.2") < 0) {
+
+ System.out.println("SunPKCS11-Solaris provider requires " +
+ "Solaris SPARC 11.2 or later, skipping");
+ return;
+ }
+
long start = System.currentTimeMillis();
Providers.setAt(p, 1);
try {
--- a/jdk/test/sun/security/pkcs11/rsa/TestSignatures.java Tue Aug 11 12:33:25 2015 -0700
+++ b/jdk/test/sun/security/pkcs11/rsa/TestSignatures.java Wed Aug 12 14:38:09 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -97,6 +97,22 @@
}
public void main(Provider p) throws Exception {
+
+ /*
+ * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+ * when running SunPKCS11-Solaris (8044554)
+ */
+ if (p.getName().equals("SunPKCS11-Solaris") &&
+ System.getProperty("os.name").equals("SunOS") &&
+ System.getProperty("os.arch").equals("sparcv9") &&
+ System.getProperty("os.version").compareTo("5.11") <= 0 &&
+ getDistro().compareTo("11.2") < 0) {
+
+ System.out.println("SunPKCS11-Solaris provider requires " +
+ "Solaris SPARC 11.2 or later, skipping");
+ return;
+ }
+
long start = System.currentTimeMillis();
provider = p;
data = new byte[2048];