Merge pull request #709 from aluzzardi/integration-fix-attach

fix attach integration test
This commit is contained in:
Alexandre Beslic 2015-05-04 15:41:12 -07:00
commit ae77390be2
1 changed files with 8 additions and 9 deletions

View File

@ -12,18 +12,17 @@ function teardown() {
swarm_manage swarm_manage
# container run in background # container run in background
run docker_swarm run -d --name test_container busybox sleep 100 run docker_swarm run -d -i --name test_container busybox sh -c "head -n 1; echo output"
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
# make sure container is up # inject input into the container
run docker_swarm ps -l attach_output=`echo input | docker_swarm attach test_container`
[ "${#lines[@]}" -eq 2 ] # unfortunately, we cannot test `attach_output` because attach is not
[[ "${lines[1]}" == *"test_container"* ]] # properly returning the output (see docker/docker#12974)
[[ "${lines[1]}" == *"Up"* ]] run docker_swarm logs test_container
# attach to running container
run docker_swarm attach test_container
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "${output}" == *"input"* ]]
[[ "${output}" == *"output"* ]]
} }
@test "docker attach through websocket" { @test "docker attach through websocket" {