From 6d3be5a82133c371b678e1d303af0b74ddb32673 Mon Sep 17 00:00:00 2001 From: lilyLuLiu Date: Tue, 19 Nov 2024 12:39:47 +0800 Subject: [PATCH] [QE]fix github action error for Linux arm64 test --- .github/workflows/linux-qe-template.yml | 33 ++++++++++++++++--------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/linux-qe-template.yml b/.github/workflows/linux-qe-template.yml index c63f4f22b5..f692b84450 100644 --- a/.github/workflows/linux-qe-template.yml +++ b/.github/workflows/linux-qe-template.yml @@ -32,6 +32,8 @@ jobs: - name: prepare run: | sudo yum install podman openssh-server -y + + # Get origin commit sha for testing commit_sha=$(cat gh_context.json | jq -r '.event.after') if [[ -z "${commit_sha}" ]] || [[ "${commit_sha}" == null ]]; then # on first PR creation .event.after is empty, then .sha is used as commit instead @@ -39,6 +41,16 @@ jobs: fi echo "commit_sha=${commit_sha}" >> "$GITHUB_ENV" + # Set status_context + status_context="ci/gh/${{inputs.qe-type}}" + if [[ "${{inputs.qe-type}}" == "e2e" ]]; then + status_context="${status_context}-${{inputs.preset}}" + fi + status_context="${status_context}/windows-${{matrix.windows-version}}-${{matrix.windows-featurepack}}" + echo "status_context=${status_context}" >> "$GITHUB_ENV" + + echo "${PULL_SECRET}" > pull-secret + - name: Download linux binary uses: actions/download-artifact@v4 with: @@ -94,17 +106,14 @@ jobs: request=`sed -n '4p' info` echo ${request:1} > requestid - # connect to the reserved machine, create a non-root user for testing - ${machine:1} - new_user=crctest - useradd $new_user - echo "$new_user:redhat" | chpasswd - usermod -aG wheel $new_user - echo "$new_user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/crctest-users - mkdir -p /home/$new_user/.ssh - cp /root/.ssh/authorized_keys /home/$new_user/.ssh/ - chown $new_user /home/$new_user/.ssh/authorized_keys - exit + # Create a non-root user for testing on the reserved machine + ${machine:1} 'useradd crctest' < /dev/null + ${machine:1} 'echo "crctest:redhat" | chpasswd' < /dev/null + ${machine:1} 'usermod -aG wheel crctest' < /dev/null + ${machine:1} 'echo "crctest ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/crctest-users' < /dev/null + ${machine:1} 'mkdir -p /home/crctest/.ssh' < /dev/null + ${machine:1} 'cp /root/.ssh/authorized_keys /home/crctest/.ssh/' < /dev/null + ${machine:1} 'chown crctest /home/crctest/.ssh/authorized_keys' < /dev/null # Install CRC on the reserved machine podman run --rm -d --privileged --name crc-linux-install-${{inputs.qe-type}}-${{inputs.preset}} \ @@ -131,7 +140,7 @@ jobs: # load image podman load -i crc-${{inputs.qe-type}}-linux-arm64.tar - echo "${PULL_SECRET}" > pull-secret + # run CRC test cmd="crc-qe/run.sh -junitFilename crc-${{inputs.qe-type}}-junit.xml -targetFolder crc-qe" if [[ "${{inputs.qe-type}}" == "e2e" ]]; then