CI: add magnum scenario, also covering octavia

Adds a new Zuul job, kolla-ansible-centos8-source-magnum, for testing
deployment of Magnum, Octavia and associated services.

Change-Id: I61b293ba6bb52064ea98a73e2dff0023fa01a2a2
This commit is contained in:
Mark Goddard 2019-04-12 11:19:39 +01:00
parent b49c86848d
commit d2326712d4
7 changed files with 105 additions and 0 deletions

View File

@ -166,6 +166,24 @@
dest: ironic-agent.kernel
when: scenario == "ironic"
- block:
- name: ensure octavia config directory exists
file:
path: /etc/kolla/config/octavia
state: directory
mode: 0777
- name: create dummy TLS certificates for octavia
file:
path: "/etc/kolla/config/octavia/{{ item }}"
state: touch
with_items:
- client.cert-and-key.pem
- client_ca.cert.pem
- server_ca.cert.pem
- server_ca.key.pem
when: scenario == 'magnum'
- name: ensure /etc/ansible exists
file:
path: /etc/ansible
@ -385,6 +403,13 @@
chdir: "{{ kolla_ansible_src_dir }}"
when: scenario == "ironic"
- name: Run test-magnum.sh script
script:
cmd: test-magnum.sh
executable: /bin/bash
chdir: "{{ kolla_ansible_src_dir }}"
when: scenario == "magnum"
- name: Run test-masakari.sh script
script:
cmd: test-masakari.sh

View File

@ -17,6 +17,9 @@ function setup_openstack_clients {
if [[ $SCENARIO == ironic ]]; then
packages+=(python-ironicclient python-ironic-inspector-client)
fi
if [[ $SCENARIO == magnum ]]; then
packages+=(python-magnumclient python-octaviaclient)
fi
if [[ $SCENARIO == masakari ]]; then
packages+=(python-masakariclient)
fi
@ -59,6 +62,9 @@ function prepare_images {
if [[ $SCENARIO == "ironic" ]]; then
GATE_IMAGES+=",^dnsmasq,^ironic,^iscsid"
fi
if [[ $SCENARIO == "magnum" ]]; then
GATE_IMAGES+=",^magnum,^octavia"
fi
if [[ $SCENARIO == "masakari" ]]; then
GATE_IMAGES+=",^masakari"
fi

View File

@ -151,3 +151,8 @@ enable_grafana: "yes"
enable_prometheus: "yes"
enable_prometheus_openstack_exporter: "no"
{% endif %}
{% if scenario == "magnum" %}
enable_magnum: "yes"
enable_octavia: "yes"
{% endif %}

40
tests/test-magnum.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
# Test deployment of magnum and octavia.
set -o xtrace
set -o errexit
# Enable unbuffered output for Ansible in Jenkins.
export PYTHONUNBUFFERED=1
function test_magnum_clusters {
openstack coe cluster list
openstack coe cluster template list
}
function test_octavia {
openstack loadbalancer list
}
function test_magnum_logged {
. /etc/kolla/admin-openrc.sh
. ~/openstackclient-venv/bin/activate
test_magnum_clusters
test_octavia
}
function test_magnum {
echo "Testing Magnum and Octavia"
test_magnum_logged > /tmp/logs/ansible/test-magnum 2>&1
result=$?
if [[ $result != 0 ]]; then
echo "Testing Magnum and Octavia failed. See ansible/test-magnum for details"
else
echo "Successfully tested Magnum and Octavia. See ansible/test-magnum for details"
fi
return $result
}
test_magnum

View File

@ -124,6 +124,17 @@
- name: github.com/ceph/ceph-ansible
override-checkout: v5.0.0
- job:
name: kolla-ansible-magnum-base
parent: kolla-ansible-base
voting: false
files:
- ^ansible/roles/(magnum|octavia)/
- ^tests/test-dashboard.sh
- ^tests/test-magnum.sh
vars:
scenario: magnum
- job:
name: kolla-ansible-masakari-base
parent: kolla-ansible-base

View File

@ -249,6 +249,22 @@
base_distro: ubuntu
install_type: binary
- job:
name: kolla-ansible-centos8-source-magnum
parent: kolla-ansible-magnum-base
nodeset: kolla-ansible-centos8
vars:
base_distro: centos
install_type: source
- job:
name: kolla-ansible-ubuntu-source-magnum
parent: kolla-ansible-magnum-base
nodeset: kolla-ansible-focal
vars:
base_distro: ubuntu
install_type: source
- job:
name: kolla-ansible-ubuntu-source-masakari
parent: kolla-ansible-masakari-base

View File

@ -23,6 +23,8 @@
- kolla-ansible-centos8-source-swift
- kolla-ansible-ubuntu-source-swift
- kolla-ansible-centos8-source-scenario-nfv
- kolla-ansible-centos8-source-magnum
- kolla-ansible-ubuntu-source-magnum
- kolla-ansible-centos8-source-masakari
- kolla-ansible-ubuntu-source-masakari
- kolla-ansible-centos8-source-ironic