mirror of https://github.com/docker/docker-py.git
Update some test dependencies / default values with newer versions
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
be9cf3e39e
commit
eba8345c37
2
Makefile
2
Makefile
|
@ -42,7 +42,7 @@ integration-test-py3: build-py3
|
||||||
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 py.test tests/integration/${file}
|
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 py.test tests/integration/${file}
|
||||||
|
|
||||||
TEST_API_VERSION ?= 1.35
|
TEST_API_VERSION ?= 1.35
|
||||||
TEST_ENGINE_VERSION ?= 17.12.0-ce
|
TEST_ENGINE_VERSION ?= 18.09.5
|
||||||
|
|
||||||
.PHONY: setup-network
|
.PHONY: setup-network
|
||||||
setup-network:
|
setup-network:
|
||||||
|
|
|
@ -5,21 +5,20 @@ import tempfile
|
||||||
import threading
|
import threading
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import docker
|
|
||||||
from docker.constants import IS_WINDOWS_PLATFORM
|
|
||||||
from docker.utils.socket import next_frame_header
|
|
||||||
from docker.utils.socket import read_exactly
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from .base import BUSYBOX, BaseAPIIntegrationTest
|
import docker
|
||||||
from .. import helpers
|
from .. import helpers
|
||||||
from ..helpers import (
|
from ..helpers import assert_cat_socket_detached_with_keys
|
||||||
assert_cat_socket_detached_with_keys, ctrl_with, requires_api_version,
|
from ..helpers import ctrl_with
|
||||||
)
|
from ..helpers import requires_api_version
|
||||||
|
from .base import BaseAPIIntegrationTest
|
||||||
|
from .base import BUSYBOX
|
||||||
|
from docker.constants import IS_WINDOWS_PLATFORM
|
||||||
|
from docker.utils.socket import next_frame_header
|
||||||
|
from docker.utils.socket import read_exactly
|
||||||
|
|
||||||
|
|
||||||
class ListContainersTest(BaseAPIIntegrationTest):
|
class ListContainersTest(BaseAPIIntegrationTest):
|
||||||
|
@ -38,7 +37,7 @@ class ListContainersTest(BaseAPIIntegrationTest):
|
||||||
assert 'Command' in retrieved
|
assert 'Command' in retrieved
|
||||||
assert retrieved['Command'] == six.text_type('true')
|
assert retrieved['Command'] == six.text_type('true')
|
||||||
assert 'Image' in retrieved
|
assert 'Image' in retrieved
|
||||||
assert re.search(r'busybox:.*', retrieved['Image'])
|
assert re.search(r'alpine:.*', retrieved['Image'])
|
||||||
assert 'Status' in retrieved
|
assert 'Status' in retrieved
|
||||||
|
|
||||||
|
|
||||||
|
@ -368,10 +367,9 @@ class CreateContainerTest(BaseAPIIntegrationTest):
|
||||||
)
|
)
|
||||||
self.tmp_containers.append(container['Id'])
|
self.tmp_containers.append(container['Id'])
|
||||||
config = self.client.inspect_container(container['Id'])
|
config = self.client.inspect_container(container['Id'])
|
||||||
assert (
|
assert 'Foo' in config['Config']['Env']
|
||||||
sorted(config['Config']['Env']) ==
|
assert 'Other=one' in config['Config']['Env']
|
||||||
sorted(['Foo', 'Other=one', 'Blank='])
|
assert 'Blank=' in config['Config']['Env']
|
||||||
)
|
|
||||||
|
|
||||||
@requires_api_version('1.22')
|
@requires_api_version('1.22')
|
||||||
def test_create_with_tmpfs(self):
|
def test_create_with_tmpfs(self):
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
|
from ..helpers import assert_cat_socket_detached_with_keys
|
||||||
|
from ..helpers import ctrl_with
|
||||||
|
from ..helpers import requires_api_version
|
||||||
|
from .base import BaseAPIIntegrationTest
|
||||||
|
from .base import BUSYBOX
|
||||||
from docker.utils.proxy import ProxyConfig
|
from docker.utils.proxy import ProxyConfig
|
||||||
from docker.utils.socket import next_frame_header
|
from docker.utils.socket import next_frame_header
|
||||||
from docker.utils.socket import read_exactly
|
from docker.utils.socket import read_exactly
|
||||||
|
|
||||||
from .base import BUSYBOX, BaseAPIIntegrationTest
|
|
||||||
from ..helpers import (
|
|
||||||
assert_cat_socket_detached_with_keys, ctrl_with, requires_api_version,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ExecTest(BaseAPIIntegrationTest):
|
class ExecTest(BaseAPIIntegrationTest):
|
||||||
def test_execute_command_with_proxy_env(self):
|
def test_execute_command_with_proxy_env(self):
|
||||||
|
@ -81,11 +81,11 @@ class ExecTest(BaseAPIIntegrationTest):
|
||||||
self.client.start(id)
|
self.client.start(id)
|
||||||
self.tmp_containers.append(id)
|
self.tmp_containers.append(id)
|
||||||
|
|
||||||
res = self.client.exec_create(id, 'whoami', user='default')
|
res = self.client.exec_create(id, 'whoami', user='postgres')
|
||||||
assert 'Id' in res
|
assert 'Id' in res
|
||||||
|
|
||||||
exec_log = self.client.exec_start(res)
|
exec_log = self.client.exec_start(res)
|
||||||
assert exec_log == b'default\n'
|
assert exec_log == b'postgres\n'
|
||||||
|
|
||||||
def test_exec_command_as_root(self):
|
def test_exec_command_as_root(self):
|
||||||
container = self.client.create_container(BUSYBOX, 'cat',
|
container = self.client.create_container(BUSYBOX, 'cat',
|
||||||
|
@ -188,9 +188,9 @@ class ExecTest(BaseAPIIntegrationTest):
|
||||||
self.tmp_containers.append(container)
|
self.tmp_containers.append(container)
|
||||||
self.client.start(container)
|
self.client.start(container)
|
||||||
|
|
||||||
res = self.client.exec_create(container, 'pwd', workdir='/var/www')
|
res = self.client.exec_create(container, 'pwd', workdir='/var/opt')
|
||||||
exec_log = self.client.exec_start(res)
|
exec_log = self.client.exec_start(res)
|
||||||
assert exec_log == b'/var/www\n'
|
assert exec_log == b'/var/opt\n'
|
||||||
|
|
||||||
def test_detach_with_default(self):
|
def test_detach_with_default(self):
|
||||||
container = self.client.create_container(
|
container = self.client.create_container(
|
||||||
|
@ -252,7 +252,7 @@ class ExecDemuxTest(BaseAPIIntegrationTest):
|
||||||
'echo hello out',
|
'echo hello out',
|
||||||
# Busybox's sleep does not handle sub-second times.
|
# Busybox's sleep does not handle sub-second times.
|
||||||
# This loops takes ~0.3 second to execute on my machine.
|
# This loops takes ~0.3 second to execute on my machine.
|
||||||
'for i in $(seq 1 50000); do echo $i>/dev/null; done',
|
'sleep 0.5',
|
||||||
# Write something on stderr
|
# Write something on stderr
|
||||||
'echo hello err >&2'])
|
'echo hello err >&2'])
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,11 +3,10 @@ import shutil
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import docker
|
import docker
|
||||||
|
from .. import helpers
|
||||||
from docker.utils import kwargs_from_env
|
from docker.utils import kwargs_from_env
|
||||||
|
|
||||||
from .. import helpers
|
BUSYBOX = 'alpine:3.9.3' # FIXME: this should probably be renamed
|
||||||
|
|
||||||
BUSYBOX = 'busybox:buildroot-2014.02'
|
|
||||||
TEST_API_VERSION = os.environ.get('DOCKER_TEST_API_VERSION')
|
TEST_API_VERSION = os.environ.get('DOCKER_TEST_API_VERSION')
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue