summaryrefslogtreecommitdiffstats
path: root/sdnvpn/lib/utils.py
diff options
context:
space:
mode:
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2017-11-09 16:20:22 +0100
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2017-11-10 11:43:12 +0100
commit9c6c8f91387b3037b13848ef0230f63a5d2f57c4 (patch)
treebe3ae938abdb6204752c22b3d766d1f1d3877e49 /sdnvpn/lib/utils.py
parent846b76273c4296062a8101fe9720a38827a54150 (diff)
add resync testcase
It is an extention of testcase_11.py to check resync happens properly between ODL and OVS when there is no changes from northbound JIRA: SDNVPN-175 Change-Id: I63bd17f5e5fdab7d5ab90a2be2836e02e7dd54fa Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Diffstat (limited to 'sdnvpn/lib/utils.py')
-rw-r--r--sdnvpn/lib/utils.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/sdnvpn/lib/utils.py b/sdnvpn/lib/utils.py
index 269a319..78493be 100644
--- a/sdnvpn/lib/utils.py
+++ b/sdnvpn/lib/utils.py
@@ -756,3 +756,20 @@ def get_ovs_groups(compute_node_list, ovs_br_list, of_protocol="OpenFlow13"):
cmd_out_lines += (compute_node.run_cmd(ovs_groups_cmd).strip().
split("\n"))
return cmd_out_lines
+
+
+def get_ovs_flows(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 flows 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_flows_cmd = ("sudo ovs-ofctl dump-flows {} -O {} | "
+ "grep table=".format(ovs_br, of_protocol))
+ cmd_out_lines += (compute_node.run_cmd(ovs_flows_cmd).strip().
+ split("\n"))
+ return cmd_out_lines