aboutsummaryrefslogtreecommitdiffstats
path: root/sfc/lib
diff options
context:
space:
mode:
Diffstat (limited to 'sfc/lib')
-rw-r--r--sfc/lib/config.py2
-rw-r--r--sfc/lib/utils.py42
2 files changed, 24 insertions, 20 deletions
diff --git a/sfc/lib/config.py b/sfc/lib/config.py
index 3ef8514e..3a8247e3 100644
--- a/sfc/lib/config.py
+++ b/sfc/lib/config.py
@@ -31,6 +31,8 @@ class CommonConfig(object):
self.sfc_test_dir = os.path.join(
self.repo_path, "sfc", "tests", "functest")
self.vnfd_dir = os.path.join(self.sfc_test_dir, "vnfd-templates")
+ self.vnfd_default_params_file = os.path.join(
+ self.sfc_test_dir, "vnfd-default-params-file")
self.functest_results_dir = os.path.join(
CONST.dir_results, "odl-sfc")
self.config_file = os.path.join(self.sfc_test_dir, "config.yaml")
diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py
index 249cd6c8..dde71b2b 100644
--- a/sfc/lib/utils.py
+++ b/sfc/lib/utils.py
@@ -78,10 +78,10 @@ def download_image(url, image_path):
logger.info("Using old image")
-def create_vnf_in_av_zone(tacker_client, vnf_name, vnfd_name, av_zone=None):
- param_file = os.path.join(os.getcwd(),
- 'vnfd-templates',
- 'test-vnfd-default-params.yaml')
+def create_vnf_in_av_zone(
+ tacker_client, vnf_name, vnfd_name, default_param_file, av_zone=None):
+ param_file = default_param_file
+
if av_zone is not None or av_zone != 'nova':
param_file = os.path.join(
'/tmp',
@@ -382,22 +382,24 @@ def ofctl_time_counter(ovs_logger, ssh_conn, max_duration=None):
@ft_utils.timethis
def wait_for_classification_rules(ovs_logger, compute_clients, timeout=200):
# 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
- (rsps[0] == rsps[1])):
- rsps = ofctl_time_counter(ovs_logger, compute_clients[0])
- timeout -= 1
- if timeout == 0:
- logger.error(
- "Timeout but classification rules are not updated")
- return
- time.sleep(1)
- logger.info("classification rules updated")
+ for compute_client in compute_clients:
+ max_duration = 10
+ rsps = ofctl_time_counter(ovs_logger, compute_client, 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
+ (rsps[0] == rsps[1])):
+ rsps = ofctl_time_counter(ovs_logger, compute_client)
+ timeout -= 1
+ if timeout == 0:
+ logger.error(
+ "Timeout but classification rules are not updated")
+ return
+ time.sleep(1)
+ logger.info("classification rules updated")
def setup_compute_node(cidr, compute_nodes):