diff --git a/tests/run.yml b/tests/run.yml index 089d04cd7f..f5d7c4dcb9 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -4,10 +4,13 @@ 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 }}" tasks: - - name: Prepare ceph disks for bluestore and filestore OSD - script: "{{ kolla_ansible_full_src_dir }}/tests/setup_ceph_disks.sh {{ hostvars[inventory_hostname]['ceph_osd_storetype'] }}" - when: scenario == "ceph" + - name: Prepare disks for Ceph or LVM + script: "{{ kolla_ansible_full_src_dir }}/tests/setup_disks.sh {{ disk_type }}" + when: scenario in ["ceph", "cinder-lvm"] become: true + vars: + disk_type: "{{ ceph_storetype if scenario == 'ceph' else 'cinder-lvm' }}" + ceph_storetype: "{{ hostvars[inventory_hostname].get('ceph_osd_storetype') }}" - hosts: primary vars: diff --git a/tests/setup_ceph_disks.sh b/tests/setup_disks.sh similarity index 83% rename from tests/setup_ceph_disks.sh rename to tests/setup_disks.sh index 8426991194..fbac5f25b9 100644 --- a/tests/setup_ceph_disks.sh +++ b/tests/setup_disks.sh @@ -1,6 +1,14 @@ mkdir -p /opt/data/kolla -if [ $1 = 'filestore' ]; then +if [ $1 = 'cinder-lvm' ]; then + # cinder-volumes volume group + free_device=$(losetup -f) + fallocate -l 5G /var/lib/cinder_data.img + losetup $free_device /var/lib/cinder_data.img + pvcreate $free_device + vgcreate cinder-volumes $free_device + +elif [ $1 = 'filestore' ]; then #setup devices for Kolla Ceph filestore OSD dd if=/dev/zero of=/opt/data/kolla/ceph-osd1.img bs=5M count=1000 LOOP=$(losetup -f) diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index d041df23b7..aca0b31158 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -36,6 +36,12 @@ ceph_pool_pgp_num: 8 glance_enable_rolling_upgrade: "yes" {% endif %} +{% if scenario == "cinder-lvm" %} +enable_cinder: "yes" +enable_cinder_backend_lvm: "yes" +glance_api_hosts: ["{{ inventory_hostname }}"] +{% endif %} + {% if scenario == "zun" %} enable_zun: "yes" enable_kuryr: "yes" diff --git a/tests/test-openstack.sh b/tests/test-openstack.sh index 156125252d..cbffebe833 100755 --- a/tests/test-openstack.sh +++ b/tests/test-openstack.sh @@ -24,7 +24,7 @@ function test_openstack_logged { fi echo "SUCCESS: Server creation" - if echo $ACTION | grep -q "ceph"; then + if [[ $ACTION = "ceph" ]] || [[ $ACTION == "cinder-lvm" ]]; then echo "TESTING: Cinder volume attachment" openstack volume create --size 2 test_volume openstack server add volume kolla_boot_test test_volume --device /dev/vdb diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh index debea5e3c3..87b57d685e 100755 --- a/tools/setup_gate.sh +++ b/tools/setup_gate.sh @@ -44,6 +44,10 @@ EOF GATE_IMAGES+=",ceph,cinder" fi + if [[ $ACTION == "cinder-lvm" ]]; then + GATE_IMAGES+=",cinder,iscsid,tgtd" + fi + if [[ $ACTION == "zun" ]]; then GATE_IMAGES+=",zun,kuryr,etcd" fi diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 86668e205c..ce5cee9430 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -102,6 +102,26 @@ secondary2: ceph_osd_storetype: bluestore +- job: + name: kolla-ansible-ubuntu-source-cinder-lvm + parent: kolla-ansible-base + nodeset: kolla-ansible-xenial-multi + voting: false + vars: + base_distro: ubuntu + install_type: source + scenario: cinder-lvm + +- job: + name: kolla-ansible-centos-source-cinder-lvm + parent: kolla-ansible-base + nodeset: kolla-ansible-centos-multi + voting: false + vars: + base_distro: centos + install_type: source + scenario: cinder-lvm + - job: name: kolla-ansible-bifrost-centos-source parent: kolla-ansible-bifrost-base diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 503fbcd31a..7da2fd90e2 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -18,6 +18,10 @@ - kolla-ansible-ubuntu-source-ceph - kolla-ansible-centos-source-ceph - kolla-ansible-oraclelinux-source-ceph + - kolla-ansible-ubuntu-source-cinder-lvm: + files: ^ansible\/roles\/(cinder|iscsi)\/.* + - kolla-ansible-centos-source-cinder-lvm: + files: ^ansible\/roles\/(cinder|iscsi)\/.* - kolla-ansible-bifrost-centos-source: files: ^ansible\/roles\/bifrost\/.* - kolla-ansible-ubuntu-source-zun: @@ -33,3 +37,5 @@ - kolla-ansible-bifrost-centos-source - kolla-ansible-ubuntu-source-zun - kolla-ansible-centos-source-scenario-nfv + - kolla-ansible-ubuntu-source-cinder-lvm + - kolla-ansible-centos-source-cinder-lvm