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
f4c881f3
Kaydet (Commit)
f4c881f3
authored
Eki 28, 2015
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #827 from coreypobrien/lessbinding
Move container volume bind tests to their own class
üst
a610a1be
a2184def
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
45 deletions
+53
-45
container_test.py
tests/integration/container_test.py
+53
-45
No files found.
tests/integration/container_test.py
Dosyayı görüntüle @
f4c881f3
...
...
@@ -37,22 +37,6 @@ class ListContainersTest(api_test.BaseTestCase):
class
CreateContainerTest
(
api_test
.
BaseTestCase
):
def
setUp
(
self
):
super
(
CreateContainerTest
,
self
)
.
setUp
()
self
.
mount_dest
=
'/mnt'
# Get a random pathname - we don't need it to exist locally
self
.
mount_origin
=
tempfile
.
mkdtemp
()
shutil
.
rmtree
(
self
.
mount_origin
)
self
.
filename
=
'shared.txt'
self
.
run_with_volume
(
False
,
BUSYBOX
,
[
'touch'
,
os
.
path
.
join
(
self
.
mount_dest
,
self
.
filename
)],
)
def
test_create
(
self
):
res
=
self
.
client
.
create_container
(
BUSYBOX
,
'true'
)
...
...
@@ -176,35 +160,6 @@ class CreateContainerTest(api_test.BaseTestCase):
info
=
self
.
client
.
inspect_container
(
res2
[
'Id'
])
self
.
assertCountEqual
(
info
[
'HostConfig'
][
'VolumesFrom'
],
vol_names
)
def
test_create_with_binds_rw
(
self
):
container
=
self
.
run_with_volume
(
False
,
BUSYBOX
,
[
'ls'
,
self
.
mount_dest
],
)
logs
=
self
.
client
.
logs
(
container
)
if
six
.
PY3
:
logs
=
logs
.
decode
(
'utf-8'
)
self
.
assertIn
(
self
.
filename
,
logs
)
inspect_data
=
self
.
client
.
inspect_container
(
container
)
self
.
check_container_data
(
inspect_data
,
True
)
def
test_create_with_binds_ro
(
self
):
container
=
self
.
run_with_volume
(
True
,
BUSYBOX
,
[
'ls'
,
self
.
mount_dest
],
)
logs
=
self
.
client
.
logs
(
container
)
if
six
.
PY3
:
logs
=
logs
.
decode
(
'utf-8'
)
self
.
assertIn
(
self
.
filename
,
logs
)
inspect_data
=
self
.
client
.
inspect_container
(
container
)
self
.
check_container_data
(
inspect_data
,
False
)
def
create_container_readonly_fs
(
self
):
if
not
api_test
.
exec_driver_is_native
():
pytest
.
skip
(
'Exec driver not native'
)
...
...
@@ -382,6 +337,59 @@ class CreateContainerTest(api_test.BaseTestCase):
self
.
assertEqual
(
container_log_config
[
'Type'
],
"json-file"
)
self
.
assertEqual
(
container_log_config
[
'Config'
],
{})
class
VolumeBindTest
(
api_test
.
BaseTestCase
):
def
setUp
(
self
):
super
(
VolumeBindTest
,
self
)
.
setUp
()
self
.
mount_dest
=
'/mnt'
# Get a random pathname - we don't need it to exist locally
self
.
mount_origin
=
tempfile
.
mkdtemp
()
shutil
.
rmtree
(
self
.
mount_origin
)
self
.
filename
=
'shared.txt'
self
.
run_with_volume
(
False
,
BUSYBOX
,
[
'touch'
,
os
.
path
.
join
(
self
.
mount_dest
,
self
.
filename
)],
)
def
test_create_with_binds_rw
(
self
):
container
=
self
.
run_with_volume
(
False
,
BUSYBOX
,
[
'ls'
,
self
.
mount_dest
],
)
logs
=
self
.
client
.
logs
(
container
)
if
six
.
PY3
:
logs
=
logs
.
decode
(
'utf-8'
)
self
.
assertIn
(
self
.
filename
,
logs
)
inspect_data
=
self
.
client
.
inspect_container
(
container
)
self
.
check_container_data
(
inspect_data
,
True
)
def
test_create_with_binds_ro
(
self
):
self
.
run_with_volume
(
False
,
BUSYBOX
,
[
'touch'
,
os
.
path
.
join
(
self
.
mount_dest
,
self
.
filename
)],
)
container
=
self
.
run_with_volume
(
True
,
BUSYBOX
,
[
'ls'
,
self
.
mount_dest
],
)
logs
=
self
.
client
.
logs
(
container
)
if
six
.
PY3
:
logs
=
logs
.
decode
(
'utf-8'
)
self
.
assertIn
(
self
.
filename
,
logs
)
inspect_data
=
self
.
client
.
inspect_container
(
container
)
self
.
check_container_data
(
inspect_data
,
False
)
def
check_container_data
(
self
,
inspect_data
,
rw
):
if
docker
.
utils
.
compare_version
(
'1.20'
,
self
.
client
.
_version
)
<
0
:
self
.
assertIn
(
'Volumes'
,
inspect_data
)
...
...
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