- def run_tcp_client (self,servername,port,retry=5):
- client_command="./tcptest.py client -a %s -p %d"%(servername,port)
- if self.test_ssh.copy("tcptest.py")!=0: return False
- utils.header ("tcp client - first attempt")
- if self.test_ssh.run(client_command,background=False)==0: return True
- # if first try has failed, wait for <retry> s an try again
- time.sleep(retry)
- utils.header ("tcp client - second attempt")
- if self.test_ssh.run(client_command,background=False)==0: return True
+ def run_tcp_client(self, servername, port, retry=5):
+ client_command = "./tcptest.py client -a {} -p {}"\
+ .format(servername, port)
+ if self.test_ssh.copy("tcptest.py") != 0:
+ return False
+ if self.test_ssh.run(client_command) == 0:
+ return True