Add and use copyimg for caching images for tests

Add a basic tool for copying images from one location to another,
optionally adding a name if it's to local storage.  Ideally we could use
skopeo for this, but we don't want to build it.

Use it to initially populate the test/testdata/redis-image directory, if
it's not been cleaned out, with a copy of "docker://redis:latest", and
to copy it in to the storage that ocid is using before we start up ocid.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai 2017-01-10 17:57:22 -05:00
parent 636d5d8e9a
commit 925806b8fa
5 changed files with 227 additions and 2 deletions

View file

@ -47,6 +47,9 @@ pause:
bin2img:
make -C test/$@
copyimg:
make -C test/$@
ocid:
ifndef GOPATH
$(error GOPATH is not set)
@ -72,11 +75,13 @@ ocid.conf: ocid
clean:
rm -f docs/*.1 docs/*.5 docs/*.8
rm -fr test/testdata/redis-image
find . -name \*~ -delete
find . -name \#\* -delete
make -C conmon clean
make -C pause clean
make -C test/bin2img clean
make -C test/copyimg clean
ocidimage:
docker build -t ${OCID_IMAGE} .
@ -90,7 +95,7 @@ integration: ocidimage
localintegration: binaries
./test/test_runner.sh ${TESTFLAGS}
binaries: ocid ocic kpod conmon pause bin2img
binaries: ocid ocic kpod conmon pause bin2img copyimg
MANPAGES_MD := $(wildcard docs/*.md)
MANPAGES := $(MANPAGES_MD:%.md=%)
@ -188,6 +193,7 @@ install.tools: .install.gitvalidation .install.gometalinter .install.md2man
binaries \
clean \
conmon \
copyimg \
default \
docs \
gofmt \