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
2e67cd1c
Kaydet (Commit)
2e67cd1c
authored
Nis 23, 2019
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improve socket_detached test helper to support future versions of the daemon
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
63cda2e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
helpers.py
tests/helpers.py
+9
-4
No files found.
tests/helpers.py
Dosyayı görüntüle @
2e67cd1c
...
@@ -119,13 +119,18 @@ def assert_cat_socket_detached_with_keys(sock, inputs):
...
@@ -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
# If we're using a Unix socket, the sock.send call will fail with a
# BrokenPipeError ; INET sockets will just stop receiving / sending data
# BrokenPipeError ; INET sockets will just stop receiving / sending data
# but will not raise an error
# but will not raise an error
if
getattr
(
sock
,
'family'
,
-
9
)
==
getattr
(
socket
,
'AF_UNIX'
,
-
1
):
if
isinstance
(
sock
,
paramiko
.
Channel
):
with
pytest
.
raises
(
socket
.
error
):
sock
.
sendall
(
b
'make sure the socket is closed
\n
'
)
elif
isinstance
(
sock
,
paramiko
.
Channel
):
with
pytest
.
raises
(
OSError
):
with
pytest
.
raises
(
OSError
):
sock
.
sendall
(
b
'make sure the socket is closed
\n
'
)
sock
.
sendall
(
b
'make sure the socket is closed
\n
'
)
else
:
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
"
)
sock
.
sendall
(
b
"make sure the socket is closed
\n
"
)
data
=
sock
.
recv
(
128
)
data
=
sock
.
recv
(
128
)
# New in 18.06: error message is broadcast over the socket when reading
# New in 18.06: error message is broadcast over the socket when reading
...
...
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