+ # Collect info from endpoint
+ connection_run_home = self.run_home(local_node)
+ connection_app_home = self.app_home(local_node)
+ cipher = self.get("cipher")
+ cipher_key = self.get("cipherKey")
+ bwlimit = self.get("bwLimit")
+ txqueuelen = self.get("txQueueLen")
+
+
+ # Upload the remote port in a file
+ rem_port = str(self.get_port_info(rm_endpoint,local_endpoint))
+ rem_port_file = os.path.join(self.run_home(local_node), "remote_port")
+ local_node.upload(rem_port, rem_port_file,
+ text = True,
+ overwrite = False)
+
+ self._pid, self._ppid = local_endpoint.udp_connect(
+ rm_node, connection_run_home, connection_app_home,
+ cipher, cipher_key, bwlimit, txqueuelen)
+
+
+# connect_command = local_endpoint.udp_connect_command(
+# remote_ip, local_port_file, rem_port_file,
+# ret_file, cipher, cipher_key, bwlimit, txqueuelen)
+
+# self.connection_command(connect_command, local_node, rm_node)
+
+# # Wait for pid file to be generated
+# self._pid, self._ppid = local_node.wait_pid(self.run_home(local_node))
+
+ if not self._pid or not self._ppid:
+ (out, err), proc = local_node.check_errors(self.run_home(local_node))
+ # Out is what was written in the stderr file
+ if err:
+ msg = " Failed to start connection of the OVS Tunnel "
+ self.error(msg, out, err)
+ raise RuntimeError, msg
+ return
+
+ # Switch to Host
+ if self.check_switch_host_link and local_endpoint == self.endpoint1:
+ local_port_name = local_endpoint.get('port_name')
+ remote_port_num = self.wait_local_port(rm_node)
+ remote_ip = socket.gethostbyname(rm_node.get("hostname"))
+
+ # Switch to Switch
+ if not self.check_switch_host_link :
+ local_port_name, remote_ip, remote_port_num = self.get_port_info(local_endpoint, rm_endpoint)
+
+ connect_command = local_endpoint.switch_connect_command(
+ local_port_name, remote_ip, remote_port_num)
+
+ self.connection_command(connect_command, local_node, rm_node)
+
+ def connection_command(self, command, node_endpoint, rm_node_endpoint):
+ """ Execute the connection command on the node and check if the processus is
+ correctly running on the node.