Merge "CI: add magnum scenario, also covering octavia"

This commit is contained in:
Zuul 2020-09-24 15:01:06 +00:00 committed by Gerrit Code Review
commit d047b2a5e0
7 changed files with 105 additions and 0 deletions

View File

@ -188,6 +188,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
@ -405,6 +423,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

@ -126,6 +126,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