From df29f2f2424c567582dfa5f6709aad8d58790182 Mon Sep 17 00:00:00 2001 From: Jaime Caamaño Ruiz Date: Tue, 22 May 2018 16:11:57 +0200 Subject: Fix symmetric test case result summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correctly print in test summary whether we are testing HTTP uplink or HTTP uplink. Change-Id: Ib8d4cc4a5e794384720d7023032c5340039e2ff1 Signed-off-by: Jaime Caamaño Ruiz --- sfc/tests/functest/sfc_parent_function.py | 10 ++++++---- sfc/tests/functest/sfc_symmetric_chain.py | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'sfc/tests/functest') diff --git a/sfc/tests/functest/sfc_parent_function.py b/sfc/tests/functest/sfc_parent_function.py index 24ddd2e8..6161ae67 100644 --- a/sfc/tests/functest/sfc_parent_function.py +++ b/sfc/tests/functest/sfc_parent_function.py @@ -408,11 +408,13 @@ class SfcCommonTestCase(object): return results - def present_results_blocked_port_http(self, testcase_config): + def present_results_blocked_port_http(self, testcase_config, + test='HTTP'): """Check whether the connection between server and client using HTTP protocol and for a specific port is blocked or not. :param testcase_config: The config input of the test case + :param test: custom test string to print on result summary :return: The results for the specific action of the scenario """ @@ -420,14 +422,14 @@ class SfcCommonTestCase(object): logger.info("Test if HTTP from port %s doesn't work" % allowed_port) if test_utils.is_http_blocked( self.client_floating_ip, self.server_ip, allowed_port): - results.add_to_summary(2, "PASS", "HTTP uplink blocked") + results.add_to_summary(2, "PASS", test + " blocked") else: - error = ('\033[91mTEST [FAILED] ==> HTTP BLOCKED\033[0m') + error = ('\033[91mTEST [FAILED] ==> HTTP WORKS\033[0m') logger.error(error) test_utils.capture_ovs_logs( self.ovs_logger, self.controller_clients, self.compute_clients, error) - results.add_to_summary(2, "FAIL", "HTTP works") + results.add_to_summary(2, "FAIL", test + " works") return results diff --git a/sfc/tests/functest/sfc_symmetric_chain.py b/sfc/tests/functest/sfc_symmetric_chain.py index 309d0dbc..7c453b59 100644 --- a/sfc/tests/functest/sfc_symmetric_chain.py +++ b/sfc/tests/functest/sfc_symmetric_chain.py @@ -116,14 +116,16 @@ class SfcSymmetricChain(sfc_parent_function.SfcCommonTestCase): self.vxlan_start_interface(self.fips_sfs[0], 'eth0', 'eth1', "80") self.vxlan_start_interface(self.fips_sfs[0], 'eth1', 'eth0', None) - results = self.present_results_blocked_port_http(self.testcase_config) + results = self.present_results_blocked_port_http(self.testcase_config, + 'HTTP uplink') self.vxlan_blocking_stop(self.fips_sfs[0]) self.vxlan_start_interface(self.fips_sfs[0], 'eth0', 'eth1', None) self.vxlan_start_interface(self.fips_sfs[0], 'eth1', 'eth0', self.testcase_config.source_port) - results = self.present_results_blocked_port_http(self.testcase_config) + results = self.present_results_blocked_port_http(self.testcase_config, + 'HTTP downlink') self.vxlan_blocking_stop(self.fips_sfs[0]) self.vxlan_start_interface(self.fips_sfs[0], 'eth0', 'eth1', None) -- cgit 1.2.3-korg