diff options
Diffstat (limited to 'testcases/features/sfc/sfc.py')
-rwxr-xr-x | testcases/features/sfc/sfc.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/testcases/features/sfc/sfc.py b/testcases/features/sfc/sfc.py index a228ed298..c84810efa 100755 --- a/testcases/features/sfc/sfc.py +++ b/testcases/features/sfc/sfc.py @@ -4,11 +4,11 @@ import sys import time import argparse +import paramiko + import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils import functest.utils.openstack_utils as os_utils -import paramiko -from functest.utils.functest_utils import FUNCTEST_REPO as FUNCTEST_REPO parser = argparse.ArgumentParser() @@ -21,6 +21,8 @@ args = parser.parse_args() """ logging configuration """ logger = ft_logger.Logger("ODL_SFC").getLogger() +FUNCTEST_REPO = ft_utils.FUNCTEST_REPO + HOME = os.environ['HOME'] + "/" VM_BOOT_TIMEOUT = 180 @@ -62,7 +64,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 +73,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 +82,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 |