diff --git a/test/integration/compose/up.bats b/test/integration/compose/up.bats index 4d80e80a0a..57ac5afa66 100644 --- a/test/integration/compose/up.bats +++ b/test/integration/compose/up.bats @@ -85,11 +85,12 @@ function containerRunning() { docker-compose_swarm -f $FILE up -d run docker_swarm ps -q - [ "${#lines[@]}" -eq 2 ] + [ "${#lines[@]}" -eq 3 ] # Make sure containers are running where they should. containerRunning "compose_service1_1" "node-0" containerRunning "compose_service2_1" "node-0" + containerRunning "compose_service3_1" "node-0" # Get service1 swarm id swarm_id=$(docker_swarm inspect -f '{{ index .Config.Labels "com.docker.swarm.id" }}' compose_service1_1) @@ -111,10 +112,14 @@ function containerRunning() { [ "$status" -eq 0 ] [[ "${output}" == *'"Name": "node-1"'* ]] - # service_2 should still be on node-0 since the rescheduling policy was off. run docker_swarm inspect compose_service2_1 + [ "$status" -eq 0 ] + [[ "${output}" == *'"Name": "node-1"'* ]] + + # service_3 should still be on node-0 since the rescheduling policy was off. + run docker_swarm inspect compose_service3_1 [ "$status" -eq 1 ] run docker_swarm ps -q - [ "${#lines[@]}" -eq 1 ] + [ "${#lines[@]}" -eq 2 ] } diff --git a/test/integration/testdata/compose/reschedule.yml b/test/integration/testdata/compose/reschedule.yml index 0e60203c0b..a1091c1730 100644 --- a/test/integration/testdata/compose/reschedule.yml +++ b/test/integration/testdata/compose/reschedule.yml @@ -8,6 +8,16 @@ service1: com.docker.swarm.reschedule-policies: '["on-node-failure"]' service2: + image: busybox + ports: + - "80" + command: sleep 100 + environment: + - reschedule:on-node-failure + labels: + com.docker.swarm.constraints: '["node==~node-0"]' + +service3: image: busybox command: sleep 100 labels: