aboutsummaryrefslogtreecommitdiff
path: root/tests/test-magnum.sh
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2020-09-25 17:54:56 +0100
committerMark Goddard <mark@stackhpc.com>2020-10-07 14:55:10 +0000
commitc2987d6582a6017e3839d6432bdf85949f5ef42d (patch)
tree27c842fe9aa33ac3005485ed6839b94a260a0cb8 /tests/test-magnum.sh
parentd047b2a5e00c108b1aea57a0c9b7f0ef96f4b50b (diff)
downloadkolla-ansible-c2987d6582a6017e3839d6432bdf85949f5ef42d.tar.gz
kolla-ansible-c2987d6582a6017e3839d6432bdf85949f5ef42d.zip
CI: enable designate in magnum CI job
Follows designate guide, adding a default zone for fixed and floating IPs, then boots an instance and verifies that its name resolves. Change-Id: Ifbfdab425e2c8a36a8f3ab8539f70dca4cce2abc
Diffstat (limited to 'tests/test-magnum.sh')
-rwxr-xr-xtests/test-magnum.sh47
1 files changed, 43 insertions, 4 deletions
diff --git a/tests/test-magnum.sh b/tests/test-magnum.sh
index 9519fba25..bd43dd945 100755
--- a/tests/test-magnum.sh
+++ b/tests/test-magnum.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Test deployment of magnum and octavia.
+# Test deployment of magnum, octavia and designate.
set -o xtrace
set -o errexit
@@ -18,21 +18,60 @@ function test_octavia {
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 {
. /etc/kolla/admin-openrc.sh
. ~/openstackclient-venv/bin/activate
test_magnum_clusters
test_octavia
+ test_designate
}
function test_magnum {
- echo "Testing Magnum and Octavia"
+ echo "Testing Magnum, Octavia and Designate"
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"
+ echo "Testing Magnum, Octavia and Designate failed. See ansible/test-magnum for details"
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
return $result
}