aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-05-16 10:17:35 +0000
committerGerrit Code Review <review@openstack.org>2022-05-16 10:17:35 +0000
commit5645a4c008b9dc8cbf97ca8e61fd70cc2fb55b0e (patch)
treee0d18ce863e9311958c5942c5490abb0c22ebeba /tests
parent4976bff5934aad0b1aff2aa661542fa1a7f9918c (diff)
parent06e5be0ca206f5e785fc747c6558310e3aa0db2c (diff)
downloadkolla-ansible-5645a4c008b9dc8cbf97ca8e61fd70cc2fb55b0e.tar.gz
kolla-ansible-5645a4c008b9dc8cbf97ca8e61fd70cc2fb55b0e.zip
Merge "[CI] Test Glance interaction with Cinder"
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test-core-openstack.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/test-core-openstack.sh b/tests/test-core-openstack.sh
index a20e2d00d..96ad7dd7a 100755
--- a/tests/test-core-openstack.sh
+++ b/tests/test-core-openstack.sh
@@ -55,6 +55,28 @@ function create_a_volume_from_image {
done
}
+function create_an_image_from_volume {
+ local image_name=$1
+ local volume_name=$2
+
+ local attempt
+
+ # NOTE(yoctozepto): Adding explicit microversion of Victoria as a sane default to work
+ # around the bug: https://storyboard.openstack.org/#!/story/2009287
+ openstack --os-volume-api-version 3.62 image create --volume $volume_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 {
local volume_name=$1
local instance_name=$2
@@ -219,6 +241,22 @@ function test_instance_boot {
echo "SUCCESS: Cinder volume upgrade stability (PHASE: $PHASE)"
fi
+
+ echo "TESTING: Glance image from Cinder volume and back to volume"
+
+ create_a_volume test_volume_to_image
+ openstack volume show test_volume_to_image
+ create_an_image_from_volume test_image_from_volume test_volume_to_image
+
+ create_a_volume_from_image test_volume_from_image_from_volume test_image_from_volume
+ openstack volume show test_volume_from_image_from_volume
+ attach_and_detach_a_volume test_volume_from_image_from_volume kolla_boot_test
+
+ delete_a_volume test_volume_from_image_from_volume
+ openstack image delete test_image_from_volume
+ delete_a_volume test_volume_to_image
+
+ echo "SUCCESS: Glance image from Cinder volume and back to volume"
fi
echo "TESTING: Floating ip allocation"