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
e8ef5e51
Kaydet (Commit)
e8ef5e51
authored
Haz 28, 2016
tarafından
Joffrey F
Kaydeden (comit)
GitHub
Haz 28, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #1111 from docker/1.9.0-release
Cherry-pick signal fix into 1.9.0 release branch
üst
9010d594
0d8624b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
7 deletions
+42
-7
container.py
docker/api/container.py
+3
-1
container_test.py
tests/integration/container_test.py
+30
-0
network_test.py
tests/integration/network_test.py
+9
-6
No files found.
docker/api/container.py
Dosyayı görüntüle @
e8ef5e51
...
...
@@ -187,7 +187,9 @@ class ContainerApiMixin(object):
url
=
self
.
_url
(
"/containers/{0}/kill"
,
container
)
params
=
{}
if
signal
is
not
None
:
params
[
'signal'
]
=
int
(
signal
)
if
not
isinstance
(
signal
,
six
.
string_types
):
signal
=
int
(
signal
)
params
[
'signal'
]
=
signal
res
=
self
.
_post
(
url
,
params
=
params
)
self
.
_raise_for_status
(
res
)
...
...
tests/integration/container_test.py
Dosyayı görüntüle @
e8ef5e51
...
...
@@ -840,6 +840,36 @@ class KillTest(helpers.BaseTestCase):
self
.
assertIn
(
'Running'
,
state
)
self
.
assertEqual
(
state
[
'Running'
],
False
,
state
)
def
test_kill_with_signal_name
(
self
):
id
=
self
.
client
.
create_container
(
BUSYBOX
,
[
'sleep'
,
'60'
])
self
.
client
.
start
(
id
)
self
.
tmp_containers
.
append
(
id
)
self
.
client
.
kill
(
id
,
signal
=
'SIGKILL'
)
exitcode
=
self
.
client
.
wait
(
id
)
self
.
assertNotEqual
(
exitcode
,
0
)
container_info
=
self
.
client
.
inspect_container
(
id
)
self
.
assertIn
(
'State'
,
container_info
)
state
=
container_info
[
'State'
]
self
.
assertIn
(
'ExitCode'
,
state
)
self
.
assertNotEqual
(
state
[
'ExitCode'
],
0
)
self
.
assertIn
(
'Running'
,
state
)
self
.
assertEqual
(
state
[
'Running'
],
False
,
state
)
def
test_kill_with_signal_integer
(
self
):
id
=
self
.
client
.
create_container
(
BUSYBOX
,
[
'sleep'
,
'60'
])
self
.
client
.
start
(
id
)
self
.
tmp_containers
.
append
(
id
)
self
.
client
.
kill
(
id
,
signal
=
9
)
exitcode
=
self
.
client
.
wait
(
id
)
self
.
assertNotEqual
(
exitcode
,
0
)
container_info
=
self
.
client
.
inspect_container
(
id
)
self
.
assertIn
(
'State'
,
container_info
)
state
=
container_info
[
'State'
]
self
.
assertIn
(
'ExitCode'
,
state
)
self
.
assertNotEqual
(
state
[
'ExitCode'
],
0
)
self
.
assertIn
(
'Running'
,
state
)
self
.
assertEqual
(
state
[
'Running'
],
False
,
state
)
class
PortTest
(
helpers
.
BaseTestCase
):
def
test_port
(
self
):
...
...
tests/integration/network_test.py
Dosyayı görüntüle @
e8ef5e51
...
...
@@ -138,9 +138,11 @@ class TestNetworks(helpers.BaseTestCase):
self
.
client
.
connect_container_to_network
(
container
,
net_id
,
aliases
=
[
'foo'
,
'bar'
])
container_data
=
self
.
client
.
inspect_container
(
container
)
self
.
assertEqual
(
container_data
[
'NetworkSettings'
][
'Networks'
][
net_name
][
'Aliases'
],
[
'foo'
,
'bar'
])
aliases
=
(
container_data
[
'NetworkSettings'
][
'Networks'
][
net_name
][
'Aliases'
]
)
assert
'foo'
in
aliases
assert
'bar'
in
aliases
@requires_api_version
(
'1.21'
)
def
test_connect_on_container_create
(
self
):
...
...
@@ -183,10 +185,11 @@ class TestNetworks(helpers.BaseTestCase):
self
.
client
.
start
(
container
)
container_data
=
self
.
client
.
inspect_container
(
container
)
self
.
assertEqual
(
container_data
[
'NetworkSettings'
][
'Networks'
][
net_name
][
'Aliases'
],
[
'foo'
,
'bar'
]
aliases
=
(
container_data
[
'NetworkSettings'
][
'Networks'
][
net_name
][
'Aliases'
]
)
assert
'foo'
in
aliases
assert
'bar'
in
aliases
@requires_api_version
(
'1.22'
)
def
test_create_with_ipv4_address
(
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