Testing Masakari role in gate
Add Masakari testing into the Gate. Change-Id: I52df33f963e7d2ae4059887df3d24d9e6642134e Depends-On: https://review.opendev.org/#/c/615469/ Depends-On: https://review.opendev.org/#/c/615715 Implements: blueprint ansible-masakari Co-Authored-By: Gaëtan Trellu <gaetan.trellu@incloudus.com>
This commit is contained in:
parent
b599f78dd7
commit
fbac54c5f5
@ -222,6 +222,13 @@
|
||||
chdir: "{{ kolla_ansible_src_dir }}"
|
||||
when: scenario == "ironic"
|
||||
|
||||
- name: Run test-masakari.sh script
|
||||
script:
|
||||
cmd: test-masakari.sh
|
||||
executable: /bin/bash
|
||||
chdir: "{{ kolla_ansible_src_dir }}"
|
||||
when: scenario == "masakari"
|
||||
|
||||
- name: Run reconfigure.sh script
|
||||
script:
|
||||
cmd: reconfigure.sh
|
||||
|
@ -83,3 +83,7 @@ enable_barbican: "yes"
|
||||
enable_ironic: "yes"
|
||||
ironic_dnsmasq_dhcp_range: "10.42.0.2,10.42.0.254"
|
||||
{% endif %}
|
||||
|
||||
{% if scenario == "masakari" %}
|
||||
enable_masakari: "yes"
|
||||
{% endif %}
|
||||
|
@ -381,6 +381,16 @@ network
|
||||
[manila-data:children]
|
||||
manila
|
||||
|
||||
# Masakari
|
||||
[masakari-api:children]
|
||||
control
|
||||
|
||||
[masakari-engine:children]
|
||||
control
|
||||
|
||||
[masakari-monitors:children]
|
||||
compute
|
||||
|
||||
# Swift
|
||||
[swift-proxy-server:children]
|
||||
swift
|
||||
|
62
tests/test-masakari.sh
Executable file
62
tests/test-masakari.sh
Executable file
@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
||||
# Enable unbuffered output for Ansible in Jenkins.
|
||||
export PYTHONUNBUFFERED=1
|
||||
|
||||
function test_masakari_logged {
|
||||
|
||||
# Source OpenStack credentials
|
||||
. /etc/kolla/admin-openrc.sh
|
||||
|
||||
# Activate virtualenv to access Masakari client
|
||||
. ~/openstackclient-venv/bin/activate
|
||||
|
||||
# NOTE:(gtrellu) Masakari client/API has a bug which generate a mismatch
|
||||
# between what the client send and what the API should received.
|
||||
CLIENT_OPTS="--os-ha-api-version 1.0"
|
||||
|
||||
# Get the first Nova compute
|
||||
if ! HYPERVISOR=$(openstack hypervisor list -f value -c 'Hypervisor Hostname' | head -n1); then
|
||||
echo "Unable to get Nova hypervisor list"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Create Masakari segment
|
||||
if ! openstack $CLIENT_OPTS segment create test_segment auto COMPUTE; then
|
||||
echo "Unable to create Masakari segment"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Add Nova compute to Masakari segment
|
||||
if ! openstack $CLIENT_OPTS segment host create $HYPERVISOR COMPUTE SSH test_segment; then
|
||||
echo "Unable to add Nova hypervisor to Masakari segment"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Delete Masakari segment
|
||||
if ! openstack $CLIENT_OPTS segment delete test_segment; then
|
||||
echo "Unable to delete Masakari segment"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Exit virtualenv
|
||||
deactivate
|
||||
}
|
||||
|
||||
function test_masakari {
|
||||
echo "Testing Masakari"
|
||||
test_masakari_logged > /tmp/logs/ansible/test-masakari 2>&1
|
||||
result=$?
|
||||
if [[ $result != 0 ]]; then
|
||||
echo "Testing Masakari failed. See ansible/test-masakari for details"
|
||||
else
|
||||
echo "Successfully tested Masakari. See ansible/test-masakari for details"
|
||||
fi
|
||||
return $result
|
||||
}
|
||||
|
||||
test_masakari
|
@ -19,6 +19,9 @@ function setup_openstack_clients {
|
||||
if [[ $ACTION == ironic ]]; then
|
||||
~/openstackclient-venv/bin/pip install python-ironicclient
|
||||
fi
|
||||
if [[ $ACTION == masakari ]]; then
|
||||
~/openstackclient-venv/bin/pip install python-masakariclient
|
||||
fi
|
||||
}
|
||||
|
||||
function setup_config {
|
||||
@ -58,6 +61,9 @@ EOF
|
||||
if [[ $ACTION == "ironic" ]]; then
|
||||
GATE_IMAGES+=",dnsmasq,ironic,iscsid"
|
||||
fi
|
||||
if [[ $ACTION == "masakari" ]]; then
|
||||
GATE_IMAGES+=",masakari"
|
||||
fi
|
||||
|
||||
cat <<EOF | sudo tee /etc/kolla/kolla-build.conf
|
||||
[DEFAULT]
|
||||
|
@ -203,3 +203,23 @@
|
||||
vars:
|
||||
base_distro: ubuntu
|
||||
install_type: binary
|
||||
|
||||
- job:
|
||||
name: kolla-ansible-ubuntu-source-masakari
|
||||
parent: kolla-ansible-base
|
||||
nodeset: kolla-ansible-bionic
|
||||
voting: false
|
||||
vars:
|
||||
base_distro: ubuntu
|
||||
install_type: source
|
||||
scenario: masakari
|
||||
|
||||
- job:
|
||||
name: kolla-ansible-centos-source-masakari
|
||||
parent: kolla-ansible-base
|
||||
nodeset: kolla-ansible-centos
|
||||
voting: false
|
||||
vars:
|
||||
base_distro: centos
|
||||
install_type: source
|
||||
scenario: masakari
|
||||
|
@ -30,6 +30,14 @@
|
||||
files:
|
||||
- ^ansible/roles/(barbican|heat|mistral|redis|tacker)/
|
||||
- ^tests/test-scenario-nfv.sh
|
||||
- kolla-ansible-ubuntu-source-masakari:
|
||||
files:
|
||||
- ^ansible/roles/masakari/
|
||||
- ^tests/test-masakari.sh
|
||||
- kolla-ansible-centos-source-masakari:
|
||||
files:
|
||||
- ^ansible/roles/masakari/
|
||||
- ^tests/test-masakari.sh
|
||||
- kolla-ansible-centos-source-ironic
|
||||
- kolla-ansible-centos-binary-ironic
|
||||
- kolla-ansible-ubuntu-source-ironic
|
||||
@ -50,6 +58,8 @@
|
||||
jobs:
|
||||
- kolla-ansible-bifrost-centos-source
|
||||
- kolla-ansible-ubuntu-source-zun
|
||||
- kolla-ansible-ubuntu-source-masakari
|
||||
- kolla-ansible-centos-source-masakari
|
||||
- kolla-ansible-centos-source-scenario-nfv
|
||||
- kolla-ansible-ubuntu-source-cinder-lvm
|
||||
- kolla-ansible-centos-source-cinder-lvm
|
||||
|
Loading…
Reference in New Issue
Block a user