Gitlab CI: Run libvirt.sh tests on GCP

We can now use GCP runners in our CI. Let's test them out by running all
of libvirt tests for starters.
This commit is contained in:
Jakub Rusz 2023-02-15 12:00:13 +01:00 committed by Jakub Rusz
parent 96b42b5791
commit 004c4e8acc
3 changed files with 32 additions and 23 deletions

View file

@ -35,6 +35,11 @@ stages:
tags: tags:
- terraform/openstack - terraform/openstack
.terraform/gcp:
extends: .base
tags:
- terraform/gcp
init: init:
stage: init stage: init
@ -611,7 +616,7 @@ API:
.libvirt_integration: .libvirt_integration:
stage: test stage: test
extends: .terraform/openstack extends: .terraform/gcp
rules: rules:
- !reference [.upstream_rules_all, rules] - !reference [.upstream_rules_all, rules]
- !reference [.nightly_rules_all, rules] - !reference [.nightly_rules_all, rules]
@ -621,12 +626,13 @@ API:
parallel: parallel:
matrix: matrix:
- RUNNER: - RUNNER:
- rhos-01/centos-stream-8-x86_64 - gcp/centos-stream-8-x86_64
- rhos-01/rhel-8.7-ga-x86_64 - gcp/rhel-8.7-ga-x86_64
- rhos-01/rhel-9.1-ga-x86_64 - gcp/rhel-9.1-ga-x86_64
- rhos-01/rhel-8.8-nightly-x86_64 - gcp/rhel-8.8-nightly-x86_64
- rhos-01/rhel-9.2-nightly-x86_64 - gcp/rhel-9.2-nightly-x86_64
- rhos-01/centos-stream-9-x86_64 - gcp/centos-stream-9-x86_64
INTERNAL_NETWORK: ["true"]
libvirt.sh: libvirt.sh:
extends: .libvirt_integration extends: .libvirt_integration

View file

@ -42,19 +42,22 @@ echo "List of installed packages:"
rpm -qa | sort rpm -qa | sort
echo "------------------------------------------------------------------------------" echo "------------------------------------------------------------------------------"
if rpm --quiet -q python36; then # gcp runners don't use cloud-init and some of the images have python36 installed
echo -e "\n FAIL: python36 is installed, see #794 ..." if [[ "$RUNNER" != *"gcp"* ]];then
exit 1 if rpm --quiet -q python36; then
else echo -e "\n FAIL: python36 is installed, see #794 ..."
echo -e "\n PASS: python36 not insalled" exit 1
fi else
echo -e "\n PASS: python36 not insalled"
fi
# Ensure cloud-init has completely finished on the instance. This ensures that # Ensure cloud-init has completely finished on the instance. This ensures that
# the instance is fully ready to go. # the instance is fully ready to go.
while true; do while true; do
if [[ -f /var/lib/cloud/instance/boot-finished ]]; then if [[ -f /var/lib/cloud/instance/boot-finished ]]; then
break break
fi fi
echo -e "\n🤔 Waiting for cloud-init to finish running..." echo -e "\n🤔 Waiting for cloud-init to finish running..."
sleep 5 sleep 5
done done
fi

View file

@ -1 +1 @@
89fb25d15bc49e1463aec2ba6ea3c32957ab6c4d 460d034f182a6285a0133c86688c7281a28f548b