jdk/test/sun/security/pkcs11/Signature/ReinitSignature.java
changeset 32138 23830562d3d1
parent 30046 cf2c86e1819e
child 40975 680639c9b307
--- 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();