diff options
author | 2016-07-25 11:20:05 +0200 | |
---|---|---|
committer | 2016-07-25 11:22:03 +0200 | |
commit | a6e8b23db1d3106d790a506c8e8277b1e638ddbd (patch) | |
tree | 8fa49bd6fd9074ab92f78bf7f5c1c08094638026 /testcases/features/sfc/sfc.py | |
parent | 0f6c6171d514f6f7c3cb376bd40f20468a37bc41 (diff) |
Bug fix for SFC test case
The path is fixed in the sfc_tacker script, some minor bug fixes in sfc.py are
made and the "FAILED" messages are not handled by log.error instead of debug
Change-Id: I2facbd985c1c0c0cac3865504b1bf65940b7ce50
Signed-off-by: Manuel Buil <manuel.buil@ericsson.com>
Diffstat (limited to 'testcases/features/sfc/sfc.py')
-rwxr-xr-x | testcases/features/sfc/sfc.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/testcases/features/sfc/sfc.py b/testcases/features/sfc/sfc.py index 99aac66b..562d410b 100755 --- a/testcases/features/sfc/sfc.py +++ b/testcases/features/sfc/sfc.py @@ -18,7 +18,7 @@ parser.add_argument("-r", "--report", args = parser.parse_args() """ logging configuration """ -logger = ft_logger.Logger("create_instance_and_ip").getLogger() +logger = ft_logger.Logger("ODL_SFC").getLogger() REPO_PATH = os.environ['repos_dir'] + '/functest/' HOME = os.environ['HOME'] + "/" @@ -81,7 +81,7 @@ def main(): iptable_command1 = ("sshpass -p r00tme ssh root@10.20.0.2 ssh" " " + ip + " iptables -P INPUT ACCEPT ") iptable_command2 = ("sshpass -p r00tme ssh root@10.20.0.2 ssh" - " " + ip + "iptables -t nat -P INPUT ACCEPT ") + " " + ip + " iptables -t nat -P INPUT ACCEPT ") subprocess.call(iptable_command1, shell=True) subprocess.call(iptable_command2, shell=True) @@ -269,13 +269,12 @@ def main(): # WRITE THE CORRECT WAY TO DO LOGGING i = 0 - logger.info("First output: %s" % stdout.readlines()) if "timed out" in stdout.readlines()[0]: logger.info('\033[92m' + "TEST 1 [PASSED] " "==> SSH BLOCKED" + '\033[0m') i = i + 1 else: - logger.debug('\033[91m' + "TEST 1 [FAILED] " + logger.error('\033[91m' + "TEST 1 [FAILED] " "==> SSH NOT BLOCKED" + '\033[0m') return @@ -296,7 +295,7 @@ def main(): "==> HTTP WORKS" + '\033[0m') i = i + 1 else: - logger.debug('\033[91m' + "TEST 2 [FAILED] " + logger.error('\033[91m' + "TEST 2 [FAILED] " "==> HTTP BLOCKED" + '\033[0m') return @@ -323,7 +322,7 @@ def main(): "==> HTTP BLOCKED" + '\033[0m') i = i + 1 else: - logger.debug('\033[91m' + "TEST 3 [FAILED] " + logger.error('\033[91m' + "TEST 3 [FAILED] " "==> HTTP NOT BLOCKED" + '\033[0m') return @@ -344,7 +343,7 @@ def main(): "==> SSH WORKS" + '\033[0m') i = i + 1 else: - logger.debug('\033[91m' + "TEST 4 [FAILED] " + logger.error('\033[91m' + "TEST 4 [FAILED] " "==> SSH BLOCKED" + '\033[0m') return |