From 17eae03f8624036ddbd655f000479ef8fec1cf15 Mon Sep 17 00:00:00 2001 From: lanxia Date: Tue, 22 Jan 2019 08:43:17 -0500 Subject: [PATCH 1/3] add cmdLineTester_CryptoTest for OpenSSL - Temporarily exclude on aix until OpenSSL is enabled on aix - Temporarily exclude on osx for both jdk8 and 11 and exclude on win for jdk11 until the issue is fixed. Issue: #4092 [ci skip] Signed-off-by: lanxia --- .../functional/cmdLineTests/openssl/build.xml | 70 +++++++++++++++++ .../cmdLineTests/openssl/openssl.xml | 38 +++++++++ .../cmdLineTests/openssl/playlist.xml | 77 +++++++++++++++++++ .../org/openj9/test/openssl/CryptoTest.java | 37 +++++++++ 4 files changed, 222 insertions(+) create mode 100644 test/functional/cmdLineTests/openssl/build.xml create mode 100644 test/functional/cmdLineTests/openssl/openssl.xml create mode 100644 test/functional/cmdLineTests/openssl/playlist.xml create mode 100644 test/functional/cmdLineTests/openssl/src/org/openj9/test/openssl/CryptoTest.java diff --git a/test/functional/cmdLineTests/openssl/build.xml b/test/functional/cmdLineTests/openssl/build.xml new file mode 100644 index 00000000000..cb3d8b505fd --- /dev/null +++ b/test/functional/cmdLineTests/openssl/build.xml @@ -0,0 +1,70 @@ + + + + + + + + Build cmdLineTests_OpenSSL + + + + + + + + + + + + + + + Ant version is ${ant.version} + ============COMPILER SETTINGS============ + ===fork: yes + ===executable: ${compiler.javac} + ===debug: on + ===destdir: ${DEST} + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/functional/cmdLineTests/openssl/openssl.xml b/test/functional/cmdLineTests/openssl/openssl.xml new file mode 100644 index 00000000000..f85dc302162 --- /dev/null +++ b/test/functional/cmdLineTests/openssl/openssl.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + $EXE$ -Djdk.nativeCryptoTrace=true $CLASSPATH$ org.openj9.test.openssl.CryptoTest + using Native crypto library + Crypto test COMPLETED + Native crypto library load failed + Crypto test FAILED + + diff --git a/test/functional/cmdLineTests/openssl/playlist.xml b/test/functional/cmdLineTests/openssl/playlist.xml new file mode 100644 index 00000000000..c910b682388 --- /dev/null +++ b/test/functional/cmdLineTests/openssl/playlist.xml @@ -0,0 +1,77 @@ + + + + + + + cmdLineTester_CryptoTest + + NoOptions + + $(JAVA_COMMAND) $(JVM_OPTIONS) \ + -DTEST_RESROOT=$(Q)$(TEST_RESROOT)$(D)$(Q) -DRESJAR=$(CMDLINETESTER_RESJAR) \ + -DEXE='$(JAVA_COMMAND) $(JVM_OPTIONS)' -jar $(CMDLINETESTER_JAR) -config $(Q)$(TEST_RESROOT)$(D)openssl.xml$(Q) \ + -verbose -explainExcludes -nonZeroExitWhenError; \ + $(TEST_STATUS) + + + ^os.aix,^os.osx + + sanity + + + functional + + + 8 + 9 + 10 + + + + cmdLineTester_CryptoTest_11 + + NoOptions + + $(JAVA_COMMAND) $(JVM_OPTIONS) \ + -DTEST_RESROOT=$(Q)$(TEST_RESROOT)$(D)$(Q) -DRESJAR=$(CMDLINETESTER_RESJAR) \ + -DEXE='$(JAVA_COMMAND) $(JVM_OPTIONS)' -jar $(CMDLINETESTER_JAR) -config $(Q)$(TEST_RESROOT)$(D)openssl.xml$(Q) \ + -verbose -explainExcludes -nonZeroExitWhenError; \ + $(TEST_STATUS) + + + ^os.aix,^os.osx,^os.win + + sanity + + + functional + + + 11 + + + \ No newline at end of file diff --git a/test/functional/cmdLineTests/openssl/src/org/openj9/test/openssl/CryptoTest.java b/test/functional/cmdLineTests/openssl/src/org/openj9/test/openssl/CryptoTest.java new file mode 100644 index 00000000000..190499ffb4f --- /dev/null +++ b/test/functional/cmdLineTests/openssl/src/org/openj9/test/openssl/CryptoTest.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2019, 2019 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +package org.openj9.test.openssl; + +import java.security.KeyFactory; + +public class CryptoTest { + public static void main(String[] args) { + try { + KeyFactory.getInstance("RSA"); + System.out.println("Crypto test COMPLETED"); + } catch (Exception e) { + System.out.println("Crypto test FAILED"); + e.printStackTrace(); + } + } +} \ No newline at end of file From a775ed28a7fdc4e80243173f44a104a5f7160550 Mon Sep 17 00:00:00 2001 From: smlambert Date: Wed, 23 Jan 2019 21:24:26 -0500 Subject: [PATCH 2/3] Exclude from ibm impl Signed-off-by: smlambert --- test/functional/cmdLineTests/openssl/playlist.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/cmdLineTests/openssl/playlist.xml b/test/functional/cmdLineTests/openssl/playlist.xml index c910b682388..be3879860ca 100644 --- a/test/functional/cmdLineTests/openssl/playlist.xml +++ b/test/functional/cmdLineTests/openssl/playlist.xml @@ -44,6 +44,9 @@ functional + + openj9 + 8 9 @@ -70,6 +73,9 @@ functional + + openj9 + 11 From 1c81ba59f2b22c7deed652c03a5ea38b58ef8122 Mon Sep 17 00:00:00 2001 From: smlambert Date: Wed, 23 Jan 2019 21:31:11 -0500 Subject: [PATCH 3/3] Restrict openssl test from running on IBM impl Signed-off-by: smlambert --- test/functional/Java8andUp/playlist.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/functional/Java8andUp/playlist.xml b/test/functional/Java8andUp/playlist.xml index d8a29fe6e64..e5dd306ca1b 100644 --- a/test/functional/Java8andUp/playlist.xml +++ b/test/functional/Java8andUp/playlist.xml @@ -768,6 +768,9 @@ functional + + openj9 +