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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 5
0
 def start():
     """
     @rtype: bool
     @return: True on success
     """
     hub = GridHub()
     try:
         hub.start()
         # TODO: Verify Started
         return True
     except Exception:
         return False
Esempio n. 6
0
 def start():
     """
     @rtype: bool
     @return: True on success
     """
     hub = GridHub()
     try:
         hub.start()
         # TODO: Verify Started
         return True
     except Exception:
         return False
Esempio n. 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
Esempio n. 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
Esempio n. 9
0
 def restart_nodes(browser=None):
     hub = GridHub()
     return hub.restart_nodes(browser)
Esempio n. 10
0
 def test_grid_shutdown(self):
     hub = GridHub()
     hub.shutdown()
Esempio n. 11
0
 def is_running():
     hub = GridHub()
     return hub.is_running()
Esempio n. 12
0
 def shutdown():
     hub = GridHub()
     hub.shutdown()
Esempio n. 13
0
 def stop_nodes():
     hub = GridHub()
     return hub.stop_nodes()
Esempio n. 14
0
 def restart_nodes(browser=None):
     hub = GridHub()
     return hub.restart_nodes(browser)
Esempio n. 15
0
 def stop_nodes():
     hub = GridHub()
     return hub.stop_nodes()
Esempio n. 16
0
 def shutdown():
     hub = GridHub()
     hub.shutdown()
Esempio n. 17
0
 def test_grid_start(self):
     hub = GridHub()
     hub.start()
Esempio n. 18
0
 def test_grid_start(self):
     hub = GridHub()
     hub.start()
Esempio n. 19
0
 def test_grid_shutdown(self):
     hub = GridHub()
     hub.shutdown()
Esempio n. 20
0
 def __init__(self):
     self.hub = GridHub()
Esempio n. 21
0
 def is_running():
     hub = GridHub()
     return hub.is_running()