diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2020-04-16 12:25:07 +0200 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2020-04-16 18:13:35 +0200 |
| commit | ca380e6d3042dce7f06de3f06d0407d8cdb9804c (patch) | |
| tree | 2ae74adecdefbee486a7f2bb6d6a0c1aa26e7ee9 /tests/test-ovn.sh | |
| parent | 975db2b2b4e338ba6f111bbb4fc51d27cdd44ce5 (diff) | |
| download | kolla-ansible-ca380e6d3042dce7f06de3f06d0407d8cdb9804c.tar.gz kolla-ansible-ca380e6d3042dce7f06de3f06d0407d8cdb9804c.zip | |
OVN: Followup changes
Followup of last reviews from [1].
[1]: https://review.opendev.org/#/c/696841
Change-Id: I7085093b20e8848e09dc521ae9fbf120e909470d
Diffstat (limited to 'tests/test-ovn.sh')
| -rwxr-xr-x | tests/test-ovn.sh | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/tests/test-ovn.sh b/tests/test-ovn.sh index bfb2dd99a..fb13682da 100755 --- a/tests/test-ovn.sh +++ b/tests/test-ovn.sh @@ -4,22 +4,37 @@ set -o xtrace set -o errexit set -o pipefail -# Enable unbuffered output for Ansible in Jenkins. +# Enable unbuffered output export PYTHONUNBUFFERED=1 function test_ovn_logged { + # List OVN NB/SB entries + echo "OVN NB DB 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 + + echo "OVN SB DB entries:" + 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 + # 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 + OVNNB_STATUS=$(sudo docker exec ovn_nb_db ovs-appctl -t /var/run/openvswitch/ovnnb_db.ctl cluster/status OVN_Northbound) + OVNSB_STATUS=$(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 + OVNNB_STATUS=$(sudo docker exec ovn_nb_db ovs-appctl -t /var/run/ovn/ovnnb_db.ctl cluster/status OVN_Northbound) + OVNSB_STATUS=$(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 + if [[ $(grep -o "at tcp:" <<< ${OVNNB_STATUS} | wc -l) != "3" ]]; then + echo "ERR: NB Cluster does not have 3 nodes" + echo "Output: ${OVNNB_STATUS}" + exit 1 + fi + + if [[ $(grep -o "at tcp:" <<< ${OVNSB_STATUS} | wc -l) != "3" ]]; then + echo "ERR: SB Cluster does not have 3 nodes" + echo "Output: ${OVNSB_STATUS}" + exit 1 + fi } function test_ovn { |
