16
16
17
17
jobs :
18
18
linux-qe :
19
- runs-on : [self-hosted, linux, testing-farm]
19
+ runs-on : ubuntu-24.04
20
20
permissions :
21
21
statuses : write # needed to update commit status (pending/failure/sucess)
22
22
checks : write # as documented in https://github.com/mikepenz/action-junit-report?tab=readme-ov-file#pr-run-permissions
23
23
steps :
24
+ - name : Check out repository code
25
+ uses : actions/checkout@v4
26
+
24
27
- name : Download gh context
25
28
id : download-gh-context-artifact
26
29
uses : actions/download-artifact@v4
31
34
32
35
- name : prepare
33
36
run : |
34
- sudo yum install podman openssh-server -y
37
+ # Install Testing farm CLI
38
+ pip3 install --user tft-cli
39
+ sudo apt install podman openssh-server -y
40
+ testing-farm --help
35
41
36
42
# Get origin commit sha for testing
37
43
commit_sha=$(cat gh_context.json | jq -r '.event.after')
@@ -46,10 +52,17 @@ jobs:
46
52
if [[ "${{inputs.qe-type}}" == "e2e" ]]; then
47
53
status_context="${status_context}-${{inputs.preset}}"
48
54
fi
49
- status_context="${status_context}/windows-${{matrix.windows-version}}-${{matrix.windows-featurepack}} "
55
+ status_context="${status_context}/Linux-ARM64 "
50
56
echo "status_context=${status_context}" >> "$GITHUB_ENV"
51
57
52
- echo "${PULL_SECRET}" > pull-secret
58
+ ocp_version_line=$(cat Makefile | grep "OPENSHIFT_VERSION ?=")
59
+ ocp_bundle_v=${ocp_version_line##*= }
60
+ echo "ocp_bundle_v=${ocp_bundle_v}" >> "$GITHUB_ENV"
61
+ echo "ocp_bundle_v=${ocp_bundle_v}"
62
+ microshift_version_line=$(cat Makefile | grep "MICROSHIFT_VERSION ?=")
63
+ microshift_bundle_v=${microshift_version_line##*= }
64
+ echo "microshift_bundle_v=${microshift_bundle_v}" >> "$GITHUB_ENV"
65
+ echo "microshift_bundle_v=${microshift_bundle_v}"
53
66
54
67
- name : Download linux binary
55
68
uses : actions/download-artifact@v4
@@ -86,82 +99,115 @@ jobs:
86
99
TESTING_FARM_API_TOKEN : ${{ secrets.TESTING_FARM_API_TOKEN }}
87
100
PULL_SECRET : ${{ secrets.PULL_SECRET }}
88
101
run : |
102
+ echo "${PULL_SECRET}" > pull-secret
103
+
89
104
# the target can only be accessed through a bastion (which can only be accessed from self-hosted runner)
90
105
# as so we need to map the ssh-agent from the host to the containers used to access the target host
91
- rm -f id_rsa id_rsa.pub
92
- ssh-keygen -t rsa -N '' -f id_rsa -q
106
+
107
+ #rm -f id_rsa id_rsa.pub
108
+ ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa -q
109
+ cp ~/.ssh/id_rsa .
93
110
eval $(ssh-agent -s)
94
111
echo $SSH_AUTH_SOCK > ssh_auth_sock
95
112
echo $SSH_AGENT_PID > ssh_agent_pid
96
113
ssh-add id_rsa
97
114
98
115
# reserve machine from testing farm
99
116
export TESTING_FARM_API_TOKEN=${TESTING_FARM_API_TOKEN}
100
- testing-farm reserve --compose Fedora-40 --duration 240 --arch aarch64 --hardware memory='>= 12 GB' --hardware virtualization.is-supported='true' --ssh-public-key id_rsa.pub --no-autoconnect | tee info
117
+ testing-farm reserve --compose Fedora-40 --duration 480 --arch aarch64 --hardware memory='>= 16 GB' --hardware virtualization.is-supported='true' --no-autoconnect | tee info
101
118
machine=`tail -n 1 info`
102
119
echo ${machine##*@} > host
103
120
echo crctest > username
104
- echo proxy > bastion_username
105
- echo testing-farm.io > bastion_host
106
121
request=`sed -n '4p' info`
107
122
echo ${request:1} > requestid
108
123
109
124
# Create a non-root user for testing on the reserved machine
110
- ${machine:1} 'useradd crctest' < /dev/null
111
- ${machine:1} 'echo "crctest:redhat" | chpasswd' < /dev/null
112
- ${machine:1} 'usermod -aG wheel crctest' < /dev/null
113
- ${machine:1} 'echo "crctest ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/crctest-users' < /dev/null
114
- ${machine:1} 'mkdir -p /home/crctest/.ssh' < /dev/null
115
- ${machine:1} 'cp /root/.ssh/authorized_keys /home/crctest/.ssh/' < /dev/null
116
- ${machine:1} 'chown crctest /home/crctest/.ssh/authorized_keys' < /dev/null
125
+ ssh_cmd="ssh -o StrictHostKeyChecking=no ${machine##*ssh}"
126
+ echo $ssh_cmd
127
+ $ssh_cmd 'useradd crctest' < /dev/null
128
+ $ssh_cmd 'echo "crctest:redhat" | chpasswd' < /dev/null
129
+ $ssh_cmd 'usermod -aG wheel crctest' < /dev/null
130
+ $ssh_cmd 'echo "crctest ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/crctest-users' < /dev/null
131
+ $ssh_cmd 'mkdir -p /home/crctest/.ssh' < /dev/null
132
+ $ssh_cmd 'cp /root/.ssh/authorized_keys /home/crctest/.ssh/' < /dev/null
133
+ $ssh_cmd 'chown -R crctest:crctest /home/crctest/.ssh/' < /dev/null
117
134
118
135
# Install CRC on the reserved machine
136
+ echo "Start installing crc on reserved machine"
119
137
podman run --rm -d --privileged --name crc-linux-install-${{inputs.qe-type}}-${{inputs.preset}} \
120
138
-e TARGET_HOST=$(cat host) \
121
139
-e TARGET_HOST_USERNAME=$(cat username) \
122
140
-e TARGET_HOST_KEY_PATH=/data/id_rsa \
123
- -e BASTION_HOST_USERNAME=$(cat bastion_username) \
124
- -e BASTION_HOST=$(cat bastion_host) \
125
141
-e TARGET_FOLDER=crc-support \
126
142
-e TARGET_CLEANUP='false' \
127
143
-e OUTPUT_FOLDER=/data \
128
144
-e DEBUG='true' \
129
- -e SSH_AUTH_SOCK=$(cat ssh_auth_sock) \
130
- -v "$(cat ssh_auth_sock):$(cat ssh_auth_sock)" \
131
145
-v ${PWD}:/data:z \
132
146
-v ${PWD}/crc:/opt/crc-support/crc:z \
133
147
quay.io/crc-org/ci-crc-support:v2.0.0-dev-linux crc-support/run.sh \
134
- -targetPath "/root /crc-support" \
148
+ -targetPath "/home/crctest /crc-support" \
135
149
-install 'true' \
136
150
-aName 'crc' \
137
151
-freshEnv 'false' \
138
152
-download 'false'
139
153
podman logs -f crc-linux-install-${{inputs.qe-type}}-${{inputs.preset}}
140
154
155
+ # Download arm64 bundle in the reserved machine
156
+ echo "Start download bundle on reserved machine"
157
+
158
+ if [[ "${{inputs.preset}}" == "microshift" ]]; then
159
+ bundle_url="https://crcqe-asia.s3.ap-south-1.amazonaws.com/bundles/microshift/${{ env.microshift_bundle_v }}-arm64"
160
+ bundle_name="crc_microshift_libvirt_${{ env.microshift_bundle_v }}_arm64.crcbundle"
161
+ else
162
+ bundle_url="https://crcqe-asia.s3.ap-south-1.amazonaws.com/bundles/openshift/${{ env.ocp_bundle_v }}-arm64"
163
+ bundle_name="crc_libvirt_${{ env.ocp_bundle_v }}_arm64.crcbundle"
164
+ fi
165
+ podman run --rm -d --privileged --name download_bundle \
166
+ -e TARGET_HOST=$(cat host) \
167
+ -e TARGET_HOST_USERNAME=$(cat username) \
168
+ -e TARGET_HOST_KEY_PATH=/data/id_rsa \
169
+ -e TARGET_FOLDER=crc-support \
170
+ -e TARGET_CLEANUP='false' \
171
+ -e OUTPUT_FOLDER=/data \
172
+ -e DEBUG='true' \
173
+ -v ${PWD}:/data:z \
174
+ quay.io/crc-org/ci-crc-support:v2.0.0-dev-linux crc-support/run.sh \
175
+ -targetPath "/home/crctest" \
176
+ -install 'false' \
177
+ -aBaseURL $bundle_url \
178
+ -aName $bundle_name \
179
+ -freshEnv 'false' \
180
+ -download 'true'
181
+ podman logs -f download_bundle
182
+
141
183
# load image
142
184
podman load -i crc-${{inputs.qe-type}}-linux-arm64.tar
185
+ $ssh_cmd 'chmod +x /usr/local/bin/crc' < /dev/null
143
186
144
187
# run CRC test
145
- cmd="crc-qe/run.sh -junitFilename crc-${{inputs.qe-type}}-junit.xml -targetFolder crc-qe"
188
+ cmd="crc-qe/run.sh -bundleLocation /home/crctest/$bundle_name - junitFilename crc-${{inputs.qe-type}}-junit.xml -targetFolder crc-qe"
146
189
if [[ "${{inputs.qe-type}}" == "e2e" ]]; then
147
190
if [[ "${{inputs.preset}}" == "microshift" ]]; then
148
191
cmd="${cmd} -e2eTagExpression '@story_microshift'"
149
192
else
150
- cmd="${cmd} -e2eTagExpression '~@minimal && ~@story_microshift'"
193
+ cmd="${cmd} -e2eTagExpression '~@minimal && ~@story_microshift && ~@cert_rotation'"
194
+ fi
195
+ else
196
+ if [[ "${{inputs.preset}}" == "microshift" ]]; then
197
+ cmd="${cmd} -labelFilter 'microshift-preset'"
198
+ else
199
+ cmd="${cmd} -labelFilter 'openshift-preset'"
151
200
fi
152
201
fi
202
+ echo "Start running test on reserved machine"
153
203
podman run --rm -d --privileged --name crc-${{inputs.qe-type}}-${{inputs.preset}} \
154
204
-e TARGET_HOST=$(cat host) \
155
205
-e TARGET_HOST_USERNAME=$(cat username) \
156
206
-e TARGET_HOST_KEY_PATH=/data/id_rsa \
157
- -e BASTION_HOST_USERNAME=$(cat bastion_username) \
158
- -e BASTION_HOST=$(cat bastion_host) \
159
207
-e TARGET_FOLDER=crc-qe \
160
208
-e TARGET_RESULTS=results \
161
209
-e OUTPUT_FOLDER=/data \
162
210
-e DEBUG=true \
163
- -e SSH_AUTH_SOCK=$(cat ssh_auth_sock) \
164
- -v "$(cat ssh_auth_sock):$(cat ssh_auth_sock)" \
165
211
-v $PWD/pull-secret:/opt/crc/pull-secret:z \
166
212
-v $PWD:/data:z \
167
213
quay.io/crcont/crc-${{inputs.qe-type}}:gh-linux-arm64 \
@@ -189,6 +235,17 @@ jobs:
189
235
**/*.results
190
236
**/*.log
191
237
238
+ - name : Return machine and clear env
239
+ env :
240
+ TESTING_FARM_API_TOKEN : ${{ secrets.TESTING_FARM_API_TOKEN }}
241
+ if : always()
242
+ run : |
243
+ export TESTING_FARM_API_TOKEN=${TESTING_FARM_API_TOKEN}
244
+ testing-farm cancel $(cat requestid)
245
+ podman rmi quay.io/crcont/crc-${{inputs.qe-type}}:gh-linux-arm64
246
+ rm -r results
247
+ kill $(cat ssh_agent_pid)
248
+
192
249
- name : Update status of the PR check
193
250
if : always()
194
251
run : |
@@ -208,12 +265,7 @@ jobs:
208
265
https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.commit_sha }} \
209
266
-d "${data}"
210
267
211
- - name : Return machine and clear env
212
- env :
213
- TESTING_FARM_API_TOKEN : ${{ secrets.TESTING_FARM_API_TOKEN }}
214
- run : |
215
- export TESTING_FARM_API_TOKEN=${TESTING_FARM_API_TOKEN}
216
- testing-farm cancel $(cat requestid)
268
+
217
269
218
270
219
271
0 commit comments