From 5b4309883db9533a5378ea9c0771549bc12d1063 Mon Sep 17 00:00:00 2001 From: "lvfei.lv" Date: Thu, 15 Jun 2023 16:13:18 +0800 Subject: [PATCH] Enable aqavit-test in alpine-linux container(#4625) --- buildenv/jenkins/JenkinsfileBase | 4 ++-- buildenv/jenkins/openjdk_tests | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/buildenv/jenkins/JenkinsfileBase b/buildenv/jenkins/JenkinsfileBase index 4fb124b799..8144ed652c 100644 --- a/buildenv/jenkins/JenkinsfileBase +++ b/buildenv/jenkins/JenkinsfileBase @@ -454,7 +454,7 @@ def setup() { dir( WORKSPACE) { // use sshagent with Jenkins credentials ID for all platforms except zOS // on zOS use the user's ssh key - if (!env.SPEC.startsWith('zos')) { + if (!env.SPEC.startsWith('zos') && !(env.SPEC.contains('alpine-linux') && env.DOCKER_REQUIRED)) { get_sources_with_authentication() } else { get_sources() @@ -553,7 +553,7 @@ def makeCompileTest(){ makeTestCmd = "unset LD_LIBRARY_PATH; $makeTestCmd" } dir('aqa-tests') { - if (!env.SPEC.startsWith('zos')) { + if (!env.SPEC.startsWith('zos') && !(env.SPEC.contains('alpine-linux') && env.DOCKER_REQUIRED)) { sshagent (credentials: ["$params.SSH_AGENT_CREDENTIAL"], ignoreMissing: true) { sh "$makeTestCmd"; } diff --git a/buildenv/jenkins/openjdk_tests b/buildenv/jenkins/openjdk_tests index 5130945331..d8195dabec 100644 --- a/buildenv/jenkins/openjdk_tests +++ b/buildenv/jenkins/openjdk_tests @@ -94,6 +94,7 @@ def PLATFORM_MAP = [ 'x86-64_alpine-linux' : [ 'SPEC' : 'alpine-linux_x86-64', 'LABEL' : 'ci.role.test&&hw.arch.x86&&sw.os.alpine-linux', + 'DockerAgents' : ['default'] ], 'x86-32_linux' : [ 'SPEC' : 'linux_x86', @@ -338,6 +339,14 @@ timestamps{ LABEL += '&&hw.arch.x86' if (!LABEL.contains('&&sw.tool.docker')) { LABEL += '&&sw.tool.docker' + env.DOCKER_REQUIRED = true + } + } + if (dockerAgentLabel.equals('default') && SPEC.equals('alpine-linux_x86-64')) { + LABEL = LABEL.minus("&&sw.os.alpine-linux") + if (!LABEL.contains('&&sw.tool.docker')) { + LABEL += '&&sw.tool.docker' + env.DOCKER_REQUIRED = true } } println "Cannot find any idle nodes. Starting run test on docker node, nodeLabel: '${LABEL}', dockerAgentLabel: '${dockerAgentLabel}'" @@ -445,10 +454,17 @@ def runTest() { // Automatically registers foreign file formats with the kernel using binfmt_static to simplify execution of multi-architecture binaries and Docker containers // In fact, this command only needs to be executed once sh "docker run --rm --privileged multiarch/qemu-user-static --reset -p yes" + // Dockerfile: https://github.com/dragonwell-project/docker-qemu-riscv64/blob/master/Dockerfile docker.image('alibabadragonwell/riscv-normal-qemu_6.0.0-rvv-1.0:latest').pull() // The ${HOME} directory must be mounted, otherwise xvfb will fail to startup docker.image('alibabadragonwell/riscv-normal-qemu_6.0.0-rvv-1.0:latest').inside("-v ${env.HOME}:${env.HOME}") { jenkinsfile.testBuild() + } else if (dockerAgentLabel.equals('default') && LABEL.contains('&&sw.tool.docker') && SPEC.equals('alpine-linux_x86-64')) { + // Dockerfile: https://github.com/dragonwell-releng/aqa-tests-dockerfile/blob/main/alpine-linux_test.Dockerfile + docker.image('alibabadragonwelljdk/alpine_test_image').pull() + docker.image('alibabadragonwelljdk/alpine_test_image').inside("-v ${env.HOME}:${env.HOME} --network host --privileged -v /etc/hosts:/etc/hosts:ro -v /etc/group:/etc/group:ro -v /etc/passwd:/etc/passwd:ro -v /etc/shadow:/etc/shadow:ro") { + jenkinsfile.testBuild() + } } } else { jenkinsfile.testBuild() @@ -611,4 +627,4 @@ def generateJobViaAutoGen(testJobName) { build job: 'Test_Job_Auto_Gen', parameters: jobParams, propagate: true } -} \ No newline at end of file +}