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