Merge "CI Test: Support being source of a Ceph upgrade" into stable/rocky

This commit is contained in:
Zuul 2019-06-07 08:46:04 +00:00 committed by Gerrit Code Review
commit 687250a989
3 changed files with 42 additions and 7 deletions

View File

@ -3,10 +3,11 @@
vars:
kolla_ansible_src_dir: "src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible"
kolla_ansible_full_src_dir: "{{ zuul.executor.work_root }}/{{ kolla_ansible_src_dir }}"
is_ceph: "{{ 'ceph' in scenario }}"
tasks:
- name: Prepare ceph disks
script: "{{ kolla_ansible_full_src_dir }}/tests/setup_ceph_disks.sh"
when: scenario == "ceph"
when: is_ceph
become: true
- hosts: primary
@ -17,6 +18,7 @@
kolla_ansible_full_src_dir: "{{ zuul.executor.work_root }}/{{ kolla_ansible_src_dir }}"
need_build_image: false
is_previous_release: false
is_ceph: "{{ 'ceph' in scenario }}"
tasks:
- name: ensure /etc/kolla exists
file:
@ -125,7 +127,7 @@
template:
src: "{{ kolla_ansible_full_src_dir }}/tests/templates/ceph-overrides.j2"
dest: /etc/kolla/config/ceph.conf
when: scenario == "ceph"
when: is_ceph
delegate_to: "primary"
- shell:

View File

@ -46,7 +46,7 @@ openstack_service_workers: "1"
# This is experimental feature, disable if gate fail.
glance_enable_rolling_upgrade: "yes"
{% if scenario == "ceph" %}
{% if is_ceph %}
enable_ceph: "yes"
enable_cinder: "yes"
ceph_pool_pg_num: 8

View File

@ -40,7 +40,7 @@ EOF
GATE_IMAGES="bifrost"
fi
if [[ $ACTION == "ceph" ]]; then
if [[ $ACTION =~ "ceph" ]]; then
GATE_IMAGES+=",ceph,cinder"
fi
@ -146,10 +146,43 @@ function sanity_check {
# If the status is not ACTIVE, print info and exit 1
nova --debug show kolla_boot_test | awk '{buf=buf"\n"$0} $2=="status" && $4!="ACTIVE" {failed="yes"}; END {if (failed=="yes") {print buf; exit 1}}'
if echo $ACTION | grep -q "ceph"; then
#TODO(egonzalez): Recover openstack cli command once volume calls are fixed.
# openstack volume create --size 2 test_volume
cinder create --name test_volume 2
openstack volume create --size 2 test_volume
attempt=1
while [[ $(openstack volume show test_volume -f value -c status) != "available" ]]; do
echo "Volume not available yet"
attempt=$((attempt+1))
if [[ $attempt -eq 10 ]]; then
echo "Volume failed to become available"
openstack volume show test_volume
return 1
fi
sleep 10
done
openstack server add volume kolla_boot_test test_volume --device /dev/vdb
attempt=1
while [[ $(openstack volume show test_volume -f value -c status) != "in-use" ]]; do
echo "Volume not attached yet"
attempt=$((attempt+1))
if [[ $attempt -eq 10 ]]; then
echo "Volume failed to attach"
openstack volume show test_volume
return 1
fi
sleep 10
done
openstack server remove volume kolla_boot_test test_volume
attempt=1
while [[ $(openstack volume show test_volume -f value -c status) != "available" ]]; do
echo "Volume not detached yet"
attempt=$((attempt+1))
if [[ $attempt -eq 10 ]]; then
echo "Volume failed to detach"
openstack volume show test_volume
return 1
fi
sleep 10
done
openstack volume delete test_volume
fi
if echo $ACTION | grep -q "zun"; then
openstack --debug appcontainer service list