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

This commit is contained in:
Zuul 2019-05-31 12:10:45 +00:00 committed by Gerrit Code Review
commit e51d82b091
4 changed files with 21 additions and 7 deletions

View File

@ -2,13 +2,14 @@
- hosts: all
vars:
kolla_ansible_local_src_dir: "{{ zuul.executor.work_root }}/src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible"
is_ceph: "{{ 'ceph' in scenario }}"
tasks:
- name: Prepare disks for Ceph or LVM
script: "setup_disks.sh {{ disk_type }}"
when: scenario in ["ceph", "cinder-lvm"]
when: scenario == "cinder-lvm" or is_ceph
become: true
vars:
disk_type: "{{ ceph_storetype if scenario == 'ceph' else 'cinder-lvm' }}"
disk_type: "{{ ceph_storetype if is_ceph else 'cinder-lvm' }}"
ceph_storetype: "{{ hostvars[inventory_hostname].get('ceph_osd_storetype') }}"
- hosts: primary
@ -19,6 +20,7 @@
kolla_ansible_local_src_dir: "{{ zuul.executor.work_root }}/src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible"
need_build_image: false
build_image_tag: "change_{{ zuul.change | default('none') }}"
is_ceph: "{{ 'ceph' in scenario }}"
tasks:
# FIXME: in multi node env, api_interface may be different on each node.
- name: detect api_interface_name variable
@ -87,7 +89,7 @@
# ceph.conf
- src: "tests/templates/ceph-overrides.j2"
dest: /etc/kolla/config/ceph.conf
when: scenario == "ceph"
when: "{{ is_ceph }}"
# bifrost/dib.yml
- src: "tests/templates/bifrost-dib-overrides.j2"
dest: /etc/kolla/config/bifrost/dib.yml
@ -223,7 +225,7 @@
# ceph.conf
- src: "tests/templates/ceph-overrides.j2"
dest: /etc/kolla/config/ceph.conf
when: "'ceph' in scenario"
when: "{{ is_ceph }}"
when: item.when | default(true)
- name: upgrade kolla-ansible requirements

View File

@ -39,7 +39,7 @@ openstack_release: "{{ previous_release }}"
{% endif %}
{% endif %}
{% if scenario == "ceph" %}
{% if is_ceph %}
enable_ceph: "yes"
enable_cinder: "yes"
ceph_pool_pg_num: 8

View File

@ -24,7 +24,7 @@ function test_openstack_logged {
fi
echo "SUCCESS: Server creation"
if [[ $ACTION = "ceph" ]] || [[ $ACTION == "cinder-lvm" ]]; then
if [[ $ACTION =~ "ceph" ]] || [[ $ACTION == "cinder-lvm" ]]; then
echo "TESTING: Cinder volume attachment"
openstack volume create --size 2 test_volume
attempt=1
@ -51,6 +51,18 @@ function test_openstack_logged {
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
echo "SUCCESS: Cinder volume attachment"
fi

View File

@ -27,7 +27,7 @@ EOF
GATE_IMAGES="bifrost"
fi
if [[ $ACTION == "ceph" ]]; then
if [[ $ACTION =~ "ceph" ]]; then
GATE_IMAGES+=",ceph,cinder"
fi