Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Crypotests #4319

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions functional/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0"?>

<!--
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This material would not be Copyright IBM, but rather

<!--
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file was added by accident. Removed.

Copyright (c) 2018, 2018 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] https://openjdk.org/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
-->

<project name="BUILD_FUNCTIONAL_TEST" default="build_functional" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
Build functional tests
</description>

<!-- set properties for this build -->
<property name="DEST_FUNCTIONAL" value="${BUILD_ROOT}/functional" />

<target name="dist_functional" >
<mkdir dir="${DEST_FUNCTIONAL}" />
<copy todir="${DEST_FUNCTIONAL}">
<fileset dir="${TEST_ROOT}/functional" includes="*.mk,*.xml"/>
</copy>
</target>

<target name="build_functional" depends="dist_functional">
<if>
<equals arg1="${JDK_VERSION}" arg2="Panama"/>
<then>
<subant target="">
<fileset dir="./">
<include name="Panama/build.xml" />
</fileset>
</subant>
</then>
<else>
<subant target="">
<fileset dir="." includes="*/build.xml" >
<exclude name="Panama/build.xml" />
</fileset>
</subant>
</else>
</if>
</target>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
# limitations under the License.
-->

<project name="Security Functional tests" default="build" basedir=".">
<project name="Adotpium Security Functional tests" default="build" basedir=".">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<project name="Adotpium Security Functional tests" default="build" basedir=".">
<project name="Adoptium Security Functional tests" default="build" basedir=".">

<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
Security Functional tests
</description>
<import file="${TEST_ROOT}/functional/build.xml"/>
Adotpium Security Functional tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Adotpium Security Functional tests
Adoptium Security Functional tests

</description>
<!-- <import file="${TEST_ROOT}/functional/build.xml"/> -->

<!-- set global properties for this build -->
<property name="DEST" value="${BUILD_ROOT}/functional/security" />
<property name="DEST" value="${BUILD_ROOT}/functional/security/Adoptium" />

<!--Properties for this particular build-->
<property name="src" location="./src" />
Expand All @@ -32,7 +32,7 @@
<mkdir dir="${DEST}" />
<mkdir dir="${build}" />
</target>

<target name="compile" depends="init" description="Using java ${JDK_VERSION} to compile the source ">
<echo>Ant version is ${ant.version}</echo>
<echo>============COMPILER SETTINGS============</echo>
Expand Down
File renamed without changes.
98 changes: 98 additions & 0 deletions functional/security/Crypto/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0"?>

<!--
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->

<project name="Crypto Security Functional tests" default="build" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
Crypto Security Functional tests
</description>
<!-- <import file="${TEST_ROOT}/functional/build.xml"/> -->

<!-- set global properties for this build -->
<property name="DEST" value="${BUILD_ROOT}/functional/security/Crypto" />

<!--Properties for this particular build-->
<property name="src" location="./CryptoTest/cryptotest" />
<property name="build" location="./bin" />

<target name="cryptoTest.check">
<condition property="cryptoTestdir.exists">
<available file="CryptoTest" type="dir"/>
</condition>
</target>

<target name="getCryptoTest" depends="cryptoTest.check" unless="cryptoTestdir.exists">
<exec executable="git" failonerror="true">
<arg value="clone" />
<arg value="https://github.com/rh-openjdk/CryptoTest.git" />
</exec>
</target>



<target name="init">
<mkdir dir="${DEST}" />
<mkdir dir="${build}" />
</target>

<target name="compile" depends="init,getCryptoTest" description="Using java ${JDK_VERSION} to compile the source ">
<echo>Ant version is ${ant.version}</echo>
<echo>============COMPILER SETTINGS============</echo>
<echo>===fork: yes</echo>
<echo>===executable: ${compiler.javac}</echo>
<echo>===debug: on</echo>
<echo>===destdir: ${DEST}</echo>

<if>
<equals arg1="${JDK_VERSION}" arg2="8"/>
<then>
<property name="extraOptions" value="-XDignore.symbol.file=true" />
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
<src path="${src}" />
<compilerarg line='${extraOptions}' />
</javac>
</then>
<else>
<property name="addExports" value="--add-reads java.base=ALL-UNNAMED --add-exports java.base/com.sun.crypto.provider=ALL-UNNAMED --add-exports java.base/sun.security.internal.spec=ALL-UNNAMED --add-exports java.base/sun.security.ssl=ALL-UNNAMED --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-reads java.security.jgss=ALL-UNNAMED --add-exports java.security.jgss/sun.security.jgss=ALL-UNNAMED --add-exports java.security.jgss/sun.security.jgss.krb5=ALL-UNNAMED --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-reads java.xml.crypto=ALL-UNNAMED --add-exports java.xml.crypto/org.jcp.xml.dsig.internal.dom=ALL-UNNAMED --add-modules=jdk.crypto.ec --add-reads jdk.crypto.ec=ALL-UNNAMED --add-exports jdk.crypto.ec/sun.security.ec=ALL-UNNAMED"/>
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
<src path="${src}" />
<compilerarg line='${addExports}' />
</javac>
</else>
</if>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<copy todir="${build}/cryptotest/tests">
<fileset file="${src}/tests/test.jks" />
</copy>
<jar jarfile="${DEST}/CryptoTests.jar" filesonly="true">
<fileset dir="${build}" />
</jar>
<copy todir="${DEST}">
<fileset dir="${src}/../../" includes="*.xml,*.mk" />
<fileset file="${src}/tests/test.jks" />
</copy>
</target>

<target name="clean" depends="dist" description="clean up">
<!-- Delete the ${build} directory trees -->
<delete dir="${build}" />
</target>

<target name="build" >
<antcall target="clean" inheritall="true" />
</target>
</project>
18 changes: 18 additions & 0 deletions functional/security/Crypto/crypto.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
##############################################################################
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################
ifneq ($(JDK_VERSION),8)
JAVA_MOD_ARGS=--add-reads java.base=ALL-UNNAMED --add-exports java.base/com.sun.crypto.provider=ALL-UNNAMED --add-exports java.base/sun.security.internal.spec=ALL-UNNAMED --add-exports java.base/sun.security.ssl=ALL-UNNAMED --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-reads java.security.jgss=ALL-UNNAMED --add-exports java.security.jgss/sun.security.jgss=ALL-UNNAMED --add-exports java.security.jgss/sun.security.jgss.krb5=ALL-UNNAMED --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-reads java.xml.crypto=ALL-UNNAMED --add-exports java.xml.crypto/org.jcp.xml.dsig.internal.dom=ALL-UNNAMED --add-modules=jdk.crypto.ec --add-reads jdk.crypto.ec=ALL-UNNAMED --add-exports jdk.crypto.ec/sun.security.ec=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED
else
JAVA_MOD_ARGS=
endif
29 changes: 29 additions & 0 deletions functional/security/Crypto/playlist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->

<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../TKG/playlist.xsd">
<include>crypto.mk</include>
<test>
<testCaseName>CryptoTests</testCaseName>
<command>$(JAVA_COMMAND) $(JVM_OPTIONS) $(JAVA_MOD_ARGS) -cp $(Q)$(RESOURCES_DIR)$(P)$(TEST_RESROOT)$(D)CryptoTests.jar$(P)$(TEST_RESROOT)$(D)test.jks$(Q) -Dcryptotests.skipAgentTests=1 cryptotest.CryptoTest; \
$(TEST_STATUS)</command>
<levels>
<level>extended</level>
</levels>
<groups>
<group>functional</group>
</groups>
</test>
</playlist>