Skip to content

Commit

Permalink
CI Test: Support being source of a Ceph upgrade
Browse files Browse the repository at this point in the history
Allow Stein release to be the source of a Ceph upgrade test.

Change-Id: I289dc4b90356049eaa756a69f814696453556f7c
  • Loading branch information
markgoddard committed May 22, 2019
1 parent 3dfa857 commit f50e331
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
10 changes: 6 additions & 4 deletions tests/run.yml
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/templates/globals-default.j2
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion tests/test-openstack.sh
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tools/setup_gate.sh
Expand Up @@ -27,7 +27,7 @@ EOF
GATE_IMAGES="bifrost"
fi

if [[ $ACTION == "ceph" ]]; then
if [[ $ACTION =~ "ceph" ]]; then
GATE_IMAGES+=",ceph,cinder"
fi

Expand Down

0 comments on commit f50e331

Please sign in to comment.