docs/test/integration/api/pull.bats

38 lines
727 B
Bash

#!/usr/bin/env bats
load ../helpers
function teardown() {
swarm_manage_cleanup
stop_docker
}
@test "docker pull" {
start_docker 2
swarm_manage
# make sure no image exists
run docker_swarm images -q
[ "$status" -eq 0 ]
[ "${#lines[@]}" -eq 0 ]
docker_swarm pull busybox
# we should get 2 busyboxes, plus the header.
run docker_swarm images
[ "$status" -eq 0 ]
[ "${#lines[@]}" -eq 3 ]
# every line should contain "busybox" exclude the first head line
for((i=1; i<${#lines[@]}; i++)); do
[[ "${lines[i]}" == *"busybox"* ]]
done
# verify on the nodes
for host in ${HOSTS[@]}; do
run docker -H $host images
[ "$status" -eq 0 ]
[ "${#lines[@]}" -ge 2 ]
[[ "${lines[1]}" == *"busybox"* ]]
done
}