summaryrefslogtreecommitdiffstats
path: root/testcases/features/sfc/ovs_utils.py
diff options
context:
space:
mode:
authorManuel Buil <manuel.buil@ericsson.com>2016-11-08 18:16:35 +0100
committerGeorge Paraskevopoulos <geopar@intracom-telecom.com>2016-11-17 16:06:23 +0200
commit5757ef49379bdefab7d9fbfe8f75bd4f580719f9 (patch)
tree176ec73adf8291287846f98d536ca4a9117ab800 /testcases/features/sfc/ovs_utils.py
parent27d29fae80b84b148317b59f88e2ce997b2c9f66 (diff)
Feature to know the time it takes to update OVS
ODL takes too much time to update the classification rules and we would like to measure it to use it as a proof point that it is not acceptable. This feature allows to measure it. Change-Id: I00ade7e4aee7c9c81843077104727b98ad9bfea3 Signed-off-by: Manuel Buil <manuel.buil@ericsson.com>
Diffstat (limited to 'testcases/features/sfc/ovs_utils.py')
-rw-r--r--testcases/features/sfc/ovs_utils.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/testcases/features/sfc/ovs_utils.py b/testcases/features/sfc/ovs_utils.py
index 20ab5a7e3..af1f232c8 100644
--- a/testcases/features/sfc/ovs_utils.py
+++ b/testcases/features/sfc/ovs_utils.py
@@ -11,6 +11,7 @@ import functest.utils.functest_logger as rl
import os
import time
import shutil
+import re
logger = rl.Logger('ovs_utils').getLogger()
@@ -115,3 +116,22 @@ class OVSLogger(object):
dumpdir = os.path.join(self.ovs_dir, timestamp)
with open(os.path.join(dumpdir, 'error'), 'w') as f:
f.write(related_error)
+
+ def ofctl_time_counter(self, ssh_conn):
+ try:
+ # We get the flows from table 11
+ table = 11
+ br = "br-int"
+ output = self.ofctl_dump_flows(ssh_conn, br, table)
+ pattern = "NXM_NX_NSP"
+ rsps = []
+ lines = output.split(",")
+ for line in lines:
+ is_there = re.findall(pattern, line)
+ if is_there:
+ value = line.split(":")[1].split("-")[0]
+ rsps.append(value)
+ return rsps
+ except Exception, e:
+ logger.error('Error when countering %s' % e)
+ return None