CI: add q35 hardware machine type to tests

Change-Id: If9636aaa76a7dc094223c3f096d96c96ecd0c8e7
This commit is contained in:
Bartosz Bezak 2023-09-07 16:25:33 +02:00
parent e38f5e0c23
commit 30fca662bc

View File

@ -257,6 +257,14 @@ function detach_fip {
openstack server remove floating ip ${instance_name} ${fip_addr} openstack server remove floating ip ${instance_name} ${fip_addr}
} }
function set_cirros_image_q35_machine_type {
openstack image set --property hw_machine_type=q35 cirros
}
function unset_cirros_image_q35_machine_type {
openstack image unset --property hw_machine_type cirros
}
function test_ssh { function test_ssh {
local instance_name=$1 local instance_name=$1
local fip_addr=$2 local fip_addr=$2
@ -280,6 +288,14 @@ function test_ssh {
function test_instance_boot { function test_instance_boot {
local fip_addr local fip_addr
local machine_type="${1}"
local fip_file="/tmp/kolla_ci_pre_upgrade_fip_addr${machine_type:+_$machine_type}"
local upgrade_instance_name="kolla_upgrade_test${machine_type:+_$machine_type}"
local volume_name="durable_volume${machine_type:+_$machine_type}"
if [[ $machine_type == "q35" ]]; then
set_cirros_image_q35_machine_type
fi
echo "TESTING: Server creation" echo "TESTING: Server creation"
create_instance kolla_boot_test create_instance kolla_boot_test
@ -314,12 +330,12 @@ function test_instance_boot {
echo "TESTING: Cinder volume upgrade stability (PHASE: $PHASE)" echo "TESTING: Cinder volume upgrade stability (PHASE: $PHASE)"
if [[ $PHASE == 'deploy' ]]; then if [[ $PHASE == 'deploy' ]]; then
create_a_volume durable_volume create_a_volume $volume_name
openstack volume show durable_volume openstack volume show $volume_name
elif [[ $PHASE == 'upgrade' ]]; then elif [[ $PHASE == 'upgrade' ]]; then
openstack volume show durable_volume openstack volume show $volume_name
attach_and_detach_a_volume durable_volume kolla_boot_test attach_and_detach_a_volume $volume_name kolla_boot_test
delete_a_volume durable_volume delete_a_volume $volume_name
fi fi
echo "SUCCESS: Cinder volume upgrade stability (PHASE: $PHASE)" echo "SUCCESS: Cinder volume upgrade stability (PHASE: $PHASE)"
@ -377,21 +393,25 @@ function test_instance_boot {
echo "TESTING: Instance (Nova and Neutron) upgrade stability (PHASE: $PHASE)" echo "TESTING: Instance (Nova and Neutron) upgrade stability (PHASE: $PHASE)"
if [[ $PHASE == 'deploy' ]]; then if [[ $PHASE == 'deploy' ]]; then
create_instance kolla_upgrade_test create_instance $upgrade_instance_name
fip_addr=$(create_fip) fip_addr=$(create_fip)
attach_fip kolla_upgrade_test ${fip_addr} attach_fip $upgrade_instance_name ${fip_addr}
test_ssh kolla_upgrade_test ${fip_addr} # tested to see if the instance has not just failed booting already test_ssh $upgrade_instance_name ${fip_addr} # tested to see if the instance has not just failed booting already
echo ${fip_addr} > /tmp/kolla_ci_pre_upgrade_fip_addr echo ${fip_addr} > $fip_file
elif [[ $PHASE == 'upgrade' ]]; then elif [[ $PHASE == 'upgrade' ]]; then
fip_addr=$(cat /tmp/kolla_ci_pre_upgrade_fip_addr) fip_addr=$(cat $fip_file)
test_ssh kolla_upgrade_test ${fip_addr} test_ssh $upgrade_instance_name ${fip_addr}
detach_fip kolla_upgrade_test ${fip_addr} detach_fip $upgrade_instance_name ${fip_addr}
delete_fip ${fip_addr} delete_fip ${fip_addr}
delete_instance kolla_upgrade_test delete_instance $upgrade_instance_name
fi fi
echo "SUCCESS: Instance (Nova and Neutron) upgrade stability (PHASE: $PHASE)" echo "SUCCESS: Instance (Nova and Neutron) upgrade stability (PHASE: $PHASE)"
fi fi
if [[ $machine_type == "q35" ]]; then
unset_cirros_image_q35_machine_type
fi
} }
function test_openstack_logged { function test_openstack_logged {
@ -399,6 +419,13 @@ function test_openstack_logged {
. ~/openstackclient-venv/bin/activate . ~/openstackclient-venv/bin/activate
test_smoke test_smoke
test_instance_boot test_instance_boot
# Check for x86_64 architecture to run q35 tests
if [[ $(uname -m) == "x86_64" ]]; then
set_cirros_image_q35_machine_type
test_instance_boot q35
unset_cirros_image_q35_machine_type
fi
} }
function test_openstack { function test_openstack {