Merge "CI: add q35 hardware machine type to tests"
This commit is contained in:
commit
dd554466c3
@ -201,6 +201,14 @@ function detach_fip {
|
||||
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 {
|
||||
local instance_name=$1
|
||||
local fip_addr=$2
|
||||
@ -224,6 +232,14 @@ function test_ssh {
|
||||
|
||||
function test_instance_boot {
|
||||
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"
|
||||
create_instance kolla_boot_test
|
||||
@ -258,12 +274,12 @@ function test_instance_boot {
|
||||
echo "TESTING: Cinder volume upgrade stability (PHASE: $PHASE)"
|
||||
|
||||
if [[ $PHASE == 'deploy' ]]; then
|
||||
create_a_volume durable_volume
|
||||
openstack volume show durable_volume
|
||||
create_a_volume $volume_name
|
||||
openstack volume show $volume_name
|
||||
elif [[ $PHASE == 'upgrade' ]]; then
|
||||
openstack volume show durable_volume
|
||||
attach_and_detach_a_volume durable_volume kolla_boot_test
|
||||
delete_a_volume durable_volume
|
||||
openstack volume show $volume_name
|
||||
attach_and_detach_a_volume $volume_name kolla_boot_test
|
||||
delete_a_volume $volume_name
|
||||
fi
|
||||
|
||||
echo "SUCCESS: Cinder volume upgrade stability (PHASE: $PHASE)"
|
||||
@ -321,21 +337,25 @@ function test_instance_boot {
|
||||
echo "TESTING: Instance (Nova and Neutron) upgrade stability (PHASE: $PHASE)"
|
||||
|
||||
if [[ $PHASE == 'deploy' ]]; then
|
||||
create_instance kolla_upgrade_test
|
||||
create_instance $upgrade_instance_name
|
||||
fip_addr=$(create_fip)
|
||||
attach_fip kolla_upgrade_test ${fip_addr}
|
||||
test_ssh kolla_upgrade_test ${fip_addr} # tested to see if the instance has not just failed booting already
|
||||
echo ${fip_addr} > /tmp/kolla_ci_pre_upgrade_fip_addr
|
||||
attach_fip $upgrade_instance_name ${fip_addr}
|
||||
test_ssh $upgrade_instance_name ${fip_addr} # tested to see if the instance has not just failed booting already
|
||||
echo ${fip_addr} > $fip_file
|
||||
elif [[ $PHASE == 'upgrade' ]]; then
|
||||
fip_addr=$(cat /tmp/kolla_ci_pre_upgrade_fip_addr)
|
||||
test_ssh kolla_upgrade_test ${fip_addr}
|
||||
detach_fip kolla_upgrade_test ${fip_addr}
|
||||
fip_addr=$(cat $fip_file)
|
||||
test_ssh $upgrade_instance_name ${fip_addr}
|
||||
detach_fip $upgrade_instance_name ${fip_addr}
|
||||
delete_fip ${fip_addr}
|
||||
delete_instance kolla_upgrade_test
|
||||
delete_instance $upgrade_instance_name
|
||||
fi
|
||||
|
||||
echo "SUCCESS: Instance (Nova and Neutron) upgrade stability (PHASE: $PHASE)"
|
||||
fi
|
||||
|
||||
if [[ $machine_type == "q35" ]]; then
|
||||
unset_cirros_image_q35_machine_type
|
||||
fi
|
||||
}
|
||||
|
||||
function test_openstack_logged {
|
||||
@ -343,6 +363,13 @@ function test_openstack_logged {
|
||||
. ~/openstackclient-venv/bin/activate
|
||||
test_smoke
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user