tests: cleanup test directory

- add a `pkg` directory for packages
- add a `cases` directory for yml files

Signed-off-by: Dave Tucker <dt@docker.com>
This commit is contained in:
Dave Tucker
2017-04-12 11:20:11 +01:00
parent edb909567c
commit 05767273f3
25 changed files with 5 additions and 5 deletions

View File

@@ -0,0 +1,3 @@
FROM alpine:3.5
ADD . ./
ENTRYPOINT ["/bin/sh", "/poweroff.sh"]

View File

@@ -0,0 +1,29 @@
.PHONY: tag push
BASE=alpine:3.5
IMAGE=poweroff
default: push
hash: Dockerfile poweroff.sh
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
docker run --rm --entrypoint=/bin/sh $(IMAGE):build -c "cat $^ /lib/apk/db/installed | sha1sum" | sed 's/ .*//' > hash
push: hash
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \
docker push linuxkit/$(IMAGE):$(shell cat hash))
docker rmi $(IMAGE):build
rm -f hash
tag: hash
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)
docker rmi $(IMAGE):build
rm -f hash
clean:
rm -f hash
.DELETE_ON_ERROR:

6
test/pkg/poweroff/poweroff.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
TIMEOUT=${1:-30}
sleep "${TIMEOUT}"
/sbin/poweroff -f