diff --git a/buildenv/jenkins/JenkinsfileBase b/buildenv/jenkins/JenkinsfileBase index abf8568bc4..84aac05e14 100644 --- a/buildenv/jenkins/JenkinsfileBase +++ b/buildenv/jenkins/JenkinsfileBase @@ -756,8 +756,13 @@ def runTest( ) { echo "env.DISPLAY is ${env.DISPLAY}" makeTest("${RUNTEST_CMD}") } - } else { - makeTest("${RUNTEST_CMD}") + } else if (BUILD_LIST.contains('external')) { + sshagent (credentials: ["$params.SSH_AGENT_CREDENTIAL"], ignoreMissing: true) { + makeTest("${RUNTEST_CMD}") + } + } + else { + makeTest("${RUNTEST_CMD}") } } diff --git a/external/build_image.sh b/external/build_image.sh index 99e8fa6bde..99758c770a 100755 --- a/external/build_image.sh +++ b/external/build_image.sh @@ -63,7 +63,7 @@ function build_image() { echo "The test in the build_image() function is ${test}" # Used for tagging the image tags="adoptopenjdk-${test}-test:${version}-${package}-${os}-${vm}-${build}" - if [[ "$test" == *"criu"* ]]; then + if [[ "$test" == *"criu"* || "$test" == *"tck"* ]]; then container_build="sudo podman build" fi diff --git a/external/common_functions.sh b/external/common_functions.sh index 3d3b63b223..1b8686d78c 100755 --- a/external/common_functions.sh +++ b/external/common_functions.sh @@ -26,7 +26,7 @@ supported_packages="jdk jre" supported_builds="full" # Supported tests -supported_tests="external_custom camel criu-functional criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tomcat tomee wildfly wycheproof netty spring zookeeper" +supported_tests="external_custom camel criu-functional criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tck-ubi-test tomcat tomee wildfly wycheproof netty spring zookeeper" function check_os() { os=$1 diff --git a/external/dockerfile_functions.sh b/external/dockerfile_functions.sh index e3932d8f96..9fa59f9f50 100755 --- a/external/dockerfile_functions.sh +++ b/external/dockerfile_functions.sh @@ -75,12 +75,13 @@ sanitize_test_names() { print_image_args() { local file=$1 - local os=$2 - local version=$3 - local vm=$4 - local package=$5 - local build=$6 - local base_docker_registry_dir="$7" + local test=$2 + local os=$3 + local version=$4 + local vm=$5 + local package=$6 + local build=$7 + local base_docker_registry_dir="$8" image_name="eclipse-temurin" tag="" @@ -93,8 +94,11 @@ print_image_args() { if [[ "${os}" == "ubuntu" ]]; then image_name="docker.io/ibm-semeru-runtimes" tag=open-${tag} + elif [[ "${os}" == *"ubi"* && "${test}" != *"criu"* ]]; then + image_name="registry.access.redhat.com/$base_docker_registry_dir" + tag="latest" else - # os is ubi + # os is ubi, and test is criu # temporarily all ubi based testing use internal base image image_name="$DOCKER_REGISTRY_URL/$base_docker_registry_dir" tag="latest" @@ -163,6 +167,18 @@ print_jdk_install() { "\n\t BUILD_ID_LAST_SUCCESS=\$(wget -qO- https://openj9-jenkins.osuosl.org/job/Build_JDK11_x86-64_linux_Nightly/lastSuccessfulBuild/buildNumber); \\" \ "\n\t BINARY_URL=\$(wget -qO- https://openj9-jenkins.osuosl.org/job/Build_JDK11_x86-64_linux_Nightly/lastSuccessfulBuild/consoleText | grep -Po \"(?<=Deploying artifact: )https://openj9-artifactory.osuosl.org/artifactory/ci-openj9/Build_JDK11_x86-64_linux_Nightly/\${BUILD_ID_LAST_SUCCESS}/OpenJ9-JDK11-x86-64_linux.*tar.gz\"); \\" \ "\n\t ;; \\" \ + "\n\t *aarch64*) \\" \ + "\n\t BUILD_ID_LAST_SUCCESS=\$(wget -qO- https://openj9-jenkins.osuosl.org/job/Build_JDK11_aarch64_linux_Nightly/lastSuccessfulBuild/buildNumber); \\" \ + "\n\t BINARY_URL=\$(wget -qO- https://openj9-jenkins.osuosl.org/job/Build_JDK11_aarch64_linux_Nightly/lastSuccessfulBuild/consoleText | grep -Po \"(?<=Deploying artifact: )https://openj9-artifactory.osuosl.org/artifactory/ci-openj9/Build_JDK11_aarch64_linux_Nightly/\${BUILD_ID_LAST_SUCCESS}/OpenJ9-JDK11-aarch64_linux.*tar.gz\"); \\" \ + "\n\t ;; \\" \ + "\n\t *390*) \\" \ + "\n\t BUILD_ID_LAST_SUCCESS=\$(wget -qO- https://openj9-jenkins.osuosl.org/job/Build_JDK11_s390x_linux_Nightly/lastSuccessfulBuild/buildNumber); \\" \ + "\n\t BINARY_URL=\$(wget -qO- https://openj9-jenkins.osuosl.org/job/Build_JDK11_s390x_linux_Nightly/lastSuccessfulBuild/consoleText | grep -Po \"(?<=Deploying artifact: )https://openj9-artifactory.osuosl.org/artifactory/ci-openj9/Build_JDK11_s390x_linux_Nightly/\${BUILD_ID_LAST_SUCCESS}/OpenJ9-JDK11-s390x_linux.*tar.gz\"); \\" \ + "\n\t ;; \\" \ + "\n\t *ppc*) \\" \ + "\n\t BUILD_ID_LAST_SUCCESS=\$(wget -qO- https://openj9-jenkins.osuosl.org/job/Build_JDK11_ppc64le_linux_Nightly/lastSuccessfulBuild/buildNumber); \\" \ + "\n\t BINARY_URL=\$(wget -qO- https://openj9-jenkins.osuosl.org/job/Build_JDK11_ppc64le_linux_Nightly/lastSuccessfulBuild/consoleText | grep -Po \"(?<=Deploying artifact: )https://openj9-artifactory.osuosl.org/artifactory/ci-openj9/Build_JDK11_ppc64le_linux_Nightly/\${BUILD_ID_LAST_SUCCESS}/OpenJ9-JDK11-ppc64le_linux.*tar.gz\"); \\" \ + "\n\t ;; \\" \ "\n\t *) \\" \ "\n\t echo \"Unsupported platform \"; \\" \ "\n\t exit 1; \\" \ @@ -500,7 +516,7 @@ print_clone_project() { # Cause Test name to be capitalized test_tag="$(sanitize_test_names ${test} | tr a-z A-Z)_TAG" git_branch_tag="master" - if [[ "$test_tag" != *"CRIU"* ]]; then + if [[ "$test_tag" != *"CRIU"* && "$test_tag" != *"TCK"* ]]; then git_branch_tag=$test_tag fi @@ -586,7 +602,7 @@ generate_dockerfile() { echo -n "Writing ${file} ... " print_legal ${file}; print_adopt_test ${file} ${test}; - print_image_args ${file} ${os} ${version} ${vm} ${package} ${build} "${base_docker_registry_dir}"; + print_image_args ${file} ${test} ${os} ${version} ${vm} ${package} ${build} "${base_docker_registry_dir}"; print_result_comment_arg ${file}; print_test_tag_arg ${file} ${test} ${tag_version}; print_${os}_pkg ${file} "${!packages}"; diff --git a/external/external.sh b/external/external.sh index d51e206ac9..8bb77a9ad1 100755 --- a/external/external.sh +++ b/external/external.sh @@ -61,7 +61,7 @@ usage () { echo 'Usage : external.sh --dir TESTDIR --tag DOCKERIMAGE_TAG --version JDK_VERSION --impl JDK_IMPL [--docker_os docker_os][--platform PLATFORM] [--portable portable] [--node_name node_name] [--node_labels node_labels] [--docker_registry_required docker_registry_required] [--docker_registry_url DOCKER_REGISTRY_URL] [--docker_registry_dir DOCKER_REGISTRY_DIR] [--base_docker_registry_url baseDockerRegistryUrl] [--base_docker_registry_dir baseDockerRegistryDir] [--mount_jdk mount_jdk] [--test_root TEST_ROOT] [--reportsrc appReportDir] [--reportdst REPORTDIR] [--testtarget target] [--docker_args EXTRA_DOCKER_ARGS] [--build|--run|--load|--clean]' } -supported_tests="external_custom aot camel criu-functional criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tomcat tomee wildfly wycheproof netty spring" +supported_tests="external_custom aot camel criu-functional criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tck-ubi-test tomcat tomee wildfly wycheproof netty spring" function check_test() { test=$1 @@ -98,7 +98,7 @@ parseCommandLineArgs() { docker_os=ubi fi - if [[ "${test}" == *"criu"* ]]; then + if [[ "${test}" == *"criu"* || "${test}" == *"tck"* ]]; then container_run="sudo podman run" container_login="sudo podman login" container_inspect="sudo podman inspect" @@ -127,6 +127,9 @@ parseCommandLineArgs() { parse_docker_args $docker_args; fi;; + "--docker_os" | "-dos" ) + docker_os="$1"; shift;; + "--tag" | "-t" ) if [ -z "$1" ]; then echo "No DOCKERIMAGE_TAG set, tag as default 'nightly'"; diff --git a/external/tck-ubi-test/build.xml b/external/tck-ubi-test/build.xml new file mode 100644 index 0000000000..3bad95e42f --- /dev/null +++ b/external/tck-ubi-test/build.xml @@ -0,0 +1,70 @@ + + + + + Build tck-ubi-test Docker image + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/tck-ubi-test/playlist.xml b/external/tck-ubi-test/playlist.xml new file mode 100644 index 0000000000..4ba9985c26 --- /dev/null +++ b/external/tck-ubi-test/playlist.xml @@ -0,0 +1,38 @@ + + + + + tck-ubi-test + $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir tck-ubi-test --testtarget "_testList TESTLIST=jck-runtime-api-javax_annotation" --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS) -v ${BUILD_ROOT}/external/tck-ubi-test/jck_root/JCK${JDK_VERSION}-unzipped:/opt/jck_root/unzipped -v $(TEST_ROOT):/opt/test_root"; \ + $(TEST_STATUS); \ + $(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir tck-ubi-test + + + + Only applicable on xlinux, plinux, alinux, and zlinux atm + ^((?!(x86-64_linux|ppc64le_linux|aarch64_linux|s390x_linux)).)*$ + + + + openj9 + + + special + + + external + + + diff --git a/external/tck-ubi-test/test.properties b/external/tck-ubi-test/test.properties new file mode 100644 index 0000000000..8631b96613 --- /dev/null +++ b/external/tck-ubi-test/test.properties @@ -0,0 +1,8 @@ +github_url="https://github.com/adoptium/aqa-tests.git" +test_results="testResults" +gradle_version="5.1" +environment_variable="MODE=java CC=gcc-7 CXX=g++-7" +ubi_packages="git wget perl tzdata openssl ca-certificates fontconfig glibc-langpack-en gzip tar" +ant_version="1.10.5" +ant_contrib_version="1.0b3" +jdk_install="true" diff --git a/external/tck-ubi-test/test.sh b/external/tck-ubi-test/test.sh new file mode 100644 index 0000000000..c69362bc43 --- /dev/null +++ b/external/tck-ubi-test/test.sh @@ -0,0 +1,55 @@ +#/bin/bash +# 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 +# +# http://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. +# + +source $(dirname "$0")/test_base_functions.sh + +MOUNTED_JDK_DIR="/opt/java/openjdk" +New_JDK_DIR="/internaljdk/java/openjdk" +if [ -d "$MOUNTED_JDK_DIR" ]; then + mkdir -p $New_JDK_DIR + cp -r $MOUNTED_JDK_DIR/* $New_JDK_DIR/ + export TEST_JDK_HOME=$New_JDK_DIR + echo "TEST_JDK_HOME is : $TEST_JDK_HOME" +else + echo "No JDK found!" + exit 1 +fi + +echo_setup +export JDK_VERSION= +echo "TEST_JDK_HOME has been unset, use auto-detect instead." +export DYNAMIC_COMPILE=false +export BUILD_LIST=jck + +export STAGE_JCK_MATERIAL_FROM_GIT=false +mkdir /jck_unzipped +cp -r /opt/jck_root/unzipped/* /jck_unzipped/ +export JCK_ROOT=/jck_unzipped +export JCK_ROOT_USED=${JCK_ROOT} +echo "JCK_ROOT in docker is ${JCK_ROOT}" +echo "JCK_ROOT_USED in docker is ${JCK_ROOT_USED}" +export DISPLAY = "unix:0" +echo "DISPLAY in docker is ${DISPLAY}" + +set -e +cd /aqa-tests +./get.sh +rm -rf /aqa-tests/jck +cp -R /opt/test_root/jck /aqa-tests/ + +cd /aqa-tests/TKG +echo "Generating make files and running the target tests" +make compile +make $1 +set +e diff --git a/get.sh b/get.sh index cadca89282..e31228a25c 100755 --- a/get.sh +++ b/get.sh @@ -629,7 +629,7 @@ getVendorTestMaterial() { if [[ "$dir" =~ "jck" ]]; then echo "BUILD_LIST is $BUILD_LIST" - if [[ "$BUILD_LIST" =~ "jck" || "$BUILD_LIST" =~ "all" ]]; then + if [[ "$BUILD_LIST" =~ "jck" || "$BUILD_LIST" =~ "external" ||"$BUILD_LIST" =~ "all" ]]; then echo "Remove existing subdir. $repoURL will be used..." rm -rf jck else