mirror of https://github.com/docker/docs.git
added image affinity test and !=
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
77f0ac919a
commit
a2dc4b87c5
|
@ -28,7 +28,27 @@ function teardown() {
|
||||||
|
|
||||||
run docker_swarm inspect c3
|
run docker_swarm inspect c3
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" == *'"Name": "node-1"'* ]]
|
[[ "${output}" != *'"Name": "node-0"'* ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "image affinity" {
|
||||||
|
start_docker 2
|
||||||
|
swarm_manage
|
||||||
|
|
||||||
|
run docker -H ${HOSTS[0]} pull busybox
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
run docker_swarm run --name c1 -e affinity:image==busybox -d busybox:latest sh
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
run docker_swarm run --name c2 -e affinity:image!=busybox -d busybox:latest sh
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
|
run docker_swarm inspect c1
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[[ "${output}" == *'"Name": "node-0"'* ]]
|
||||||
|
|
||||||
|
run docker_swarm inspect c2
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[[ "${output}" != *'"Name": "node-0"'* ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "label affinity" {
|
@test "label affinity" {
|
||||||
|
@ -52,5 +72,5 @@ function teardown() {
|
||||||
|
|
||||||
run docker_swarm inspect c3
|
run docker_swarm inspect c3
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" == *'"Name": "node-1"'* ]]
|
[[ "${output}" != *'"Name": "node-0"'* ]]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue