From 3dff7aa96a2ede92631828a54aae0f26a71f9efc Mon Sep 17 00:00:00 2001 From: Sverre Boschman Date: Wed, 17 Feb 2016 08:52:38 +0100 Subject: [PATCH] Testcase start container with hostconfig Signed-off-by: Sverre Boschman --- test/integration/api/start.bats | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/integration/api/start.bats b/test/integration/api/start.bats index 4f46ad2737..e432190b86 100644 --- a/test/integration/api/start.bats +++ b/test/integration/api/start.bats @@ -25,3 +25,26 @@ function teardown() { # Verify [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] } + +@test "docker start with hostConfig" { + start_docker_with_busybox 2 + swarm_manage + # create + docker_swarm create --name test_container busybox sleep 1000 + + # make sure created container exists + # new created container has no status + run docker_swarm ps -l + [ "${#lines[@]}" -eq 2 ] + [[ "${lines[1]}" == *"test_container"* ]] + + # start + curl -s -H "Content-Type: application/json" -X POST -d '{"PublishAllPorts": true}' ${SWARM_HOSTS[0]}/v1.23/containers/test_container/start + + # Verify + [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] + + # Inspect HostConfig of container, should have PublishAllPorts set to true + run docker_swarm inspect test_container + [[ "${output}" == *'"PublishAllPorts": true'* ]] +}