def test_can_get_nodes(self):
        adapter = DockerAdapter()
        containers = adapter.find_all_containers('brady/firefox-node:latest')
        if len(containers) == 0:
            print "Not Found"
            return

        print "Total of Firefox Nodes: " + str(len(containers))
示例#2
0
    def test_can_get_nodes(self):
        adapter = DockerAdapter()
        containers = adapter.find_all_containers('brady/firefox-node:latest')
        if len(containers) == 0:
            print "Not Found"
            return

        print "Total of Firefox Nodes: " + str(len(containers))
    def test_can_restart_node(self):
        adapter = DockerAdapter()
        containers = adapter.find_all_containers('brady/firefox-node:latest')
        if len(containers) == 0:
            print "Not Found"
            return

        container = containers.pop(0)
        adapter.restart(container)
 def test_can_get_grid_ip(self):
     adapter = DockerAdapter()
     container = adapter.find_container('brady/selenium-grid:latest')
     if not container:
         print "Not Found"
         return
     container_info = adapter.inspect(container['Id'])
     container = dict(container.items() + container_info.items())
     print container['NetworkSettings']['IPAddress']
示例#5
0
    def test_can_restart_node(self):
        adapter = DockerAdapter()
        containers = adapter.find_all_containers('brady/firefox-node:latest')
        if len(containers) == 0:
            print "Not Found"
            return

        container = containers.pop(0)
        adapter.restart(container)
示例#6
0
 def test_can_get_grid_ip(self):
     adapter = DockerAdapter()
     container = adapter.find_container('brady/selenium-grid:latest')
     if not container:
         print "Not Found"
         return
     container_info = adapter.inspect(container['Id'])
     container = dict(container.items() + container_info.items())
     print container['NetworkSettings']['IPAddress']
 def test_can_check_if_grid_running(self):
     adapter = DockerAdapter()
     container = adapter.find_container('brady/selenium-grid:latest')
     if not container:
         print "Not Found"
     print "Found"
     #print container['Status']
     #print container['Ports']
     #print container['Id']
     if "Up" in container['Status']:
         print "Grid is Running"
     else:
         print "Grid is not Running"
示例#8
0
 def test_can_check_if_grid_running(self):
     adapter = DockerAdapter()
     container = adapter.find_container('brady/selenium-grid:latest')
     if not container:
         print "Not Found"
     print "Found"
     #print container['Status']
     #print container['Ports']
     #print container['Id']
     if "Up" in container['Status']:
         print "Grid is Running"
     else:
         print "Grid is not Running"
示例#9
0
 def test_stop_all_nodes(self):
     adapter = DockerAdapter()
     containers = adapter.client.containers()
     for container in containers:
         if "node" in container['Image']:
             print "Stopping container..."
             adapter.client.stop(container['Id'])
             print "Removing container..."
             adapter.client.remove_container(container['Id'])
示例#10
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)
示例#11
0
 def test_can_search_container(self):
     adapter = DockerAdapter()
     image = adapter.find_image('brady/selenium-grid')
     if not image:
         print "Not Found"
     print "Found"
示例#12
0
 def test_can_search_container(self):
     adapter = DockerAdapter()
     image = adapter.find_image('brady/selenium-grid')
     if not image:
         print "Not Found"
     print "Found"