aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2018-11-12 11:01:11 +0100
committerManuel Buil <mbuil@suse.com>2018-11-14 08:56:49 +0000
commit61599026dc4f0a940d0e3aa7d724494222ee1415 (patch)
treeb6f060bd3876048c20408d94b6d5485d3830d70a
parent62dc54490404f7615ea8fb0b6c1ed5e9d0160a8d (diff)
Fix bug in the symmetric test case
The symmetric testcase requires the neutron port of the server to check that the classification rules were written in the flow tables. This patch adds that. Change-Id: I7ce930b102409f2772771a9c5b0e6de99bb293a0 Signed-off-by: Manuel Buil <mbuil@suse.com>
-rw-r--r--sfc/tests/functest/sfc_chain_deletion.py4
-rw-r--r--sfc/tests/functest/sfc_one_chain_two_service_functions.py2
-rw-r--r--sfc/tests/functest/sfc_parent_function.py26
-rw-r--r--sfc/tests/functest/sfc_symmetric_chain.py16
-rw-r--r--sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py4
5 files changed, 28 insertions, 24 deletions
diff --git a/sfc/tests/functest/sfc_chain_deletion.py b/sfc/tests/functest/sfc_chain_deletion.py
index 3944cf90..aa6a1933 100644
--- a/sfc/tests/functest/sfc_chain_deletion.py
+++ b/sfc/tests/functest/sfc_chain_deletion.py
@@ -43,7 +43,7 @@ class SfcChainDeletion(sfc_parent_function.SfcCommonTestCase):
args=(self.ovs_logger, self.compute_nodes,
self.odl_ip, self.odl_port,
self.client_instance.compute_host,
- [self.neutron_port],))
+ [self.neutron_client_port],))
try:
t1.start()
@@ -72,7 +72,7 @@ class SfcChainDeletion(sfc_parent_function.SfcCommonTestCase):
args=(self.ovs_logger, self.compute_nodes,
self.odl_ip, self.odl_port,
self.client_instance.compute_host,
- [self.neutron_port],))
+ [self.neutron_client_port],))
try:
t2.start()
except Exception as e:
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 38d6176f..ccae6807 100644
--- a/sfc/tests/functest/sfc_one_chain_two_service_functions.py
+++ b/sfc/tests/functest/sfc_one_chain_two_service_functions.py
@@ -46,7 +46,7 @@ class SfcOneChainTwoServiceTC(sfc_parent_function.SfcCommonTestCase):
args=(self.ovs_logger, self.compute_nodes,
self.odl_ip, self.odl_port,
self.client_instance.compute_host,
- [self.neutron_port],))
+ [self.neutron_client_port],))
try:
t1.start()
except Exception as e:
diff --git a/sfc/tests/functest/sfc_parent_function.py b/sfc/tests/functest/sfc_parent_function.py
index 10c76968..06ea4982 100644
--- a/sfc/tests/functest/sfc_parent_function.py
+++ b/sfc/tests/functest/sfc_parent_function.py
@@ -52,7 +52,8 @@ class SfcCommonTestCase(object):
self.client_floating_ip = None
self.server_floating_ip = None
self.fips_sfs = []
- self.neutron_port = None
+ self.neutron_client_port = None
+ self.neutron_server_port = None
self.vnf_objects = dict()
self.testcase_config = testcase_config
self.vnfs = vnfs
@@ -428,12 +429,12 @@ class SfcCommonTestCase(object):
tosca_file=tosca_file,
vnffgd_name=vnffgd_name)
- self.neutron_port = \
+ self.neutron_client_port = \
openstack_sfc.get_instance_port(self.client_instance,
self.client_creator)
if symmetric:
- server_port = openstack_sfc.get_instance_port(
+ self.neutron_server_port = openstack_sfc.get_instance_port(
self.server_instance,
self.server_creator)
server_ip_prefix = self.server_ip + '/32'
@@ -443,8 +444,8 @@ class SfcCommonTestCase(object):
vnffgd_name,
vnffg_name,
self.default_param_file,
- self.neutron_port.id,
- server_port=server_port.id,
+ self.neutron_client_port.id,
+ server_port=self.neutron_server_port.id,
server_ip=server_ip_prefix)
else:
@@ -453,7 +454,7 @@ class SfcCommonTestCase(object):
vnffgd_name,
vnffg_name,
self.default_param_file,
- self.neutron_port.id)
+ self.neutron_client_port.id)
elif COMMON_CONFIG.mano_component == 'no-mano':
if not only_chain:
@@ -486,27 +487,28 @@ class SfcCommonTestCase(object):
vnf_instance)
self.port_groups.append(port_group)
- self.neutron_port = \
+ self.neutron_client_port = \
openstack_sfc.get_instance_port(self.client_instance,
self.client_creator)
if symmetric:
# We must pass the server_port and server_ip in the symmetric
# case. Otherwise ODL does not work well
- server_port = openstack_sfc.get_instance_port(
+ self.neutron_server_port = openstack_sfc.get_instance_port(
self.server_instance,
self.server_creator)
server_ip_prefix = self.server_ip + '/32'
+ server_port_id = self.neutron_server_port.id
openstack_sfc.create_chain(self.port_groups,
- self.neutron_port.id,
+ self.neutron_client_port.id,
port, protocol, vnffg_name,
symmetric,
- server_port=server_port.id,
+ server_port=server_port_id,
server_ip=server_ip_prefix)
else:
openstack_sfc.create_chain(self.port_groups,
- self.neutron_port.id,
+ self.neutron_client_port.id,
port, protocol, vnffg_name,
symmetric)
@@ -588,7 +590,7 @@ class SfcCommonTestCase(object):
if not odl_utils.\
check_vnffg_deletion(self.odl_ip, self.odl_port,
self.ovs_logger,
- [self.neutron_port],
+ [self.neutron_client_port],
self.client_instance.compute_host,
self.compute_nodes):
logger.debug("The chains were not correctly removed")
diff --git a/sfc/tests/functest/sfc_symmetric_chain.py b/sfc/tests/functest/sfc_symmetric_chain.py
index 4593d8c6..7df938e3 100644
--- a/sfc/tests/functest/sfc_symmetric_chain.py
+++ b/sfc/tests/functest/sfc_symmetric_chain.py
@@ -48,11 +48,13 @@ class SfcSymmetricChain(sfc_parent_function.SfcCommonTestCase):
# Start measuring the time it takes to implement the classification
# rules
- t1 = threading.Thread(target=wait_for_classification_rules,
+ t1 = threading.Thread(target=symmetric_wait_for_classification_rules,
args=(self.ovs_logger, self.compute_nodes,
- self.odl_ip, self.odl_port,
+ self.server_instance.compute_host,
+ self.neutron_server_port,
self.client_instance.compute_host,
- [self.neutron_port],))
+ self.neutron_client_port,
+ self.odl_ip, self.odl_port,))
try:
t1.start()
except Exception as e:
@@ -110,10 +112,10 @@ class SfcSymmetricChain(sfc_parent_function.SfcCommonTestCase):
return self.creators
-def wait_for_classification_rules(ovs_logger, compute_nodes,
- server_compute, server_port,
- client_compute, client_port,
- odl_ip, odl_port):
+def symmetric_wait_for_classification_rules(ovs_logger, compute_nodes,
+ server_compute, server_port,
+ client_compute, client_port,
+ odl_ip, odl_port):
if client_compute == server_compute:
odl_utils.wait_for_classification_rules(
ovs_logger,
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 e30967b9..e2037a41 100644
--- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
+++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
@@ -47,7 +47,7 @@ class SfcTwoChainsSSHandHTTP(sfc_parent_function.SfcCommonTestCase):
args=(self.ovs_logger, self.compute_nodes,
self.odl_ip, self.odl_port,
self.client_instance.compute_host,
- [self.neutron_port],))
+ [self.neutron_client_port],))
try:
t1.start()
@@ -83,7 +83,7 @@ class SfcTwoChainsSSHandHTTP(sfc_parent_function.SfcCommonTestCase):
args=(self.ovs_logger, self.compute_nodes,
self.odl_ip, self.odl_port,
self.client_instance.compute_host,
- self.neutron_port,))
+ self.neutron_client_port,))
try:
t2.start()
except Exception as e: