X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestSliver.py;h=e4f49f71a82a462227c0ac739b021c829587f813;hb=453cf4bdd0de8e45c807ab11139e3e044bb4a899;hp=f69e4c50d5b52c6e8fa588c486b95cdd838a7362;hpb=8ca4e5c23d27475fb2ea62f693ff3dc80ff410d1;p=tests.git diff --git a/system/TestSliver.py b/system/TestSliver.py index f69e4c5..e4f49f7 100644 --- a/system/TestSliver.py +++ b/system/TestSliver.py @@ -38,28 +38,22 @@ class TestSliver: utils.header("Checking for initscript stamp %s on sliver %s"%(stamp, self.name())) return self.test_ssh.run("ls -l /var/tmp/%s.stamp"%stamp)==0 + def check_tcp_ready (self, port): + ready_command = "./tcptest.py ready -p %d"%(port) + return self.test_ssh.copy("tcptest.py") == 0 and \ + self.test_ssh.run(ready_command) == 0 + def run_tcp_server (self, port, timeout=10): server_command = "./tcptest.py server -p %d -t %d"%(port, timeout) return self.test_ssh.copy("tcptest.py") == 0 and \ self.test_ssh.run(server_command, background=True)==0 - def check_tcp_ready (self, port): - server_command = "./tcptest.py ready -p %d"%(port) - return self.test_ssh.copy("tcptest.py") == 0 and \ - self.test_ssh.run(server_command) == 0 - 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 - # allow for 2 attempts - attempts = 2 - for attempt in range (attempts): - if attempt != 0: - time.sleep(retry) - utils.header ("tcp client - attempt # %s" % (attempt+1)) - if self.test_ssh.run(client_command) == 0: - return True + if self.test_ssh.run(client_command) == 0: + return True return False # use the node's main ssh root entrance, as the slice entrance might be down