From 0b4a6e3c74975164b67b7b66688414cfb7b0856f Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 27 Jun 2012 20:47:20 +0200 Subject: [PATCH] try the tcp client twice --- system/TestSliver.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/system/TestSliver.py b/system/TestSliver.py index b1f40d1..cfb51a0 100644 --- a/system/TestSliver.py +++ b/system/TestSliver.py @@ -43,10 +43,16 @@ class TestSliver: 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): + def run_tcp_client (self,servername,port,retry=5): 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=False)==0 + 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 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 + return False # use the node's main ssh root entrance, as the slice entrance might be down #def tar_var_logs (self): -- 2.47.0