From ca7b72ad1a50c353b7ffc4e2934e654f73603c62 Mon Sep 17 00:00:00 2001 From: Juan Vidal Date: Wed, 15 Feb 2017 09:55:11 +0000 Subject: Fix is_ssh_blocked and is_http_blocked This patch fixes JIRA SFC-79 Previously, those functions used regex matching against the command output. Now, the return code from netcat is used. It should be easier and more relieable. Change-Id: I639c64b3fe0a0e3c0b59f73e5615b8737e676849 Signed-off-by: Juan Vidal --- sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py') 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 92ef9f16..4117b237 100644 --- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py +++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py @@ -190,7 +190,7 @@ def main(): t1.join() logger.info("Test SSH") - if test_utils.is_ssh_blocked(srv_prv_ip, client_ip): + if test_utils.is_ssh_blocked(client_ip, srv_prv_ip): results.add_to_summary(2, "PASS", "SSH Blocked") else: error = ('\033[91mTEST 1 [FAILED] ==> SSH NOT BLOCKED\033[0m') @@ -200,7 +200,7 @@ def main(): results.add_to_summary(2, "FAIL", "SSH Blocked") logger.info("Test HTTP") - if not test_utils.is_http_blocked(srv_prv_ip, client_ip): + if not test_utils.is_http_blocked(client_ip, srv_prv_ip): results.add_to_summary(2, "PASS", "HTTP works") else: error = ('\033[91mTEST 2 [FAILED] ==> HTTP BLOCKED\033[0m') @@ -243,7 +243,7 @@ def main(): t2.join() logger.info("Test HTTP") - if test_utils.is_http_blocked(srv_prv_ip, client_ip): + if test_utils.is_http_blocked(client_ip, srv_prv_ip): results.add_to_summary(2, "PASS", "HTTP Blocked") else: error = ('\033[91mTEST 3 [FAILED] ==> HTTP WORKS\033[0m') @@ -253,7 +253,7 @@ def main(): results.add_to_summary(2, "FAIL", "HTTP Blocked") logger.info("Test SSH") - if not test_utils.is_ssh_blocked(srv_prv_ip, client_ip): + if not test_utils.is_ssh_blocked(client_ip, srv_prv_ip): results.add_to_summary(2, "PASS", "SSH works") else: error = ('\033[91mTEST 4 [FAILED] ==> SSH BLOCKED\033[0m') -- cgit 1.2.3-korg