Update tests for ssh protocol compatibility

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2018-10-31 17:08:52 -07:00
parent f4e9a1dc2a
commit 1df021ee24
2 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import six
import socket
import docker
import paramiko
import pytest
@ -121,6 +122,9 @@ def assert_cat_socket_detached_with_keys(sock, inputs):
if getattr(sock, 'family', -9) == getattr(socket, 'AF_UNIX', -1):
with pytest.raises(socket.error):
sock.sendall(b'make sure the socket is closed\n')
elif isinstance(sock, paramiko.Channel):
with pytest.raises(OSError):
sock.sendall(b'make sure the socket is closed\n')
else:
sock.sendall(b"make sure the socket is closed\n")
data = sock.recv(128)

View File

@ -1255,6 +1255,7 @@ class AttachContainerTest(BaseAPIIntegrationTest):
assert output == 'hello\n'.encode(encoding='ascii')
@pytest.mark.timeout(5)
@pytest.mark.xfail(True, reason='Cancellable events broken over SSH')
def test_attach_stream_and_cancel(self):
container = self.client.create_container(
BUSYBOX, 'sh -c "echo hello && sleep 60"',