From 42ca6dedd362a81b83e4512846cb1b817162f2df Mon Sep 17 00:00:00 2001 From: George Paraskevopoulos Date: Tue, 6 Sep 2016 12:42:13 +0300 Subject: Reduce logging in the SFC test case JIRA: FUNCTEST-446 Reduce the logs that appear in the Jenkins CI console to make the output of the SFC test case more readable - Redirect tacker installation logs to results folder /home/opnfv/functest/results/odl-sfc.log - Split odl-sfc preparation into a new script - Pipe STDERR in the sfc.py script so that "Added to known hosts" messages do not show in the output Change-Id: Ibf871ade6827d4817f33623b935c5f1d904086bb Signed-off-by: George Paraskevopoulos --- testcases/features/sfc/sfc.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'testcases/features/sfc/sfc.py') diff --git a/testcases/features/sfc/sfc.py b/testcases/features/sfc/sfc.py index a228ed29..dbf64850 100755 --- a/testcases/features/sfc/sfc.py +++ b/testcases/features/sfc/sfc.py @@ -62,7 +62,8 @@ def main(): logger.info("Executing script to get ip_server: '%s'" % contr_cmd) process = subprocess.Popen(contr_cmd, shell=True, - stdout=subprocess.PIPE) + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) ip_server = process.stdout.readline().rstrip() contr_cmd2 = ("sshpass -p r00tme ssh " + ssh_options + " root@10.20.0.2" @@ -70,7 +71,8 @@ def main(): logger.info("Executing script to get ip_compute: '%s'" % contr_cmd2) process = subprocess.Popen(contr_cmd2, shell=True, - stdout=subprocess.PIPE) + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) ip_compute = process.stdout.readline().rstrip() iptable_cmd1 = ("sshpass -p r00tme ssh " + ssh_options + " root@10.20.0.2" @@ -78,8 +80,11 @@ def main(): iptable_cmd2 = ("sshpass -p r00tme ssh " + ssh_options + " root@10.20.0.2" " ssh " + ip_server + " iptables -t nat -P INPUT ACCEPT ") - subprocess.call(iptable_cmd1, shell=True) - subprocess.call(iptable_cmd2, shell=True) + logger.info("Changing firewall policy in controller: '%s'" % iptable_cmd1) + subprocess.call(iptable_cmd1, shell=True, stderr=subprocess.PIPE) + + logger.info("Changing firewall policy in controller: '%s'" % iptable_cmd2) + subprocess.call(iptable_cmd2, shell=True, stderr=subprocess.PIPE) # Getting the different clients -- cgit 1.2.3-korg