docker_container: fix tests and idempotency for init and shm_size (#48551)

* Fix tests: use same command if not testing command option.

* Fix idempotency of init option.

* Fix shm_size idempotency (it is included in inspect results from docker API version 1.22 on).

* Add changelog.
This commit is contained in:
Felix Fontein 2018-11-13 14:07:36 +01:00 committed by John R Barker
parent 4e1e9589b5
commit b1acabcd03
3 changed files with 75 additions and 73 deletions

View file

@ -1766,6 +1766,7 @@ class Container(DockerBaseClass):
hostname=config.get('Hostname'),
user=config.get('User'),
detach=detach,
init=host_config.get('Init'),
interactive=config.get('OpenStdin'),
capabilities=host_config.get('CapAdd'),
cap_drop=host_config.get('CapDrop'),
@ -1793,8 +1794,7 @@ class Container(DockerBaseClass):
read_only=host_config.get('ReadonlyRootfs'),
restart_policy=restart_policy.get('Name'),
runtime=host_config.get('Runtime'),
# Cannot test shm_size, as shm_size is not included in container inspection results.
# shm_size=host_config.get('ShmSize'),
shm_size=host_config.get('ShmSize'),
security_opts=host_config.get("SecurityOpt"),
stop_signal=config.get("StopSignal"),
tmpfs=host_config.get('Tmpfs'),