def test_start_add_node(self):
     hub = GridHub()
     ip = hub.get_ip()
     print "Grid Hub IP: " + hub.get_ip()
     # sudo docker run -d -e GRID_IP=${GRID_IP} brady/${1}-node
     adapter = DockerAdapter()
     response = adapter.client.create_container('brady/firefox-node', [], environment={"GRID_IP": ip})
     if response['Id']:
         adapter.client.start(response)
Exemple #2
0
 def add(browser):
     """
     @type browser: string
     @param browser: Browser Name
     @rtype: bool
     @return: True on success
     """
     hub = GridHub()
     return hub.add_node(browser)
Exemple #3
0
 def add(browser):
     """
     @type browser: string
     @param browser: Browser Name
     @rtype: bool
     @return: True on success
     """
     hub = GridHub()
     return hub.add_node(browser)
Exemple #4
0
 def test_start_add_node(self):
     hub = GridHub()
     ip = hub.get_ip()
     print "Grid Hub IP: " + hub.get_ip()
     # sudo docker run -d -e GRID_IP=${GRID_IP} brady/${1}-node
     adapter = DockerAdapter()
     response = adapter.client.create_container('brady/firefox-node', [],
                                                environment={"GRID_IP": ip})
     if response['Id']:
         adapter.client.start(response)
Exemple #5
0
 def start():
     """
     @rtype: bool
     @return: True on success
     """
     hub = GridHub()
     try:
         hub.start()
         # TODO: Verify Started
         return True
     except Exception:
         return False
Exemple #6
0
 def start():
     """
     @rtype: bool
     @return: True on success
     """
     hub = GridHub()
     try:
         hub.start()
         # TODO: Verify Started
         return True
     except Exception:
         return False
Exemple #7
0
    def get_status():
        hub = GridHub()

        ff_count = 0
        ph_count = 0
        ch_count = 0

        nodes = hub.get_nodes()
        for node in nodes:
            if "firefox" in node["Image"]:
                ff_count += 1
            elif "phantomjs" in node["Image"]:
                ph_count += 1
            elif "chrome" in node["Image"]:
                ch_count += 1

        status = {"Ip": hub.get_ip(), "firefox_count": ff_count, "phantomjs_count": ph_count, "chrome_count": ch_count}

        return status
Exemple #8
0
    def get_status():
        hub = GridHub()

        ff_count = 0
        ph_count = 0
        ch_count = 0

        nodes = hub.get_nodes()
        for node in nodes:
            if "firefox" in node['Image']:
                ff_count += 1
            elif "phantomjs" in node['Image']:
                ph_count += 1
            elif "chrome" in node['Image']:
                ch_count += 1

        status = {
            "Ip": hub.get_ip(),
            "firefox_count": ff_count,
            "phantomjs_count": ph_count,
            "chrome_count": ch_count
        }

        return status
Exemple #9
0
 def restart_nodes(browser=None):
     hub = GridHub()
     return hub.restart_nodes(browser)
Exemple #10
0
 def test_grid_shutdown(self):
     hub = GridHub()
     hub.shutdown()
Exemple #11
0
 def is_running():
     hub = GridHub()
     return hub.is_running()
Exemple #12
0
 def shutdown():
     hub = GridHub()
     hub.shutdown()
Exemple #13
0
 def stop_nodes():
     hub = GridHub()
     return hub.stop_nodes()
Exemple #14
0
 def restart_nodes(browser=None):
     hub = GridHub()
     return hub.restart_nodes(browser)
Exemple #15
0
 def stop_nodes():
     hub = GridHub()
     return hub.stop_nodes()
Exemple #16
0
 def shutdown():
     hub = GridHub()
     hub.shutdown()
 def test_grid_start(self):
     hub = GridHub()
     hub.start()
Exemple #18
0
 def test_grid_start(self):
     hub = GridHub()
     hub.start()
 def test_grid_shutdown(self):
     hub = GridHub()
     hub.shutdown()
Exemple #20
0
 def __init__(self):
     self.hub = GridHub()
Exemple #21
0
 def is_running():
     hub = GridHub()
     return hub.is_running()