mirror of https://github.com/docker/docs.git
bug fix
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
This commit is contained in:
parent
9ab51c796d
commit
33dc4455eb
|
@ -141,10 +141,15 @@ function teardown() {
|
|||
swarm_manage
|
||||
|
||||
# no image exist
|
||||
run docker_swarm images
|
||||
run docker_swarm images -q
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -eq 1 ]
|
||||
[[ "${lines[0]}" == *"REPOSITORY"* ]]
|
||||
[ "${#lines[@]}" -eq 0 ]
|
||||
# make sure every node has no image
|
||||
for((i=0; i<3; i++)); do
|
||||
run docker_swarm images --filter node=node-$i -q
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -eq 0 ]
|
||||
done
|
||||
|
||||
# pull image
|
||||
run docker_swarm pull busybox
|
||||
|
@ -161,38 +166,9 @@ function teardown() {
|
|||
for((i=1; i<${#lines[@]}; i++)); do
|
||||
[[ "${lines[i]}" == *"busybox"* ]]
|
||||
done
|
||||
}
|
||||
|
||||
@test "docker images --filter node=<Node name>" {
|
||||
start_docker 3
|
||||
swarm_manage
|
||||
|
||||
# no image exist
|
||||
run docker_swarm images
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -eq 1 ]
|
||||
[[ "${lines[0]}" == *"REPOSITORY"* ]]
|
||||
|
||||
# make sure every node has no image
|
||||
for((i=0;i<3;i++)); do
|
||||
run docker_swarm images --filter node=node-$i
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -eq 1 ]
|
||||
[[ "${lines[0]}" == *"REPOSITORY"* ]]
|
||||
done
|
||||
|
||||
# pull image
|
||||
run docker_swarm pull busybox
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
# make sure images have pulled
|
||||
run docker_swarm images
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -ge 4 ]
|
||||
[[ "${lines[1]}" == *"busybox"* ]]
|
||||
|
||||
|
||||
# verify
|
||||
for((i=0; i<3; i++)); do
|
||||
for((i=0; i<3; i++)); do
|
||||
run docker_swarm images --filter node=node-$i
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -ge 2 ]
|
||||
|
@ -347,12 +323,6 @@ function teardown() {
|
|||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -eq 0 ]
|
||||
|
||||
for host in ${HOSTS[@]}; do
|
||||
run docker -H $host images -q
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -eq 0 ]
|
||||
done
|
||||
|
||||
run docker_swarm pull busybox
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
|
@ -581,18 +551,17 @@ function teardown() {
|
|||
run docker_swarm images
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -ge 2 ]
|
||||
[[ "${lines[*]}" == *"busybox"* ]]
|
||||
[[ "${lines[*]}" != *"tag_busybox"* ]]
|
||||
[[ "${output}" == *"busybox"* ]]
|
||||
[[ "${output}" != *"tag_busybox"* ]]
|
||||
|
||||
# tag image
|
||||
run docker_swarm tag busybox tag_busybox:test
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
# verify
|
||||
run docker_swarm images
|
||||
run docker_swarm images tag_busybox
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -ge 2 ]
|
||||
[[ "${lines[*]}" == *"tag_busybox"* ]]
|
||||
[[ "${output}" == *"tag_busybox"* ]]
|
||||
}
|
||||
|
||||
@test "docker top" {
|
||||
|
|
Loading…
Reference in New Issue