From 35d9bcbc2e05c8577c967cb94b94a9bd8a6d3b4e Mon Sep 17 00:00:00 2001 From: lilyLuLiu Date: Thu, 21 Nov 2024 10:17:30 +0800 Subject: [PATCH] fix1 --- .github/workflows/linux-qe-template.yml | 29 +++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linux-qe-template.yml b/.github/workflows/linux-qe-template.yml index 59572d1125..6a559c7452 100644 --- a/.github/workflows/linux-qe-template.yml +++ b/.github/workflows/linux-qe-template.yml @@ -107,7 +107,9 @@ jobs: echo ${request:1} > requestid # Create a non-root user for testing on the reserved machine - ssh_cmd="ssh -i id_rsa ${machine##*ssh}" + ssh_cmd="ssh -i id_rsa -o StrictHostKeyChecking=no ${machine##*ssh}" + echo ${machine##*ssh} + echo $ssh_cmd $ssh_cmd 'useradd crctest' < /dev/null $ssh_cmd 'echo "crctest:redhat" | chpasswd' < /dev/null $ssh_cmd 'usermod -aG wheel crctest' < /dev/null @@ -117,6 +119,7 @@ jobs: $ssh_cmd 'chown crctest /home/crctest/.ssh/authorized_keys' < /dev/null # Install CRC on the reserved machine + echo "Start installing crc on reserved machine" podman run --rm -d --privileged --name crc-linux-install-${{inputs.qe-type}}-${{inputs.preset}} \ -e TARGET_HOST=$(cat host) \ -e TARGET_HOST_USERNAME=$(cat username) \ @@ -132,7 +135,7 @@ jobs: -v ${PWD}:/data:z \ -v ${PWD}/crc:/opt/crc-support/crc:z \ quay.io/crc-org/ci-crc-support:v2.0.0-dev-linux crc-support/run.sh \ - -targetPath "/root/crc-support" \ + -targetPath "/home/crctest/crc-support" \ -install 'true' \ -aName 'crc' \ -freshEnv 'false' \ @@ -141,6 +144,8 @@ jobs: # load image podman load -i crc-${{inputs.qe-type}}-linux-arm64.tar + $ssh_cmd 'chmod +x /usr/local/bin/crc' < /dev/null + $ssh_cmd 'sudo dnf install libvirt-client -y' < /dev/null # run CRC test cmd="crc-qe/run.sh -junitFilename crc-${{inputs.qe-type}}-junit.xml -targetFolder crc-qe" @@ -148,9 +153,10 @@ jobs: if [[ "${{inputs.preset}}" == "microshift" ]]; then cmd="${cmd} -e2eTagExpression '@story_microshift'" else - cmd="${cmd} -e2eTagExpression '~@minimal && ~@story_microshift'" + cmd="${cmd} -e2eTagExpression '~@minimal && ~@story_microshift && ~@cert_rotation'" fi fi + echo "Start running test on reserved machine" podman run --rm -d --privileged --name crc-${{inputs.qe-type}}-${{inputs.preset}} \ -e TARGET_HOST=$(cat host) \ -e TARGET_HOST_USERNAME=$(cat username) \ @@ -190,6 +196,16 @@ jobs: **/*.results **/*.log + - name: Return machine and clear env + env: + TESTING_FARM_API_TOKEN: ${{ secrets.TESTING_FARM_API_TOKEN }} + if: always() + run: | + export TESTING_FARM_API_TOKEN=${TESTING_FARM_API_TOKEN} + testing-farm cancel $(cat requestid) + rm -r result + kill $(cat ssh_agent_pid) + - name: Update status of the PR check if: always() run: | @@ -209,12 +225,7 @@ jobs: https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.commit_sha }} \ -d "${data}" - - name: Return machine and clear env - env: - TESTING_FARM_API_TOKEN: ${{ secrets.TESTING_FARM_API_TOKEN }} - run: | - export TESTING_FARM_API_TOKEN=${TESTING_FARM_API_TOKEN} - testing-farm cancel $(cat requestid) +