8177017: com/oracle/security/ucrypto/TestAES.java fails intermittently
authormli
Mon, 17 Jul 2017 23:11:46 -0700
changeset 45876 027bfd63b502
parent 45875 5fa4efe2aca3
child 45877 640f1904ebb8
8177017: com/oracle/security/ucrypto/TestAES.java fails intermittently Summary: Skips CFB128 related cases on Solaris pre-11.3 versions. Reviewed-by: valeriep Contributed-by: John Jiang <sha.jiang@oracle.com>
test/lib/jdk/test/lib/Utils.java
--- a/test/lib/jdk/test/lib/Utils.java	Fri Jul 14 13:02:27 2017 -0700
+++ b/test/lib/jdk/test/lib/Utils.java	Mon Jul 17 23:11:46 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, 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
@@ -680,5 +680,26 @@
                 String.format("A mandatory property '%s' isn't set", propName));
         return prop;
     }
+
+    /*
+     * Run uname with specified arguments.
+     */
+    public static OutputAnalyzer uname(String... args) throws Throwable {
+        String[] cmds = new String[args.length + 1];
+        cmds[0] = "uname";
+        System.arraycopy(args, 0, cmds, 1, args.length);
+        return ProcessTools.executeCommand(cmds);
+    }
+
+    /*
+     * Returns the system distro.
+     */
+    public static String distro() {
+        try {
+            return uname("-v").asLines().get(0);
+        } catch (Throwable t) {
+            throw new RuntimeException("Failed to determine distro.", t);
+        }
+    }
 }