mirror of https://github.com/docker/docs.git
Update service volume tests to use mounts key
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
3bdcc9d954
commit
afab5c76ea
|
@ -600,12 +600,33 @@ class ServiceVolumesTest(unittest.TestCase):
|
||||||
}
|
}
|
||||||
container = Container(self.mock_client, {
|
container = Container(self.mock_client, {
|
||||||
'Image': 'ababab',
|
'Image': 'ababab',
|
||||||
'Volumes': {
|
'Mounts': [
|
||||||
'/host/volume': '/host/volume',
|
{
|
||||||
'/existing/volume': '/var/lib/docker/aaaaaaaa',
|
'Source': '/host/volume',
|
||||||
'/removed/volume': '/var/lib/docker/bbbbbbbb',
|
'Destination': '/host/volume',
|
||||||
'/mnt/image/data': '/var/lib/docker/cccccccc',
|
'Mode': '',
|
||||||
},
|
'RW': True,
|
||||||
|
'Name': 'hostvolume',
|
||||||
|
}, {
|
||||||
|
'Source': '/var/lib/docker/aaaaaaaa',
|
||||||
|
'Destination': '/existing/volume',
|
||||||
|
'Mode': '',
|
||||||
|
'RW': True,
|
||||||
|
'Name': 'existingvolume',
|
||||||
|
}, {
|
||||||
|
'Source': '/var/lib/docker/bbbbbbbb',
|
||||||
|
'Destination': '/removed/volume',
|
||||||
|
'Mode': '',
|
||||||
|
'RW': True,
|
||||||
|
'Name': 'removedvolume',
|
||||||
|
}, {
|
||||||
|
'Source': '/var/lib/docker/cccccccc',
|
||||||
|
'Destination': '/mnt/image/data',
|
||||||
|
'Mode': '',
|
||||||
|
'RW': True,
|
||||||
|
'Name': 'imagedata',
|
||||||
|
},
|
||||||
|
]
|
||||||
}, has_been_inspected=True)
|
}, has_been_inspected=True)
|
||||||
|
|
||||||
expected = [
|
expected = [
|
||||||
|
@ -630,7 +651,13 @@ class ServiceVolumesTest(unittest.TestCase):
|
||||||
|
|
||||||
intermediate_container = Container(self.mock_client, {
|
intermediate_container = Container(self.mock_client, {
|
||||||
'Image': 'ababab',
|
'Image': 'ababab',
|
||||||
'Volumes': {'/existing/volume': '/var/lib/docker/aaaaaaaa'},
|
'Mounts': [{
|
||||||
|
'Source': '/var/lib/docker/aaaaaaaa',
|
||||||
|
'Destination': '/existing/volume',
|
||||||
|
'Mode': '',
|
||||||
|
'RW': True,
|
||||||
|
'Name': 'existingvolume',
|
||||||
|
}],
|
||||||
}, has_been_inspected=True)
|
}, has_been_inspected=True)
|
||||||
|
|
||||||
expected = [
|
expected = [
|
||||||
|
@ -693,9 +720,16 @@ class ServiceVolumesTest(unittest.TestCase):
|
||||||
self.mock_client.inspect_container.return_value = {
|
self.mock_client.inspect_container.return_value = {
|
||||||
'Id': '123123123',
|
'Id': '123123123',
|
||||||
'Image': 'ababab',
|
'Image': 'ababab',
|
||||||
'Volumes': {
|
'Mounts': [
|
||||||
'/data': '/mnt/sda1/host/path',
|
{
|
||||||
},
|
'Destination': '/data',
|
||||||
|
'Source': '/mnt/sda1/host/path',
|
||||||
|
'Mode': '',
|
||||||
|
'RW': True,
|
||||||
|
'Driver': 'local',
|
||||||
|
'Name': 'abcdefff1234'
|
||||||
|
},
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
service._get_container_create_options(
|
service._get_container_create_options(
|
||||||
|
|
Loading…
Reference in New Issue