Enable multi-scenario gates
First non-trivial scenario we'll be testing in gates will be cinder + ceph. This patchset is supposed to create framework to easily add new testing scenarios. Change-Id: I6790eaf5cf3297af04a64e4169a39b6e2cd1890f
This commit is contained in:
parent
ea5d1a581b
commit
339b27c7fe
6
tests/ansible_setup_ceph_disks.yml
Normal file
6
tests/ansible_setup_ceph_disks.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- hosts: storage
|
||||
tasks:
|
||||
- name: "Setup loopbacks for ceph"
|
||||
script: setup_ceph_disks.sh
|
||||
register: ceph_disks_out
|
13
tests/setup_ceph_disks.sh
Normal file
13
tests/setup_ceph_disks.sh
Normal file
@ -0,0 +1,13 @@
|
||||
mkdir -p /opt/data/kolla
|
||||
dd if=/dev/zero of=/opt/data/kolla/ceph-osd0.img bs=5M count=3072
|
||||
LOOP=$(losetup -f)
|
||||
losetup $LOOP /opt/data/kolla/ceph-osd0.img
|
||||
parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_OSD1 0 14GB
|
||||
|
||||
dd if=/dev/zero of=/opt/data/kolla/ceph-journal0.img bs=5M count=1024
|
||||
LOOP=$(losetup -f)
|
||||
losetup $LOOP /opt/data/kolla/ceph-journal0.img
|
||||
parted $LOOP -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_OSD1_J 0 5GB
|
||||
|
||||
partprobe $LOOP
|
||||
|
@ -19,3 +19,8 @@ enable_horizon: "yes"
|
||||
enable_heat: "no"
|
||||
openstack_logging_debug: "True"
|
||||
openstack_service_workers: "1"
|
||||
|
||||
{% if 'ceph' in action %}
|
||||
enable_ceph: "yes"
|
||||
enable_cinder: "yes"
|
||||
{% endif %}
|
||||
|
@ -182,9 +182,14 @@ function sanity_check {
|
||||
neutron --debug agent-list
|
||||
tools/init-runonce
|
||||
nova --debug boot --poll --image $(openstack image list | awk '/cirros/ {print $2}') --nic net-id=$(openstack network list | awk '/demo-net/ {print $2}') --flavor 1 kolla_boot_test
|
||||
|
||||
nova --debug list
|
||||
# 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
|
||||
openstack volume create --size 2 test_volume
|
||||
openstack server add volume kolla_boot_test test_volume --device /dev/vdb
|
||||
fi
|
||||
}
|
||||
|
||||
function get_logs {
|
||||
@ -200,11 +205,15 @@ setup_ansible
|
||||
setup_config
|
||||
setup_node
|
||||
|
||||
ansible-playbook -e type=$INSTALL_TYPE -e base=$BASE_DISTRO tests/ansible_generate_config.yml > /tmp/logs/ansible/generate_config
|
||||
ansible-playbook -e type=$INSTALL_TYPE -e base=$BASE_DISTRO -e action=$ACTION tests/ansible_generate_config.yml > /tmp/logs/ansible/generate_config
|
||||
tools/kolla-ansible -i ${RAW_INVENTORY} bootstrap-servers > /tmp/logs/ansible/bootstrap-servers
|
||||
sudo tools/generate_passwords.py
|
||||
prepare_images
|
||||
|
||||
if echo $ACTION | grep -q "ceph"; then
|
||||
ansible-playbook -i ${RAW_INVENTORY} tests/ansible_setup_ceph_disks.yml > /tmp/logs/ansible/setup_ceph_disks
|
||||
fi
|
||||
|
||||
trap get_logs EXIT
|
||||
|
||||
# Create dummy interface for neutron
|
||||
|
Loading…
Reference in New Issue
Block a user