From fdd96be78394a3ce05d9db5f4f68b60b02e48b1a Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Mon, 10 Apr 2017 17:23:32 +0200 Subject: Complete sfc_one test JIRA: SFC-94 We were only blocking one SF to test if the traffic was blocked but we should test both to be more rigorous Change-Id: If22a79350c97e0d59ea0a9451303efce21e3f285 Signed-off-by: Manuel Buil --- .../functest/sfc_one_chain_two_service_functions.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'sfc') 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 bd457bee..801a57b2 100644 --- a/sfc/tests/functest/sfc_one_chain_two_service_functions.py +++ b/sfc/tests/functest/sfc_one_chain_two_service_functions.py @@ -238,12 +238,12 @@ def main(): logger.info("Changing the vxlan_tool to block HTTP traffic") - # Make SF1 block now http traffic + # Make SF1 block http traffic test_utils.stop_vxlan_tool(sf1_floating_ip) logger.info("Starting HTTP firewall on %s" % sf1_floating_ip) test_utils.start_vxlan_tool(sf1_floating_ip, block="80") - logger.info("Test HTTP again") + logger.info("Test HTTP again blocking SF1") if test_utils.is_http_blocked(client_floating_ip, server_ip): results.add_to_summary(2, "PASS", "HTTP Blocked") else: @@ -253,6 +253,23 @@ def main(): ovs_logger, controller_clients, compute_clients, error) results.add_to_summary(2, "FAIL", "HTTP not blocked") + # Make SF2 block http traffic + test_utils.stop_vxlan_tool(sf2_floating_ip) + logger.info("Starting HTTP firewall on %s" % sf2_floating_ip) + test_utils.start_vxlan_tool(sf2_floating_ip, block="80") + logger.info("Stopping HTTP firewall on %s" % sf1_floating_ip) + test_utils.stop_vxlan_tool(sf1_floating_ip) + + logger.info("Test HTTP again blocking SF2") + if test_utils.is_http_blocked(client_floating_ip, server_ip): + results.add_to_summary(2, "PASS", "HTTP Blocked") + else: + error = ('\033[91mTEST 3 [FAILED] ==> HTTP WORKS\033[0m') + logger.error(error) + test_utils.capture_ovs_logs( + ovs_logger, controller_clients, compute_clients, error) + results.add_to_summary(2, "FAIL", "HTTP not blocked") + return results.compile_summary() -- cgit 1.2.3-korg