mirror of https://github.com/docker/docker-py.git
				
				
				
			Merge pull request #2515 from thaJeztah/use_official_dind_images
Use official docker:dind image instead of custom image
This commit is contained in:
		
						commit
						12fe645aba
					
				|  | @ -84,7 +84,7 @@ def runTests = { Map settings -> | |||
|         try { | ||||
|           sh """docker network create ${testNetwork}""" | ||||
|           sh """docker run -d --name  ${dindContainerName} -v /tmp --privileged --network ${testNetwork} \\ | ||||
|             dockerswarm/dind:${dockerVersion} dockerd -H tcp://0.0.0.0:2375 | ||||
|             docker:${dockerVersion}-dind dockerd -H tcp://0.0.0.0:2375 | ||||
|           """ | ||||
|           sh """docker run \\ | ||||
|             --name ${testContainerName} \\ | ||||
|  |  | |||
							
								
								
									
										6
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										6
									
								
								Makefile
								
								
								
								
							|  | @ -55,7 +55,7 @@ integration-dind: integration-dind-py2 integration-dind-py3 | |||
| integration-dind-py2: build setup-network | ||||
| 	docker rm -vf dpy-dind-py2 || : | ||||
| 	docker run -d --network dpy-tests --name dpy-dind-py2 --privileged\
 | ||||
| 		dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd -H tcp://0.0.0.0:2375 --experimental | ||||
| 		docker:${TEST_ENGINE_VERSION}-dind dockerd -H tcp://0.0.0.0:2375 --experimental | ||||
| 	docker run -t --rm --env="DOCKER_HOST=tcp://dpy-dind-py2:2375" --env="DOCKER_TEST_API_VERSION=${TEST_API_VERSION}"\
 | ||||
| 		--network dpy-tests docker-sdk-python py.test tests/integration | ||||
| 	docker rm -vf dpy-dind-py2 | ||||
|  | @ -64,7 +64,7 @@ integration-dind-py2: build setup-network | |||
| integration-dind-py3: build-py3 setup-network | ||||
| 	docker rm -vf dpy-dind-py3 || : | ||||
| 	docker run -d --network dpy-tests --name dpy-dind-py3 --privileged\
 | ||||
| 		dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd -H tcp://0.0.0.0:2375 --experimental | ||||
| 		docker:${TEST_ENGINE_VERSION}-dind dockerd -H tcp://0.0.0.0:2375 --experimental | ||||
| 	docker run -t --rm --env="DOCKER_HOST=tcp://dpy-dind-py3:2375" --env="DOCKER_TEST_API_VERSION=${TEST_API_VERSION}"\
 | ||||
| 		--network dpy-tests docker-sdk-python3 py.test tests/integration | ||||
| 	docker rm -vf dpy-dind-py3 | ||||
|  | @ -76,7 +76,7 @@ integration-dind-ssl: build-dind-certs build build-py3 | |||
| 	docker run -d --env="DOCKER_HOST=tcp://localhost:2375" --env="DOCKER_TLS_VERIFY=1"\
 | ||||
| 		--env="DOCKER_CERT_PATH=/certs" --volumes-from dpy-dind-certs --name dpy-dind-ssl\
 | ||||
| 		--network dpy-tests --network-alias docker -v /tmp --privileged\
 | ||||
| 		dockerswarm/dind:${TEST_ENGINE_VERSION}\
 | ||||
| 		docker:${TEST_ENGINE_VERSION}-dind\
 | ||||
| 		dockerd --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/server-cert.pem\
 | ||||
| 		--tlskey=/certs/server-key.pem -H tcp://0.0.0.0:2375 --experimental | ||||
| 	docker run -t --rm --volumes-from dpy-dind-ssl --env="DOCKER_HOST=tcp://docker:2375"\
 | ||||
|  |  | |||
|  | @ -1102,6 +1102,8 @@ class PortTest(BaseAPIIntegrationTest): | |||
| 
 | ||||
| 
 | ||||
| class ContainerTopTest(BaseAPIIntegrationTest): | ||||
|     @pytest.mark.xfail(reason='Output of docker top depends on host distro, ' | ||||
|                               'and is not formalized.') | ||||
|     def test_top(self): | ||||
|         container = self.client.create_container( | ||||
|             TEST_IMG, ['sleep', '60'] | ||||
|  | @ -1112,9 +1114,7 @@ class ContainerTopTest(BaseAPIIntegrationTest): | |||
|         self.client.start(container) | ||||
|         res = self.client.top(container) | ||||
|         if not IS_WINDOWS_PLATFORM: | ||||
|             assert res['Titles'] == [ | ||||
|                 'UID', 'PID', 'PPID', 'C', 'STIME', 'TTY', 'TIME', 'CMD' | ||||
|             ] | ||||
|             assert res['Titles'] == [u'PID', u'USER', u'TIME', u'COMMAND'] | ||||
|         assert len(res['Processes']) == 1 | ||||
|         assert res['Processes'][0][-1] == 'sleep 60' | ||||
|         self.client.kill(container) | ||||
|  | @ -1122,6 +1122,8 @@ class ContainerTopTest(BaseAPIIntegrationTest): | |||
|     @pytest.mark.skipif( | ||||
|         IS_WINDOWS_PLATFORM, reason='No psargs support on windows' | ||||
|     ) | ||||
|     @pytest.mark.xfail(reason='Output of docker top depends on host distro, ' | ||||
|                               'and is not formalized.') | ||||
|     def test_top_with_psargs(self): | ||||
|         container = self.client.create_container( | ||||
|             TEST_IMG, ['sleep', '60']) | ||||
|  | @ -1129,11 +1131,8 @@ class ContainerTopTest(BaseAPIIntegrationTest): | |||
|         self.tmp_containers.append(container) | ||||
| 
 | ||||
|         self.client.start(container) | ||||
|         res = self.client.top(container, 'waux') | ||||
|         assert res['Titles'] == [ | ||||
|             'USER', 'PID', '%CPU', '%MEM', 'VSZ', 'RSS', | ||||
|             'TTY', 'STAT', 'START', 'TIME', 'COMMAND' | ||||
|         ] | ||||
|         res = self.client.top(container, '-eopid,user') | ||||
|         assert res['Titles'] == [u'PID', u'USER'] | ||||
|         assert len(res['Processes']) == 1 | ||||
|         assert res['Processes'][0][10] == 'sleep 60' | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue