File tree Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,4 @@ tests/__pycache__
14
14
15
15
# Compiled Documentation
16
16
site /
17
+ Makefile
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ HOST_TMPDIR=test -n "$(TMPDIR)" && echo $(TMPDIR) || echo /tmp
4
4
5
5
all : test
6
6
7
+ clean :
8
+ docker rm -vf dpy-dind
9
+
7
10
build :
8
11
docker build -t docker-py .
9
12
@@ -23,3 +26,10 @@ integration-test: build
23
26
24
27
integration-test-py3 : build-py3
25
28
docker run -v ` $( HOST_TMPDIR) ` :/tmp -v /var/run/docker.sock:/var/run/docker.sock docker-py3 py.test -rxs tests/integration_test.py
29
+
30
+ integration-dind : build build-py3
31
+ docker build -t dpy-tests -f ./tests/Dockerfile .
32
+ docker run -d --name dpy-dind -v /tmp --privileged dockerswarm/dind:1.8.1 docker -d -H tcp://0.0.0.0:2375
33
+ docker run --volumes-from dpy-dind --env=" DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py py.test -rxs tests/integration_test.py
34
+ docker run --volumes-from dpy-dind --env=" DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py3 py.test -rxs tests/integration_test.py
35
+ docker rm -vf dpy-dind
Original file line number Diff line number Diff line change @@ -190,7 +190,6 @@ def runTest(self):
190
190
191
191
192
192
class TestCreateContainerWithBinds (BaseTestCase ):
193
- @pytest .mark .skipif (True , reason = "Doesn't work inside a container - FIXME" )
194
193
def runTest (self ):
195
194
mount_dest = '/mnt'
196
195
mount_origin = tempfile .mkdtemp ()
@@ -233,7 +232,6 @@ def runTest(self):
233
232
234
233
235
234
class TestCreateContainerWithRoBinds (BaseTestCase ):
236
- @pytest .mark .skipif (True , reason = "Doesn't work inside a container - FIXME" )
237
235
def runTest (self ):
238
236
mount_dest = '/mnt'
239
237
mount_origin = tempfile .mkdtemp ()
@@ -1461,8 +1459,11 @@ def runTest(self):
1461
1459
self .client .wait (c )
1462
1460
logs = self .client .logs (c )
1463
1461
1462
+ if six .PY3 :
1463
+ logs = logs .decode ('utf-8' )
1464
+
1464
1465
self .assertEqual (
1465
- filter (None , logs .split ('\n ' )),
1466
+ list ( filter (None , logs .split ('\n ' ) )),
1466
1467
['not-ignored' ],
1467
1468
)
1468
1469
Original file line number Diff line number Diff line change @@ -234,14 +234,18 @@ def test_ulimit_invalid_type(self):
234
234
235
235
def test_create_host_config_dict_logconfig (self ):
236
236
dct = {'type' : LogConfig .types .SYSLOG , 'config' : {'key1' : 'val1' }}
237
- config = create_host_config (log_config = dct )
237
+ config = create_host_config (
238
+ version = DEFAULT_DOCKER_API_VERSION , log_config = dct
239
+ )
238
240
self .assertIn ('LogConfig' , config )
239
241
self .assertTrue (isinstance (config ['LogConfig' ], LogConfig ))
240
242
self .assertEqual (dct ['type' ], config ['LogConfig' ].type )
241
243
242
244
def test_create_host_config_obj_logconfig (self ):
243
245
obj = LogConfig (type = LogConfig .types .SYSLOG , config = {'key1' : 'val1' })
244
- config = create_host_config (log_config = obj )
246
+ config = create_host_config (
247
+ version = DEFAULT_DOCKER_API_VERSION , log_config = obj
248
+ )
245
249
self .assertIn ('LogConfig' , config )
246
250
self .assertTrue (isinstance (config ['LogConfig' ], LogConfig ))
247
251
self .assertEqual (obj , config ['LogConfig' ])
You can’t perform that action at this time.
0 commit comments