mirror of https://github.com/docker/docs.git
integration: minor cleanup of docker save multi-images
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
9e2863ec71
commit
d88105dbfe
|
@ -45,7 +45,6 @@ function teardown() {
|
||||||
|
|
||||||
@test "docker save multi-images" {
|
@test "docker save multi-images" {
|
||||||
start_docker_with_busybox 2
|
start_docker_with_busybox 2
|
||||||
start_docker 1
|
|
||||||
# tag busybox
|
# tag busybox
|
||||||
docker -H ${HOSTS[0]} tag busybox test1
|
docker -H ${HOSTS[0]} tag busybox test1
|
||||||
docker -H ${HOSTS[1]} tag busybox test2
|
docker -H ${HOSTS[1]} tag busybox test2
|
||||||
|
@ -60,15 +59,15 @@ function teardown() {
|
||||||
[[ "${output}" == *"test1"* ]]
|
[[ "${output}" == *"test1"* ]]
|
||||||
[[ "${output}" == *"test2"* ]]
|
[[ "${output}" == *"test2"* ]]
|
||||||
|
|
||||||
temp_file_name=$(mktemp)
|
local temp_file_name=$(mktemp)
|
||||||
|
|
||||||
# do not support save images which are on multi machine
|
# do not support save images which are on multi machine
|
||||||
run docker_swarm save busybox test1 test2 > $temp_file_name
|
run docker_swarm save -o "$temp_file_name" busybox test1 test2
|
||||||
[ "$status" -ne 0 ]
|
[ "$status" -ne 0 ]
|
||||||
[[ "${output}" == *"Not found an engine which has all images"* ]]
|
[[ "${output}" == *"Unable to find an engine containing all images"* ]]
|
||||||
|
|
||||||
# save images which are on same machine
|
# save images which are on same machine
|
||||||
docker_swarm save busybox test1 > $temp_file_name
|
docker_swarm save -o "$temp_file_name" busybox test1
|
||||||
|
|
||||||
# saved image file exists, not empty and is tar file
|
# saved image file exists, not empty and is tar file
|
||||||
[ -s $temp_file_name ]
|
[ -s $temp_file_name ]
|
||||||
|
@ -76,9 +75,12 @@ function teardown() {
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" == *"tar archive"* ]]
|
[[ "${output}" == *"tar archive"* ]]
|
||||||
|
|
||||||
# load image on node-3
|
# Try to load our image back on an empty docker engine.
|
||||||
docker -H ${HOSTS[2]} load < $temp_file_name
|
start_docker 1
|
||||||
# check image
|
run docker -H "${HOSTS[2]}" images -q
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[ "${#lines[@]}" -eq 0 ]
|
||||||
|
docker -H "${HOSTS[2]}" load -i "$temp_file_name"
|
||||||
run docker -H ${HOSTS[2]} images
|
run docker -H ${HOSTS[2]} images
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" == *"busybox"* ]]
|
[[ "${output}" == *"busybox"* ]]
|
||||||
|
|
Loading…
Reference in New Issue