Merge "CI: enable designate in magnum CI job"

This commit is contained in:
Zuul 2020-10-07 20:54:05 +00:00 committed by Gerrit Code Review
commit 8cf8459270
5 changed files with 54 additions and 8 deletions

View File

@ -26,6 +26,12 @@
upper_constraints_file: "{{ ansible_env.HOME }}/src/opendev.org/openstack/requirements/upper-constraints.txt" upper_constraints_file: "{{ ansible_env.HOME }}/src/opendev.org/openstack/requirements/upper-constraints.txt"
docker_image_tag_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}" docker_image_tag_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}"
- name: Install dig for Designate testing
become: true
package:
name: "{{ 'bind-utils' if ansible_os_family == 'RedHat' else 'dnsutils' }}"
when: scenario == 'magnum'
- name: Install xfsprogs package for Swift filesystems - name: Install xfsprogs package for Swift filesystems
become: true become: true
package: package:
@ -384,7 +390,7 @@
EXT_NET_LOCAL_ADDR: "{{ neutron_external_network_prefix }}1/{{ neutron_external_network_prefix_length }}" EXT_NET_LOCAL_ADDR: "{{ neutron_external_network_prefix }}1/{{ neutron_external_network_prefix_length }}"
EXT_NET_SLAVE_DEVICE: "{{ neutron_external_interface_name }}" EXT_NET_SLAVE_DEVICE: "{{ neutron_external_interface_name }}"
SCENARIO: "{{ scenario }}" SCENARIO: "{{ scenario }}"
when: openstack_core_tested or scenario in ['ironic', 'scenario_nfv', 'zun'] when: openstack_core_tested or scenario in ['ironic', 'magnum', 'scenario_nfv', 'zun']
- name: Run test-core-openstack.sh script - name: Run test-core-openstack.sh script
script: script:

View File

@ -18,7 +18,7 @@ function setup_openstack_clients {
packages+=(python-ironicclient python-ironic-inspector-client) packages+=(python-ironicclient python-ironic-inspector-client)
fi fi
if [[ $SCENARIO == magnum ]]; then if [[ $SCENARIO == magnum ]]; then
packages+=(python-magnumclient python-octaviaclient) packages+=(python-designateclient python-magnumclient python-octaviaclient)
fi fi
if [[ $SCENARIO == masakari ]]; then if [[ $SCENARIO == masakari ]]; then
packages+=(python-masakariclient) packages+=(python-masakariclient)
@ -63,7 +63,7 @@ function prepare_images {
GATE_IMAGES+=",^dnsmasq,^ironic,^iscsid" GATE_IMAGES+=",^dnsmasq,^ironic,^iscsid"
fi fi
if [[ $SCENARIO == "magnum" ]]; then if [[ $SCENARIO == "magnum" ]]; then
GATE_IMAGES+=",^magnum,^octavia" GATE_IMAGES+=",^designate,^magnum,^octavia"
fi fi
if [[ $SCENARIO == "masakari" ]]; then if [[ $SCENARIO == "masakari" ]]; then
GATE_IMAGES+=",^masakari" GATE_IMAGES+=",^masakari"

View File

@ -154,6 +154,7 @@ enable_prometheus_openstack_exporter: "no"
{% endif %} {% endif %}
{% if scenario == "magnum" %} {% if scenario == "magnum" %}
enable_designate: "yes"
enable_magnum: "yes" enable_magnum: "yes"
enable_octavia: "yes" enable_octavia: "yes"
{% endif %} {% endif %}

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Test deployment of magnum and octavia. # Test deployment of magnum, octavia and designate.
set -o xtrace set -o xtrace
set -o errexit set -o errexit
@ -18,21 +18,60 @@ function test_octavia {
openstack loadbalancer list openstack loadbalancer list
} }
function test_designate {
# Smoke test.
openstack zone list --all
# Create a default zone for fixed and floating IPs, then reconfigure nova
# and neutron to use it.
openstack zone create --email admin@example.org example.org.
ZONE_ID=$(openstack zone show example.org. -f value -c id)
mkdir -p /etc/kolla/config/designate/
cat << EOF > /etc/kolla/config/designate/designate-sink.conf
[handler:nova_fixed]
zone_id = ${ZONE_ID}
[handler:neutron_floatingip]
zone_id = ${ZONE_ID}
EOF
RAW_INVENTORY=/etc/kolla/inventory
kolla-ansible -i ${RAW_INVENTORY} --tags designate -vvv reconfigure &> /tmp/logs/ansible/reconfigure-designate
# Create an instance, and check that its name resolves.
openstack server create --wait --image cirros --flavor m1.tiny --key-name mykey --network demo-net dns-test --wait
attempt=1
while true; do
IP=$(dig +short @192.0.2.1 dns-test.example.org. A)
if [[ -n $IP ]]; then
break
fi
attempt=$((attempt+1))
if [[ $attempt -eq 10 ]]; then
echo "Failed to resolve dns-test.example.org."
openstack recordset list ${ZONE_ID}
exit 1
fi
sleep 10
done
}
function test_magnum_logged { function test_magnum_logged {
. /etc/kolla/admin-openrc.sh . /etc/kolla/admin-openrc.sh
. ~/openstackclient-venv/bin/activate . ~/openstackclient-venv/bin/activate
test_magnum_clusters test_magnum_clusters
test_octavia test_octavia
test_designate
} }
function test_magnum { function test_magnum {
echo "Testing Magnum and Octavia" echo "Testing Magnum, Octavia and Designate"
test_magnum_logged > /tmp/logs/ansible/test-magnum 2>&1 test_magnum_logged > /tmp/logs/ansible/test-magnum 2>&1
result=$? result=$?
if [[ $result != 0 ]]; then if [[ $result != 0 ]]; then
echo "Testing Magnum and Octavia failed. See ansible/test-magnum for details" echo "Testing Magnum, Octavia and Designate failed. See ansible/test-magnum for details"
else else
echo "Successfully tested Magnum and Octavia. See ansible/test-magnum for details" echo "Successfully tested Magnum, Octavia and Designate . See ansible/test-magnum for details"
fi fi
return $result return $result
} }

View File

@ -131,7 +131,7 @@
parent: kolla-ansible-base parent: kolla-ansible-base
voting: false voting: false
files: files:
- ^ansible/roles/(magnum|octavia)/ - ^ansible/roles/(designate|magnum|octavia)/
- ^tests/test-dashboard.sh - ^tests/test-dashboard.sh
- ^tests/test-magnum.sh - ^tests/test-magnum.sh
vars: vars: