- def run_tcp_client (self,servername,port):
- client_command="./tcptest.py client -a %s -p %d"%(servername,port)
- return self.test_ssh.copy("tcptest.py")==0 and \
- self.test_ssh.run(client_command,background=True)==0
+ def run_tcp_server(self, servername, port, timeout=10):
+ server_command = "./tcptest.py server -a {} -p {} -t {}"\
+ .format(servername, port, timeout)
+ return self.test_ssh.copy("tcptest.py") == 0 and \
+ self.test_ssh.run(server_command, background=True) == 0
+
+ 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
+ return False