mirror of https://github.com/docker/docker-py.git
Fix test cases for ``runtime`` config
Signed-off-by: Madhuri Kumari <madhuri.kumari@intel.com>
This commit is contained in:
parent
6ae24b9e60
commit
612c0f3d0d
|
@ -417,7 +417,7 @@ class ContainerApiMixin(object):
|
||||||
Default: 10
|
Default: 10
|
||||||
networking_config (dict): A networking configuration generated
|
networking_config (dict): A networking configuration generated
|
||||||
by :py:meth:`create_networking_config`.
|
by :py:meth:`create_networking_config`.
|
||||||
runtime (str): The name of the runtime tool to create container.
|
runtime (str): Runtime to use with this container.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A dictionary with an image 'Id' key and a 'Warnings' key.
|
A dictionary with an image 'Id' key and a 'Warnings' key.
|
||||||
|
@ -577,7 +577,7 @@ class ContainerApiMixin(object):
|
||||||
values are: ``host``
|
values are: ``host``
|
||||||
volumes_from (:py:class:`list`): List of container names or IDs to
|
volumes_from (:py:class:`list`): List of container names or IDs to
|
||||||
get volumes from.
|
get volumes from.
|
||||||
runtime (str): The name of the runtime tool to manage container.
|
runtime (str): Runtime to use with this container.
|
||||||
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
|
@ -659,7 +659,7 @@ class ContainerCollection(Collection):
|
||||||
volumes_from (:py:class:`list`): List of container names or IDs to
|
volumes_from (:py:class:`list`): List of container names or IDs to
|
||||||
get volumes from.
|
get volumes from.
|
||||||
working_dir (str): Path to the working directory.
|
working_dir (str): Path to the working directory.
|
||||||
runtime (str): The name of the runtime tool to create container.
|
runtime (str): Runtime to use with this container.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The container logs, either ``STDOUT``, ``STDERR``, or both,
|
The container logs, either ``STDOUT``, ``STDERR``, or both,
|
||||||
|
|
|
@ -474,6 +474,8 @@ class HostConfig(dict):
|
||||||
self['NanoCpus'] = nano_cpus
|
self['NanoCpus'] = nano_cpus
|
||||||
|
|
||||||
if runtime:
|
if runtime:
|
||||||
|
if version_lt(version, '1.25'):
|
||||||
|
raise host_config_version_error('runtime', '1.25')
|
||||||
self['Runtime'] = runtime
|
self['Runtime'] = runtime
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -122,8 +122,6 @@ Change log
|
||||||
* Added support for `force_update` in `TaskTemplate`
|
* Added support for `force_update` in `TaskTemplate`
|
||||||
* Made `name` parameter optional in `APIClient.create_volume` and
|
* Made `name` parameter optional in `APIClient.create_volume` and
|
||||||
`DockerClient.volumes.create`
|
`DockerClient.volumes.create`
|
||||||
* Added support for `runtime` in `APIClient.create_container` and
|
|
||||||
`DockerClient.containers.run`
|
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|
||||||
|
|
|
@ -1255,14 +1255,14 @@ class ContainerCPUTest(BaseAPIIntegrationTest):
|
||||||
inspect_data = self.client.inspect_container(container)
|
inspect_data = self.client.inspect_container(container)
|
||||||
self.assertEqual(inspect_data['HostConfig']['CpusetCpus'], cpuset_cpus)
|
self.assertEqual(inspect_data['HostConfig']['CpusetCpus'], cpuset_cpus)
|
||||||
|
|
||||||
|
@requires_api_version('1.25')
|
||||||
def test_create_with_runtime(self):
|
def test_create_with_runtime(self):
|
||||||
container = self.client.create_container(
|
container = self.client.create_container(
|
||||||
BUSYBOX, ['echo', 'test'], runtime='runc'
|
BUSYBOX, ['echo', 'test'], runtime='runc'
|
||||||
)
|
)
|
||||||
self.tmp_containers.append(container['Id'])
|
self.tmp_containers.append(container['Id'])
|
||||||
config = self.client.inspect_container(container)
|
config = self.client.inspect_container(container)
|
||||||
assert config['Config']['Runtime'] == 'runc'
|
assert config['HostConfig']['Runtime'] == 'runc'
|
||||||
|
|
||||||
|
|
||||||
class LinkTest(BaseAPIIntegrationTest):
|
class LinkTest(BaseAPIIntegrationTest):
|
||||||
|
|
Loading…
Reference in New Issue