- self._nodes = self.get_node(endpoint)
- pid, ppid = self.node.wait_pid(self.run_home(self.node))
-
- # If the process is not running, check for error information
- # on the remote machine
- if not pid or not ppid:
- (out, err), proc = self.node.check_errors(self.run_home(self.node))
- # Out is what was written in the stderr file
- if err:
- self.fail()
- msg = " Failed to start command '%s' " % command
- self.error(msg, out, err)
- raise RuntimeError, msg
-
- return (pid, ppid)
-
- def switch_connect(self, endpoint, rem_endpoint):
- """ Get switch connect command
+ 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.