Merge pull request #610 from aluzzardi/integration-fix

Integration tests fix
This commit is contained in:
Victor Vieux
2015-04-10 11:47:03 -07:00
4 changed files with 32 additions and 32 deletions

View File

@@ -63,9 +63,9 @@ load helpers
# Additional parameters can be passed to the docker daemon:
start_docker 1 --label foo=bar
# start_manager will start the swarm manager, preconfigured with all engines
# swarm_manage will start the swarm manager, preconfigured with all engines
# previously started by start_engine:
start_manager
swarm_manage
# You can talk with said manager by using the docker_swarm helper:
run docker_swarm info
@@ -76,7 +76,7 @@ load helpers
# teardown is called at the end of every test.
function teardown() {
# This will stop the swarm manager:
stop_manager
swarm_manage_cleanup
# This will stop and remove all engines launched by the test:
stop_docker

View File

@@ -3,7 +3,7 @@
load helpers
function teardown() {
stop_manager
swarm_manage_cleanup
stop_docker
}
@@ -16,35 +16,35 @@ function teardown() {
}
@test "docker ps -n 3 should return the 3 last containers, including non running one" {
start_docker 1
swarm_manage
run docker_swarm run -d busybox sleep 42
run docker_swarm run -d busybox false
run docker_swarm ps -n 3
[ "${#lines[@]}" -eq 3 ]
start_docker 1
swarm_manage
run docker_swarm run -d busybox sleep 42
run docker_swarm run -d busybox false
run docker_swarm ps -n 3
[ "${#lines[@]}" -eq 3 ]
run docker_swarm run -d busybox true
run docker_swarm ps -n 3
[ "${#lines[@]}" -eq 4 ]
run docker_swarm run -d busybox true
run docker_swarm ps -n 3
[ "${#lines[@]}" -eq 4 ]
run docker_swarm run -d busybox true
run docker_swarm ps -n 3
[ "${#lines[@]}" -eq 4 ]
run docker_swarm run -d busybox true
run docker_swarm ps -n 3
[ "${#lines[@]}" -eq 4 ]
}
@test "docker ps -l should return the last container, including non running one" {
start_docker 1
swarm_manage
run docker_swarm run -d busybox sleep 42
sleep 1 #sleep so the 2 containers don't start at the same second
run docker_swarm run -d busybox true
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"true"* ]]
start_docker 1
swarm_manage
run docker_swarm run -d busybox sleep 42
sleep 1 #sleep so the 2 containers don't start at the same second
run docker_swarm run -d busybox true
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"true"* ]]
sleep 1 #sleep so the container doesn't start at the same second as 'busybox true'
run docker_swarm run -d busybox false
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"false"* ]]
sleep 1 #sleep so the container doesn't start at the same second as 'busybox true'
run docker_swarm run -d busybox false
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"false"* ]]
}

View File

@@ -3,7 +3,7 @@
load helpers
function teardown() {
stop_manager
swarm_manage_cleanup
stop_docker
}

View File

@@ -3,13 +3,13 @@
load helpers
function teardown() {
stop_manager
swarm_manage_cleanup
stop_docker
}
@test "docker should filter port in host mode correctly" {
start_docker 2
start_manager
swarm_manage
#
# Use busybox to save image pulling time for integration test.