aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sfc/lib/odl_utils.py7
-rw-r--r--sfc/lib/openstack_utils.py11
-rw-r--r--sfc/tests/functest/sfc_one_chain_two_service_functions.py3
-rw-r--r--sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py6
4 files changed, 17 insertions, 10 deletions
diff --git a/sfc/lib/odl_utils.py b/sfc/lib/odl_utils.py
index 45937263..90b6b54f 100644
--- a/sfc/lib/odl_utils.py
+++ b/sfc/lib/odl_utils.py
@@ -102,17 +102,14 @@ def promised_rsps_in_computes(odl_ip, odl_port):
@ft_utils.timethis
def wait_for_classification_rules(ovs_logger, compute_nodes, odl_ip, odl_port,
- timeout=200):
+ compute_client_name, timeout=200):
'''
Check if the classification rules configured in ODL are implemented in OVS.
We know by experience that this process might take a while
'''
try:
- # Find the compute where the client is
- compute_client = os_sfc_utils.get_compute_client()
-
for compute_node in compute_nodes:
- if compute_node.name in compute_client:
+ if compute_node.name in compute_client_name:
compute = compute_node
try:
compute
diff --git a/sfc/lib/openstack_utils.py b/sfc/lib/openstack_utils.py
index 28cfebe7..7257b126 100644
--- a/sfc/lib/openstack_utils.py
+++ b/sfc/lib/openstack_utils.py
@@ -156,8 +156,15 @@ class OpenStackSFC:
'''
Return the compute where the client sits
'''
- compute = nova_utils.get_server(self.nova, server_name='client')
- return compute
+ for creator in self.creators:
+ # We want to filter the vm creators
+ if hasattr(creator, 'get_vm_info'):
+ vm_info = creator.get_vm_info()
+ # We want to fetch only the client
+ if vm_info['name'] == 'client':
+ return vm_info['OS-EXT-SRV-ATTR:host']
+
+ raise Exception("There is no client VM!!")
def assign_floating_ip(self, router, vm, vm_creator):
'''
diff --git a/sfc/tests/functest/sfc_one_chain_two_service_functions.py b/sfc/tests/functest/sfc_one_chain_two_service_functions.py
index 043b5a6a..411262d1 100644
--- a/sfc/tests/functest/sfc_one_chain_two_service_functions.py
+++ b/sfc/tests/functest/sfc_one_chain_two_service_functions.py
@@ -185,7 +185,8 @@ def main():
# Start measuring the time it takes to implement the classification rules
t1 = threading.Thread(target=odl_utils.wait_for_classification_rules,
- args=(ovs_logger, compute_nodes, odl_ip, odl_port,))
+ args=(ovs_logger, compute_nodes, odl_ip,
+ odl_port, openstack_sfc.get_compute_client(),))
try:
t1.start()
except Exception as e:
diff --git a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
index d7eb2994..9d4c68c8 100644
--- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
+++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
@@ -183,7 +183,8 @@ def main():
# Start measuring the time it takes to implement the classification rules
t1 = threading.Thread(target=odl_utils.wait_for_classification_rules,
- args=(ovs_logger, compute_nodes, odl_ip, odl_port,))
+ args=(ovs_logger, compute_nodes, odl_ip,
+ odl_port, openstack_sfc.get_compute_client(),))
try:
t1.start()
@@ -272,7 +273,8 @@ def main():
# Start measuring the time it takes to implement the classification rules
t2 = threading.Thread(target=odl_utils.wait_for_classification_rules,
- args=(ovs_logger, compute_nodes, odl_ip, odl_port,))
+ args=(ovs_logger, compute_nodes, odl_ip,
+ odl_port, openstack_sfc.get_compute_client(),))
try:
t2.start()
except Exception as e: