Merge "CI: Add mariadb test"
This commit is contained in:
commit
2fb08fa4e1
@ -23,6 +23,12 @@ function deploy {
|
|||||||
tools/kolla-ansible -i ${RAW_INVENTORY} -vvv post-deploy &> /tmp/logs/ansible/post-deploy
|
tools/kolla-ansible -i ${RAW_INVENTORY} -vvv post-deploy &> /tmp/logs/ansible/post-deploy
|
||||||
tools/kolla-ansible -i ${RAW_INVENTORY} -vvv check &> /tmp/logs/ansible/check-deploy
|
tools/kolla-ansible -i ${RAW_INVENTORY} -vvv check &> /tmp/logs/ansible/check-deploy
|
||||||
|
|
||||||
|
if [[ ${ACTION} != "mariadb" ]]; then
|
||||||
|
init_runonce
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function init_runonce {
|
||||||
. /etc/kolla/admin-openrc.sh
|
. /etc/kolla/admin-openrc.sh
|
||||||
. ~/openstackclient-venv/bin/activate
|
. ~/openstackclient-venv/bin/activate
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@
|
|||||||
# nova-compute.conf
|
# nova-compute.conf
|
||||||
- src: "tests/templates/nova-compute-overrides.j2"
|
- src: "tests/templates/nova-compute-overrides.j2"
|
||||||
dest: /etc/kolla/config/nova/nova-compute.conf
|
dest: /etc/kolla/config/nova/nova-compute.conf
|
||||||
when: "{{ scenario != 'bifrost' }}"
|
when: "{{ scenario not in ['bifrost', 'mariadb'] }}"
|
||||||
# ceph.conf
|
# ceph.conf
|
||||||
- src: "tests/templates/ceph-overrides.j2"
|
- src: "tests/templates/ceph-overrides.j2"
|
||||||
dest: /etc/kolla/config/ceph.conf
|
dest: /etc/kolla/config/ceph.conf
|
||||||
@ -212,7 +212,7 @@
|
|||||||
chdir: "{{ kolla_ansible_src_dir }}"
|
chdir: "{{ kolla_ansible_src_dir }}"
|
||||||
environment:
|
environment:
|
||||||
ACTION: "{{ scenario }}"
|
ACTION: "{{ scenario }}"
|
||||||
when: scenario not in ['ironic', 'scenario_nfv']
|
when: scenario not in ['ironic', 'mariadb', 'scenario_nfv']
|
||||||
|
|
||||||
- name: Run test-zun.sh script
|
- name: Run test-zun.sh script
|
||||||
shell:
|
shell:
|
||||||
@ -242,6 +242,13 @@
|
|||||||
chdir: "{{ kolla_ansible_src_dir }}"
|
chdir: "{{ kolla_ansible_src_dir }}"
|
||||||
when: scenario == "masakari"
|
when: scenario == "masakari"
|
||||||
|
|
||||||
|
- name: Run test-mariadb.sh script
|
||||||
|
script:
|
||||||
|
cmd: test-mariadb.sh
|
||||||
|
executable: /bin/bash
|
||||||
|
chdir: "{{ kolla_ansible_src_dir }}"
|
||||||
|
when: scenario == "mariadb"
|
||||||
|
|
||||||
- name: Run reconfigure.sh script
|
- name: Run reconfigure.sh script
|
||||||
script:
|
script:
|
||||||
cmd: reconfigure.sh
|
cmd: reconfigure.sh
|
||||||
|
@ -100,3 +100,12 @@ enable_masakari: "yes"
|
|||||||
{% if scenario == "cells" %}
|
{% if scenario == "cells" %}
|
||||||
enable_cells: "yes"
|
enable_cells: "yes"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if scenario == "mariadb" %}
|
||||||
|
enable_chrony: "no"
|
||||||
|
enable_fluentd: "no"
|
||||||
|
enable_mariadb: "yes"
|
||||||
|
enable_memcached: "no"
|
||||||
|
enable_openstack_core: "no"
|
||||||
|
enable_rabbitmq: "no"
|
||||||
|
{% endif %}
|
||||||
|
50
tests/test-mariadb.sh
Executable file
50
tests/test-mariadb.sh
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -o xtrace
|
||||||
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
# Enable unbuffered output for Ansible in Jenkins.
|
||||||
|
export PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
|
|
||||||
|
function mariadb_stop {
|
||||||
|
echo "Stopping the database cluster"
|
||||||
|
tools/kolla-ansible -i ${RAW_INVENTORY} -vvv stop --yes-i-really-really-mean-it --tags mariadb --skip-tags common
|
||||||
|
if [[ $(sudo docker ps -q | grep mariadb | wc -l) -ne 0 ]]; then
|
||||||
|
echo "Failed to stop MariaDB cluster"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function mariadb_recovery {
|
||||||
|
# Recover the database cluster.
|
||||||
|
echo "Recovering the database cluster"
|
||||||
|
tools/kolla-ansible -i ${RAW_INVENTORY} -vvv mariadb_recovery --tags mariadb --skip-tags common
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_recovery {
|
||||||
|
# Stop all nodes in the cluster, then recover.
|
||||||
|
mariadb_stop
|
||||||
|
mariadb_recovery
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_mariadb_logged {
|
||||||
|
RAW_INVENTORY=/etc/kolla/inventory
|
||||||
|
test_recovery
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_mariadb {
|
||||||
|
echo "Testing MariaDB"
|
||||||
|
test_mariadb_logged > /tmp/logs/ansible/test-mariadb 2>&1
|
||||||
|
result=$?
|
||||||
|
if [[ $result != 0 ]]; then
|
||||||
|
echo "Testing MariaDB failed. See ansible/test-mariadb for details"
|
||||||
|
else
|
||||||
|
echo "Successfully tested MariaDB. See ansible/test-mariadb for details"
|
||||||
|
fi
|
||||||
|
return $result
|
||||||
|
}
|
||||||
|
|
||||||
|
test_mariadb
|
@ -53,6 +53,10 @@ function setup_config {
|
|||||||
GATE_IMAGES+=",masakari"
|
GATE_IMAGES+=",masakari"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $ACTION == "mariadb" ]]; then
|
||||||
|
GATE_IMAGES="cron,haproxy,keepalived,kolla-toolbox,mariadb"
|
||||||
|
fi
|
||||||
|
|
||||||
cat <<EOF | sudo tee /etc/kolla/kolla-build.conf
|
cat <<EOF | sudo tee /etc/kolla/kolla-build.conf
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
namespace = lokolla
|
namespace = lokolla
|
||||||
|
@ -106,6 +106,26 @@
|
|||||||
install_type: source
|
install_type: source
|
||||||
scenario: cinder-lvm
|
scenario: cinder-lvm
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: kolla-ansible-centos-source-mariadb
|
||||||
|
parent: kolla-ansible-base
|
||||||
|
nodeset: kolla-ansible-centos-multi
|
||||||
|
voting: false
|
||||||
|
vars:
|
||||||
|
base_distro: centos
|
||||||
|
install_type: source
|
||||||
|
scenario: mariadb
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: kolla-ansible-ubuntu-source-mariadb
|
||||||
|
parent: kolla-ansible-base
|
||||||
|
nodeset: kolla-ansible-bionic-multi
|
||||||
|
voting: false
|
||||||
|
vars:
|
||||||
|
base_distro: ubuntu
|
||||||
|
install_type: source
|
||||||
|
scenario: mariadb
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: kolla-ansible-centos-source-upgrade
|
name: kolla-ansible-centos-source-upgrade
|
||||||
parent: kolla-ansible-upgrade-base
|
parent: kolla-ansible-upgrade-base
|
||||||
|
@ -48,6 +48,14 @@
|
|||||||
- kolla-ansible-centos-binary
|
- kolla-ansible-centos-binary
|
||||||
- kolla-ansible-ubuntu-binary
|
- kolla-ansible-ubuntu-binary
|
||||||
- kolla-ansible-centos-source-cells
|
- kolla-ansible-centos-source-cells
|
||||||
|
- kolla-ansible-centos-source-mariadb:
|
||||||
|
files:
|
||||||
|
- ^ansible/roles/mariadb/
|
||||||
|
- ^tests/test-mariadb.sh
|
||||||
|
- kolla-ansible-ubuntu-source-mariadb:
|
||||||
|
files:
|
||||||
|
- ^ansible/roles/mariadb/
|
||||||
|
- ^tests/test-mariadb.sh
|
||||||
gate:
|
gate:
|
||||||
queue: kolla
|
queue: kolla
|
||||||
jobs:
|
jobs:
|
||||||
@ -72,3 +80,5 @@
|
|||||||
- kolla-ansible-ubuntu-source-upgrade
|
- kolla-ansible-ubuntu-source-upgrade
|
||||||
- kolla-ansible-centos-source-upgrade-ceph
|
- kolla-ansible-centos-source-upgrade-ceph
|
||||||
- kolla-ansible-ubuntu-source-upgrade-ceph
|
- kolla-ansible-ubuntu-source-upgrade-ceph
|
||||||
|
- kolla-ansible-centos-source-mariadb
|
||||||
|
- kolla-ansible-ubuntu-source-mariadb
|
||||||
|
Loading…
x
Reference in New Issue
Block a user