diff options
-rw-r--r-- | sfc/lib/utils.py | 19 | ||||
-rw-r--r-- | sfc/tests/functest/config.yaml | 6 |
2 files changed, 20 insertions, 5 deletions
diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py index 032dcfd3..3238e097 100644 --- a/sfc/lib/utils.py +++ b/sfc/lib/utils.py @@ -342,7 +342,7 @@ def check_ssh(ips, retries=100): return False -def ofctl_time_counter(ovs_logger, ssh_conn): +def ofctl_time_counter(ovs_logger, ssh_conn, max_duration=None): try: # We get the flows from table 11 table = 11 @@ -352,6 +352,17 @@ def ofctl_time_counter(ovs_logger, ssh_conn): rsps = [] lines = output.split(",") for line in lines: + if max_duration is not None: + pattern2 = "duration" + is_there2 = re.findall(pattern2, line) + if is_there2: + value = line.split("=")[1].split(".")[0] + value_int = int(value) + if value_int < max_duration: + # The RSP is new, no need to store the RSP in first_RSP + return rsps + else: + continue is_there = re.findall(pattern, line) if is_there: value = line.split(":")[1].split("-")[0] @@ -364,7 +375,11 @@ def ofctl_time_counter(ovs_logger, ssh_conn): @ft_utils.timethis def wait_for_classification_rules(ovs_logger, compute_clients, timeout=200): - rsps = ofctl_time_counter(ovs_logger, compute_clients[0]) + # 10 sec. is the threshold to consider a flow from an old deployment + max_duration = 10 + rsps = ofctl_time_counter(ovs_logger, compute_clients[0], max_duration) + # first_RSP saves a potential RSP from an old deployment. ODL may take + # quite some time to implement the new flow and an old flow may be there first_RSP = rsps[0] if len(rsps) > 0 else '' while not ((len(rsps) > 1) and (first_RSP != rsps[0]) and diff --git a/sfc/tests/functest/config.yaml b/sfc/tests/functest/config.yaml index c198d957..512660a7 100644 --- a/sfc/tests/functest/config.yaml +++ b/sfc/tests/functest/config.yaml @@ -4,14 +4,14 @@ defaults: ram_size_in_mb: 1500 disk_size_in_gb: 10 vcpu_count: 1 - image_name: sf_nsh_colorado - image_file_name: sf_nsh_colorado.qcow2 + image_name: sfc_cloud + image_file_name: sfc_cloud.qcow2 fuel_master_ip: 10.20.0.2 fuel_master_uname: root fuel_master_passwd: r00tme fuel_environment: # Change this to the id of the desired fuel env (1, 2, 3...) image_format: qcow2 - url: "http://artifacts.opnfv.org/sfc/demo" + url: "http://artifacts.opnfv.org/sfc/random" vnfd-dir: "vnfd-templates" testcases: |