From 50671ab6f3d6ef508c209d77126b3782fe753e73 Mon Sep 17 00:00:00 2001 From: Alexandre Beslic Date: Wed, 21 Oct 2015 02:59:04 -0700 Subject: [PATCH] Integration test for regression with parallel docker run when specifying a port Signed-off-by: Alexandre Beslic --- test/integration/api/port.bats | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/integration/api/port.bats b/test/integration/api/port.bats index 0c87b30d09..b9ec45b925 100644 --- a/test/integration/api/port.bats +++ b/test/integration/api/port.bats @@ -20,3 +20,21 @@ function teardown() { [ "$status" -eq 0 ] [[ "${lines[*]}" == *"8000"* ]] } + +@test "docker port parallel" { + start_docker_with_busybox 2 + swarm_manage + + declare -a pids + for i in 1 2 3; do + # Use a non existing image to ensure that we pull at the same time + docker_swarm run -d -p 8888 alpine:edge sleep 2 & + pids[$i]=$! + done + + # Wait for jobs in the background and check their exit status + for pid in "${pids[@]}"; do + wait $pid + [ "$?" -eq 0 ] + done +}