Files
docker-docs/test/integration/api/pull.bats
Andrea Luzzardi 85464cdc7c integration: split api into individual tests
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-06 00:35:55 -07:00

39 lines
713 B
Bash

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