Skip to content

Commit

Permalink
fix1
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyLuLiu committed Nov 22, 2024
1 parent daa7a68 commit 35d9bcb
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/linux-qe-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) \
Expand All @@ -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' \
Expand All @@ -141,16 +144,19 @@ 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"
if [[ "${{inputs.qe-type}}" == "e2e" ]]; then
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) \
Expand Down Expand Up @@ -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: |
Expand All @@ -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)



0 comments on commit 35d9bcb

Please sign in to comment.