summaryrefslogtreecommitdiff
path: root/tests/integration/api_container_test.py
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-01-29 17:07:15 -0800
committerJoffrey F <joffrey@docker.com>2018-01-30 17:16:23 -0800
commite304f91b4636b59a056ff795d91895c725c6255f (patch)
treeaf96522c00d38e29850ecd8090f427e48030df94 /tests/integration/api_container_test.py
parentdd858648a0942177995a74e1eda3468a720a3c58 (diff)
downloaddocker-py-mtsmfm-master.tar.gz
Update detach tests to work with AF_INET as wellmtsmfm-master
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/integration/api_container_test.py')
-rw-r--r--tests/integration/api_container_test.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/tests/integration/api_container_test.py b/tests/integration/api_container_test.py
index ebb5e91..f48e78e 100644
--- a/tests/integration/api_container_test.py
+++ b/tests/integration/api_container_test.py
@@ -17,7 +17,7 @@ import six
from .base import BUSYBOX, BaseAPIIntegrationTest
from .. import helpers
from ..helpers import (
- requires_api_version, ctrl_with, assert_socket_closed_with_keys
+ requires_api_version, ctrl_with, assert_cat_socket_detached_with_keys
)
@@ -1227,55 +1227,54 @@ class AttachContainerTest(BaseAPIIntegrationTest):
def test_detach_with_default(self):
container = self.client.create_container(
- BUSYBOX, '/bin/sh',
+ BUSYBOX, 'cat',
detach=True, stdin_open=True, tty=True
)
- id = container['Id']
- self.tmp_containers.append(id)
- self.client.start(id)
+ self.tmp_containers.append(container)
+ self.client.start(container)
sock = self.client.attach_socket(
container,
{'stdin': True, 'stream': True}
)
- assert_socket_closed_with_keys(sock, [ctrl_with('p'), ctrl_with('q')])
+ assert_cat_socket_detached_with_keys(
+ sock, [ctrl_with('p'), ctrl_with('q')]
+ )
def test_detach_with_config_file(self):
self.client._general_configs['detachKeys'] = 'ctrl-p'
container = self.client.create_container(
- BUSYBOX, '/bin/sh',
+ BUSYBOX, 'cat',
detach=True, stdin_open=True, tty=True
)
- id = container['Id']
- self.tmp_containers.append(id)
- self.client.start(id)
+ self.tmp_containers.append(container)
+ self.client.start(container)
sock = self.client.attach_socket(
container,
{'stdin': True, 'stream': True}
)
- assert_socket_closed_with_keys(sock, [ctrl_with('p')])
+ assert_cat_socket_detached_with_keys(sock, [ctrl_with('p')])
def test_detach_with_arg(self):
self.client._general_configs['detachKeys'] = 'ctrl-p'
container = self.client.create_container(
- BUSYBOX, '/bin/sh',
+ BUSYBOX, 'cat',
detach=True, stdin_open=True, tty=True
)
- id = container['Id']
- self.tmp_containers.append(id)
- self.client.start(id)
+ self.tmp_containers.append(container)
+ self.client.start(container)
sock = self.client.attach_socket(
container,
{'stdin': True, 'stream': True, 'detachKeys': 'ctrl-x'}
)
- assert_socket_closed_with_keys(sock, [ctrl_with('x')])
+ assert_cat_socket_detached_with_keys(sock, [ctrl_with('x')])
class PauseTest(BaseAPIIntegrationTest):