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