From 618b1dbbfba28dec5d22de040ac59d27d0e92d82 Mon Sep 17 00:00:00 2001 From: John Jiang Date: Mon, 17 Jul 2017 23:11:46 -0700 Subject: [PATCH] 8177017: com/oracle/security/ucrypto/TestAES.java fails intermittently Skips CFB128 related cases on Solaris pre-11.3 versions. Reviewed-by: valeriep --- test/lib/jdk/test/lib/Utils.java | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/lib/jdk/test/lib/Utils.java b/test/lib/jdk/test/lib/Utils.java index 6f83759666f..08a95a7d424 100644 --- a/test/lib/jdk/test/lib/Utils.java +++ b/test/lib/jdk/test/lib/Utils.java @@ -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 @@ public final class Utils { 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); + } + } }