[CI] Test image from instance
This is a missing Nova->Glance interaction that is sometimes useful. Change-Id: I05b22d90ec31ef3b63210c2563d6e5547d565874 Depends-On: https://review.opendev.org/c/openstack/kolla/+/860230
This commit is contained in:
parent
5b848d01f0
commit
1a4689975e
@ -77,6 +77,26 @@ function create_an_image_from_volume {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function create_an_image_from_instance {
|
||||||
|
local image_name=$1
|
||||||
|
local instance_name=$2
|
||||||
|
|
||||||
|
local attempt
|
||||||
|
|
||||||
|
openstack server image create $instance_name --name $image_name
|
||||||
|
attempt=1
|
||||||
|
while [[ $(openstack image show $image_name -f value -c status) != "active" ]]; do
|
||||||
|
echo "Image $image_name not active yet"
|
||||||
|
attempt=$((attempt+1))
|
||||||
|
if [[ $attempt -eq 11 ]]; then
|
||||||
|
echo "Image $image_name failed to become active"
|
||||||
|
openstack image show $image_name
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
sleep 30
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
function attach_and_detach_a_volume {
|
function attach_and_detach_a_volume {
|
||||||
local volume_name=$1
|
local volume_name=$1
|
||||||
local instance_name=$2
|
local instance_name=$2
|
||||||
@ -259,6 +279,11 @@ function test_instance_boot {
|
|||||||
echo "SUCCESS: Glance image from Cinder volume and back to volume"
|
echo "SUCCESS: Glance image from Cinder volume and back to volume"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "TESTING: Instance image upload"
|
||||||
|
create_an_image_from_instance image_from_instance kolla_boot_test
|
||||||
|
openstack image delete image_from_instance
|
||||||
|
echo "SUCCESS: Instance image upload"
|
||||||
|
|
||||||
echo "TESTING: Floating ip allocation"
|
echo "TESTING: Floating ip allocation"
|
||||||
fip_addr=$(create_fip)
|
fip_addr=$(create_fip)
|
||||||
attach_fip kolla_boot_test ${fip_addr}
|
attach_fip kolla_boot_test ${fip_addr}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user