Ejemplo n.º 1
0
    def _do_startup(self, cloud):
        """Start up the service. The first node will be an agent running a
        Selenium Hub and a Selenium Node."""

        startCloud = self._init_cloud(cloud)
        vals = {'action': '_do_startup', 'count': 1}
        self.logger.debug(self.ACTION_REQUESTING_NODES % vals)

        try:
            nodes = self.controller.create_nodes(1, client.check_agent_process,
                                                 self.AGENT_PORT, startCloud)

            hub_node = nodes[0]

            # The first agent is a Selenium Hub and a Selenium Node
            client.create_hub(hub_node.ip, self.AGENT_PORT)
            client.create_node(hub_node.ip, self.AGENT_PORT, hub_node.ip)

            self.hub_ip = hub_node.ip

            # Extend the nodes list with the newly created one
            self.nodes += nodes
            self.state = self.S_RUNNING
        except Exception, err:
            self.logger.exception('_do_startup: Failed to create hub: %s' %
                                  err)
            self.state = self.S_ERROR
Ejemplo n.º 2
0
    def _do_startup(self, cloud):
        """Start up the service. The first node will be an agent running a
        Selenium Hub and a Selenium Node."""

        startCloud = self._init_cloud(cloud)
        vals = { 'action': '_do_startup', 'count': 1 }
        self.logger.debug(self.ACTION_REQUESTING_NODES % vals)

        try:
            nodes = self.controller.create_nodes(1,
                client.check_agent_process, self.AGENT_PORT, startCloud)

            hub_node = nodes[0]

            # The first agent is a Selenium Hub and a Selenium Node
            client.create_hub(hub_node.ip, self.AGENT_PORT)
            client.create_node(hub_node.ip, self.AGENT_PORT, hub_node.ip)

            self.hub_ip = hub_node.ip

            # Extend the nodes list with the newly created one
            self.nodes += nodes
            self.state = self.S_RUNNING
        except Exception, err:
            self.logger.exception('_do_startup: Failed to create hub: %s' % err)
            self.state = self.S_ERROR
Ejemplo n.º 3
0
    def _do_add_nodes(self, count, cloud):
        startCloud = self._init_cloud(cloud)
        """Add 'count' Selenium Nodes to this deployment"""
        node_instances = self.controller.create_nodes(
            count, client.check_agent_process, self.AGENT_PORT, startCloud)

        # Startup agents
        for node in node_instances:
            client.create_node(node.ip, self.AGENT_PORT, self.hub_ip)

        self.nodes += node_instances
        self.state = self.S_RUNNING
Ejemplo n.º 4
0
    def _do_add_nodes(self, count, cloud):
        startCloud = self._init_cloud(cloud)
        """Add 'count' Selenium Nodes to this deployment"""
        node_instances = self.controller.create_nodes(count, 
            client.check_agent_process, self.AGENT_PORT, startCloud)

        # Startup agents
        for node in node_instances:
            client.create_node(node.ip, self.AGENT_PORT, self.hub_ip)

        self.nodes += node_instances
        self.state = self.S_RUNNING