Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
992e0dcd
Unverified
Kaydet (Commit)
992e0dcd
authored
May 01, 2019
tarafından
Joffrey F
Kaydeden (comit)
GitHub
May 01, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #2317 from docker/fix_socket_detach_helper
Fix socket detach helper
üst
63cda2e7
62c8bcbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
helpers.py
tests/helpers.py
+12
-7
api_container_test.py
tests/integration/api_container_test.py
+1
-1
No files found.
tests/helpers.py
Dosyayı görüntüle @
992e0dcd
...
...
@@ -2,16 +2,16 @@ import functools
import
os
import
os.path
import
random
import
re
import
socket
import
tarfile
import
tempfile
import
time
import
re
import
six
import
socket
import
docker
import
paramiko
import
pytest
import
six
def
make_tree
(
dirs
,
files
):
...
...
@@ -119,13 +119,18 @@ def assert_cat_socket_detached_with_keys(sock, inputs):
# If we're using a Unix socket, the sock.send call will fail with a
# BrokenPipeError ; INET sockets will just stop receiving / sending data
# but will not raise an error
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
):
if
isinstance
(
sock
,
paramiko
.
Channel
):
with
pytest
.
raises
(
OSError
):
sock
.
sendall
(
b
'make sure the socket is closed
\n
'
)
else
:
if
getattr
(
sock
,
'family'
,
-
9
)
==
getattr
(
socket
,
'AF_UNIX'
,
-
1
):
# We do not want to use pytest.raises here because future versions
# of the daemon no longer cause this to raise an error.
try
:
sock
.
sendall
(
b
'make sure the socket is closed
\n
'
)
except
socket
.
error
:
return
sock
.
sendall
(
b
"make sure the socket is closed
\n
"
)
data
=
sock
.
recv
(
128
)
# New in 18.06: error message is broadcast over the socket when reading
...
...
tests/integration/api_container_test.py
Dosyayı görüntüle @
992e0dcd
...
...
@@ -1251,7 +1251,7 @@ class AttachContainerTest(BaseAPIIntegrationTest):
output
=
self
.
client
.
attach
(
container
,
stream
=
False
,
logs
=
True
)
assert
output
==
'hello
\n
'
.
encode
(
encoding
=
'ascii'
)
@pytest.mark.timeout
(
5
)
@pytest.mark.timeout
(
10
)
@pytest.mark.skipif
(
os
.
environ
.
get
(
'DOCKER_HOST'
,
''
)
.
startswith
(
'ssh://'
),
reason
=
'No cancellable streams over SSH'
)
def
test_attach_stream_and_cancel
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment