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
e098dbf9
Kaydet (Commit)
e098dbf9
authored
Kas 28, 2016
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Re-enable pid_mode checks for API < 1.24
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
08872a3c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
utils.py
docker/utils/utils.py
+2
-0
api_container_test.py
tests/integration/api_container_test.py
+0
-4
utils_test.py
tests/unit/utils_test.py
+13
-0
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
e098dbf9
...
@@ -753,6 +753,8 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
...
@@ -753,6 +753,8 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
host_config
[
'ShmSize'
]
=
shm_size
host_config
[
'ShmSize'
]
=
shm_size
if
pid_mode
:
if
pid_mode
:
if
version_lt
(
version
,
'1.24'
)
and
pid_mode
!=
'host'
:
raise
host_config_value_error
(
'pid_mode'
,
pid_mode
)
host_config
[
'PidMode'
]
=
pid_mode
host_config
[
'PidMode'
]
=
pid_mode
if
ipc_mode
:
if
ipc_mode
:
...
...
tests/integration/api_container_test.py
Dosyayı görüntüle @
e098dbf9
...
@@ -361,10 +361,6 @@ class CreateContainerTest(BaseAPIIntegrationTest):
...
@@ -361,10 +361,6 @@ class CreateContainerTest(BaseAPIIntegrationTest):
host_config
=
inspect
[
'HostConfig'
]
host_config
=
inspect
[
'HostConfig'
]
self
.
assertIn
(
'MemorySwappiness'
,
host_config
)
self
.
assertIn
(
'MemorySwappiness'
,
host_config
)
def
test_create_host_config_exception_raising
(
self
):
self
.
assertRaises
(
TypeError
,
self
.
client
.
create_host_config
,
mem_swappiness
=
'40'
)
def
test_create_with_environment_variable_no_value
(
self
):
def
test_create_with_environment_variable_no_value
(
self
):
container
=
self
.
client
.
create_container
(
container
=
self
.
client
.
create_container
(
BUSYBOX
,
BUSYBOX
,
...
...
tests/unit/utils_test.py
Dosyayı görüntüle @
e098dbf9
...
@@ -207,6 +207,19 @@ class HostConfigTest(unittest.TestCase):
...
@@ -207,6 +207,19 @@ class HostConfigTest(unittest.TestCase):
version
=
'1.24'
,
isolation
=
{
'isolation'
:
'hyperv'
}
version
=
'1.24'
,
isolation
=
{
'isolation'
:
'hyperv'
}
)
)
def
test_create_host_config_pid_mode
(
self
):
with
pytest
.
raises
(
ValueError
):
create_host_config
(
version
=
'1.23'
,
pid_mode
=
'baccab125'
)
config
=
create_host_config
(
version
=
'1.23'
,
pid_mode
=
'host'
)
assert
config
.
get
(
'PidMode'
)
==
'host'
config
=
create_host_config
(
version
=
'1.24'
,
pid_mode
=
'baccab125'
)
assert
config
.
get
(
'PidMode'
)
==
'baccab125'
def
test_create_host_config_invalid_mem_swappiness
(
self
):
with
pytest
.
raises
(
TypeError
):
create_host_config
(
version
=
'1.24'
,
mem_swappiness
=
'40'
)
class
UlimitTest
(
unittest
.
TestCase
):
class
UlimitTest
(
unittest
.
TestCase
):
def
test_create_host_config_dict_ulimit
(
self
):
def
test_create_host_config_dict_ulimit
(
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