Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyLuLiu committed Dec 9, 2024
1 parent c4ff2de commit c6a089f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/linux-qe-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ jobs:
- name: prepare
run: |
# Install Testing farm CLI
curl -LO "https://gitlab.com/testing-farm/cli/-/raw/main/container/testing-farm"
chmod +x testing-farm
mv testing-farm /usr/local/bin/
sudo yum install podman openssh-server -y
pip3 install --user tft-cli
sudo apt install podman openssh-server -y
testing-farm --help
# Get origin commit sha for testing
commit_sha=$(cat gh_context.json | jq -r '.event.after')
Expand Down Expand Up @@ -93,16 +91,19 @@ jobs:
# the target can only be accessed through a bastion (which can only be accessed from self-hosted runner)
# as so we need to map the ssh-agent from the host to the containers used to access the target host
rm -f id_rsa id_rsa.pub
ssh-keygen -t rsa -N '' -f id_rsa -q
#rm -f id_rsa id_rsa.pub
ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa -q
cp ~/.ssh/id_rsa .
eval $(ssh-agent -s)
echo $SSH_AUTH_SOCK > ssh_auth_sock
echo $SSH_AGENT_PID > ssh_agent_pid
ssh-add id_rsa
# reserve machine from testing farm
export TESTING_FARM_API_TOKEN=${TESTING_FARM_API_TOKEN}
testing-farm reserve --compose Fedora-40 --duration 480 --arch aarch64 --hardware memory='>= 16 GB' --hardware cpu.processors='>= 4' --hardware virtualization.is-supported='true' --ssh-public-key id_rsa.pub --no-autoconnect | tee info
testing-farm reserve --compose Fedora-40 --duration 480 --arch aarch64 --hardware memory='>= 16 GB' --hardware cpu.processors='>= 4' --hardware virtualization.is-supported='true' --no-autoconnect | tee info1
sed -r 's/\x1B\[[0-9;]*[mK]//g' info1 > info
machine=`tail -n 1 info`
echo ${machine##*@} > host
echo crctest > username
Expand All @@ -112,7 +113,8 @@ jobs:
echo ${request:1} > requestid
# Create a non-root user for testing on the reserved machine
ssh_cmd="ssh -i id_rsa -o StrictHostKeyChecking=no ${machine##*ssh}"
ssh_cmd="ssh -o StrictHostKeyChecking=no ${machine##*ssh}"
ssh-keyscan -H testing-farm.io >> ~/.ssh/known_hosts
echo ${machine##*ssh}
echo $ssh_cmd
$ssh_cmd 'useradd crctest' < /dev/null
Expand Down

0 comments on commit c6a089f

Please sign in to comment.