aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ovn.sh
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2019-12-20 11:35:35 +0100
committerMichal Nasiadka <mnasiadka@gmail.com>2020-04-09 07:40:12 +0200
commit8a0740df977916fa5b23117f993cde7282a303bf (patch)
tree924e6a77be4cc6dc13f3b0d5862e9f56da269a4b /tests/test-ovn.sh
parentfa49143f10c5bb41c142b3bed94d34992d48baed (diff)
downloadkolla-ansible-8a0740df977916fa5b23117f993cde7282a303bf.tar.gz
kolla-ansible-8a0740df977916fa5b23117f993cde7282a303bf.zip
OVN Support
Implement OVN Ansible role. Implements: blueprint ovn-controller-neutron-ansible Depends-On: https://review.opendev.org/713422 Change-Id: Icd425dea85d58db49c838839d8f0b864b4a89a78
Diffstat (limited to 'tests/test-ovn.sh')
-rwxr-xr-xtests/test-ovn.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/test-ovn.sh b/tests/test-ovn.sh
new file mode 100755
index 000000000..bfb2dd99a
--- /dev/null
+++ b/tests/test-ovn.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -o xtrace
+set -o errexit
+set -o pipefail
+
+# Enable unbuffered output for Ansible in Jenkins.
+export PYTHONUNBUFFERED=1
+
+function test_ovn_logged {
+ # Test OVSDB cluster state
+ if [[ $BASE_DISTRO =~ ^(debian|ubuntu)$ ]]; then
+ sudo docker exec ovn_nb_db ovs-appctl -t /var/run/openvswitch/ovnnb_db.ctl cluster/status OVN_Northbound
+ sudo docker exec ovn_sb_db ovs-appctl -t /var/run/openvswitch/ovnsb_db.ctl cluster/status OVN_Southbound
+ else
+ sudo docker exec ovn_nb_db ovs-appctl -t /var/run/ovn/ovnnb_db.ctl cluster/status OVN_Northbound
+ sudo docker exec ovn_sb_db ovs-appctl -t /var/run/ovn/ovnsb_db.ctl cluster/status OVN_Southbound
+ fi
+
+ # List OVN NB/SB entries
+ sudo docker exec ovn_northd ovn-nbctl --db "tcp:192.0.2.1:6641,tcp:192.0.2.2:6641,tcp:192.0.2.3:6641" show
+ sudo docker exec ovn_northd ovn-sbctl --db "tcp:192.0.2.1:6642,tcp:192.0.2.2:6642,tcp:192.0.2.3:6642" show
+}
+
+function test_ovn {
+ echo "Testing OVN"
+ test_ovn_logged > /tmp/logs/ansible/test-ovn 2>&1
+ result=$?
+ if [[ $result != 0 ]]; then
+ echo "Testing OVN failed. See ansible/test-ovn for details"
+ else
+ echo "Successfully tested OVN. See ansible/test-ovn for details"
+ fi
+ return $result
+}
+
+test_ovn