diff options
author | pperiyasamy <periyasamy.palanisamy@ericsson.com> | 2017-08-08 13:23:11 +0000 |
---|---|---|
committer | Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com> | 2017-11-08 07:30:05 +0100 |
commit | 8211ebd59a28be997386030cb1f87e0630770a78 (patch) | |
tree | 5ae1e3a0eccb7fd21f48124e2806f7f40c2f73a8 /sdnvpn/lib/utils.py | |
parent | aa3ceb31df148f5ebb185271b10e4fd60fac3db1 (diff) |
Test groups are deleted after ovs reconnection
Create a new testcase (Testcase 11)
Testing procedure:
Create a Network with 2 VMs so that a group is added
to ovs. Disconnect ovs. Remove the Network and the VMs.
Connect ovs again. Check that the group is deleted from
it.
JIRA: SDNVPN-151
Change-Id: I4c6f5e16f837bbcc589cbbbf05896a2d17b9cd57
Signed-off-by: panageo2 <panageo@intracom-telecom.com>
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Diffstat (limited to 'sdnvpn/lib/utils.py')
-rw-r--r-- | sdnvpn/lib/utils.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sdnvpn/lib/utils.py b/sdnvpn/lib/utils.py index 371f3ed..54c9730 100644 --- a/sdnvpn/lib/utils.py +++ b/sdnvpn/lib/utils.py @@ -727,3 +727,20 @@ def get_nova_instances_quota(nova_client): except Exception as e: logger.error("Error in getting nova instances quota: %s" % e) raise + + +def get_ovs_groups(compute_node_list, ovs_br_list, of_protocol="OpenFlow13"): + """ + Gets, as input, a list of compute nodes and a list of OVS bridges + and returns the command console output, as a list of lines, that + contains all the OVS groups from all bridges and nodes in lists. + """ + cmd_out_lines = [] + for compute_node in compute_node_list: + for ovs_br in ovs_br_list: + if ovs_br in compute_node.run_cmd("sudo ovs-vsctl show"): + ovs_groups_cmd = ("sudo ovs-ofctl dump-groups {} -O {} | " + "grep group".format(ovs_br, of_protocol)) + cmd_out_lines += (compute_node.run_cmd(ovs_groups_cmd).strip(). + split("\n")) + return cmd_out_lines |