Skip to content

Commit 75e0ad0

Browse files
authored
Merge pull request #2328 from docker/modernize_test_deps
Update some test dependencies / default values with newer versions
2 parents 4d62dd0 + eba8345 commit 75e0ad0

File tree

4 files changed

+26
-29
lines changed

4 files changed

+26
-29
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ integration-test-py3: build-py3
4242
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 py.test -v tests/integration/${file}
4343

4444
TEST_API_VERSION ?= 1.35
45-
TEST_ENGINE_VERSION ?= 17.12.0-ce
45+
TEST_ENGINE_VERSION ?= 18.09.5
4646

4747
.PHONY: setup-network
4848
setup-network:

tests/integration/api_container_test.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@
55
import threading
66
from datetime import datetime
77

8-
import docker
9-
from docker.constants import IS_WINDOWS_PLATFORM
10-
from docker.utils.socket import next_frame_header
11-
from docker.utils.socket import read_exactly
12-
138
import pytest
14-
159
import requests
1610
import six
1711

18-
from .base import BUSYBOX, BaseAPIIntegrationTest
12+
import docker
1913
from .. import helpers
20-
from ..helpers import (
21-
assert_cat_socket_detached_with_keys, ctrl_with, requires_api_version,
22-
)
14+
from ..helpers import assert_cat_socket_detached_with_keys
15+
from ..helpers import ctrl_with
16+
from ..helpers import requires_api_version
17+
from .base import BaseAPIIntegrationTest
18+
from .base import BUSYBOX
19+
from docker.constants import IS_WINDOWS_PLATFORM
20+
from docker.utils.socket import next_frame_header
21+
from docker.utils.socket import read_exactly
2322

2423

2524
class ListContainersTest(BaseAPIIntegrationTest):
@@ -38,7 +37,7 @@ def test_list_containers(self):
3837
assert 'Command' in retrieved
3938
assert retrieved['Command'] == six.text_type('true')
4039
assert 'Image' in retrieved
41-
assert re.search(r'busybox:.*', retrieved['Image'])
40+
assert re.search(r'alpine:.*', retrieved['Image'])
4241
assert 'Status' in retrieved
4342

4443

@@ -368,10 +367,9 @@ def test_create_with_environment_variable_no_value(self):
368367
)
369368
self.tmp_containers.append(container['Id'])
370369
config = self.client.inspect_container(container['Id'])
371-
assert (
372-
sorted(config['Config']['Env']) ==
373-
sorted(['Foo', 'Other=one', 'Blank='])
374-
)
370+
assert 'Foo' in config['Config']['Env']
371+
assert 'Other=one' in config['Config']['Env']
372+
assert 'Blank=' in config['Config']['Env']
375373

376374
@requires_api_version('1.22')
377375
def test_create_with_tmpfs(self):

tests/integration/api_exec_test.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
from ..helpers import assert_cat_socket_detached_with_keys
2+
from ..helpers import ctrl_with
3+
from ..helpers import requires_api_version
4+
from .base import BaseAPIIntegrationTest
5+
from .base import BUSYBOX
16
from docker.utils.proxy import ProxyConfig
27
from docker.utils.socket import next_frame_header
38
from docker.utils.socket import read_exactly
49

5-
from .base import BUSYBOX, BaseAPIIntegrationTest
6-
from ..helpers import (
7-
assert_cat_socket_detached_with_keys, ctrl_with, requires_api_version,
8-
)
9-
1010

1111
class ExecTest(BaseAPIIntegrationTest):
1212
def test_execute_command_with_proxy_env(self):
@@ -81,11 +81,11 @@ def test_exec_command_as_user(self):
8181
self.client.start(id)
8282
self.tmp_containers.append(id)
8383

84-
res = self.client.exec_create(id, 'whoami', user='default')
84+
res = self.client.exec_create(id, 'whoami', user='postgres')
8585
assert 'Id' in res
8686

8787
exec_log = self.client.exec_start(res)
88-
assert exec_log == b'default\n'
88+
assert exec_log == b'postgres\n'
8989

9090
def test_exec_command_as_root(self):
9191
container = self.client.create_container(BUSYBOX, 'cat',
@@ -188,9 +188,9 @@ def test_exec_command_with_workdir(self):
188188
self.tmp_containers.append(container)
189189
self.client.start(container)
190190

191-
res = self.client.exec_create(container, 'pwd', workdir='/var/www')
191+
res = self.client.exec_create(container, 'pwd', workdir='/var/opt')
192192
exec_log = self.client.exec_start(res)
193-
assert exec_log == b'/var/www\n'
193+
assert exec_log == b'/var/opt\n'
194194

195195
def test_detach_with_default(self):
196196
container = self.client.create_container(
@@ -252,7 +252,7 @@ class ExecDemuxTest(BaseAPIIntegrationTest):
252252
'echo hello out',
253253
# Busybox's sleep does not handle sub-second times.
254254
# This loops takes ~0.3 second to execute on my machine.
255-
'for i in $(seq 1 50000); do echo $i>/dev/null; done',
255+
'sleep 0.5',
256256
# Write something on stderr
257257
'echo hello err >&2'])
258258
)

tests/integration/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
import unittest
44

55
import docker
6-
from docker.utils import kwargs_from_env
7-
86
from .. import helpers
7+
from docker.utils import kwargs_from_env
98

10-
BUSYBOX = 'busybox:buildroot-2014.02'
9+
BUSYBOX = 'alpine:3.9.3' # FIXME: this should probably be renamed
1110
TEST_API_VERSION = os.environ.get('DOCKER_TEST_API_VERSION')
1211

1312

0 commit comments

Comments
 (0)