Files
docker-docs/test/integration/api/load.bats
Andrea Luzzardi c75992a3bd integration: faster. faster. faster.
- Use start_with_busybox everywhere it's possible.
- Start only what we need.
- Improved correctness of a few tests at the same time.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-06 10:51:07 -07:00

44 lines
927 B
Bash

#!/usr/bin/env bats
load ../helpers
function teardown() {
swarm_manage_cleanup
stop_docker
}
@test "docker load" {
# pull the image only if not available on the host and save it somewhere.
[ "$(docker_host images -q busybox)" ] || docker_host pull busybox
IMAGE_FILE=$(mktemp)
docker_host save -o $IMAGE_FILE busybox:latest
start_docker 2
swarm_manage
# ensure we start from a clean cluster.
run docker_swarm images -q
[ "$status" -eq 0 ]
[ "${#lines[@]}" -eq 0 ]
run docker_swarm load -i $IMAGE_FILE
[ "$status" -eq 0 ]
# and now swarm should have cought the image just loaded.
run docker_swarm images -q
[ "$status" -eq 0 ]
[ "${#lines[@]}" -ge 1 ]
# check node0
run docker -H ${HOSTS[0]} images
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"busybox"* ]]
# check node1
run docker -H ${HOSTS[1]} images
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"busybox"* ]]
rm -f $IMAGE_FILE
}