diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-07-31 17:35:00 +0200 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-07-31 12:49:19 -0700 |
commit | 82b261b9efdb7af4c2146178db10e901a9580f30 (patch) | |
tree | 3fd58d59f4081e1af8ef196a1a0358cd2fee2650 /tests | |
parent | d2f441997b23dca303f59524a53865497e613620 (diff) | |
download | openvswitch-82b261b9efdb7af4c2146178db10e901a9580f30.tar.gz |
Introduce ovs-appctl command to monitor HVs sb connection status
Add 'connection-status' command to ovs-appctl utility in order to check
if a given chassis is currently connected to SB db
Acked-by: Mark Michelson <mmichels@redhat.com>
Co-authored-by: aginwala <aginwala@ebay.com>
Signed-off-by: aginwala <aginwala@ebay.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ovn-controller.at | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index ecc6a50da..13e88a0cc 100644 --- a/tests/ovn-controller.at +++ b/tests/ovn-controller.at @@ -228,3 +228,37 @@ as ovn-sb OVS_APP_EXIT_AND_WAIT([ovsdb-server]) AT_CLEANUP + +# Check ovn-controller connection status to Southbound database +AT_SETUP([ovn-controller - check sbdb connection]) +AT_KEYWORDS([ovn]) +ovn_init_db ovn-sb + +net_add n1 +sim_add hv +as hv +ovs-vsctl \ + -- add-br br-phys \ + -- add-br br-eth0 \ + -- add-br br-eth1 \ + -- add-br br-eth2 +ovn_attach n1 br-phys 192.168.0.1 + +check_sbdb_connection () { + test "$(ovs-appctl -t ovn-controller connection-status)" = "$1" +} + +OVS_WAIT_UNTIL([check_sbdb_connection connected]) + +ovs-vsctl set open . external_ids:ovn-remote=tcp:192.168.0.10:6642 +OVS_WAIT_UNTIL([check_sbdb_connection 'not connected']) + +# reset the remote for clean-up +ovs-vsctl set open . external_ids:ovn-remote=unix:$ovs_base/ovn-sb/ovn-sb.sock +# Gracefully terminate daemons +OVN_CLEANUP_SBOX([hv]) +OVN_CLEANUP_VSWITCH([main]) +as ovn-sb +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) + +AT_CLEANUP |