port)
def verify_connection(self, endpoint, remote_endpoint):
- endpoint.verify_connection()
+ connection_app_home = self.app_home(endpoint)
+ connection_run_home = self.run_home(endpoint)
+
+ endpoint.verify_connection(remote_endpoint,
+ connection_app_home,
+ connection_run_home)
def terminate_connection(self, endpoint, remote_endpoint):
- endpoint.terminate_connection()
+ connection_app_home = self.app_home(endpoint)
+ connection_run_home = self.run_home(endpoint)
+
+ endpoint.terminate_connection(remote_endpoint,
+ connection_app_home,
+ connection_run_home)
def check_state_connection(self):
# Make sure the process is still running in background
else:
self.set_stopped()
- def wait_local_port(self, endpoint):
- """ Waits until the local_port file for the endpoint is generated,
- and returns the port number
-
- """
- return self.wait_file(endpoint, "local_port")
-
- def wait_result(self, endpoint):
- """ Waits until the return code file for the endpoint is generated
-
- """
- return self.wait_file(endpoint, "ret_file")
-
- def wait_file(self, endpoint, filename):
- """ Waits until file on endpoint is generated """
- result = None
- delay = 1.0
-
- for i in xrange(20):
- (out, err), proc = endpoint.node.check_output(
- self.run_home(endpoint), filename)
-
- if out:
- result = out.strip()
- break
- else:
- time.sleep(delay)
- delay = delay * 1.5
- else:
- msg = "Couldn't retrieve %s" % filename
- self.error(msg, out, err)
- raise RuntimeError, msg
-
- return result