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,22 @@
FROM alpine:3.5
RUN apk update && apk upgrade && apk add --no-cache bash curl
ADD . ./
# Also add docker
ENV DOCKER_BUCKET get.docker.com
ENV DOCKER_VERSION 17.04.0-ce
ENV DOCKER_SHA256 c52cff62c4368a978b52e3d03819054d87bcd00d15514934ce2e0e09b99dd100
# Downloads docker but only installs the client
RUN set -x \
&& curl -fSL "https://${DOCKER_BUCKET}/builds/$(uname -s)/$(uname -m)/docker-${DOCKER_VERSION}.tgz" -o docker.tgz \
&& echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - \
&& tar -xzvf docker.tgz \
&& mv docker/docker /usr/bin/ \
&& rm -rf docker \
&& rm docker.tgz \
&& docker -v
COPY . ./
ENTRYPOINT ["/bin/sh", "/bench_runner.sh"]

View File

@@ -0,0 +1,29 @@
.PHONY: tag push
BASE=alpine:3.5
IMAGE=test-docker-bench
default: push
hash: Dockerfile bench_runner.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:

View File

@@ -0,0 +1,10 @@
#!/bin/sh
echo "waiting for docker socket to be available..."
# wait for the docker runc container
while [ ! -e /var/run/docker.sock ]; do sleep 1; done
echo "found docker socket, starting docker bench..."
docker run -i --net host --pid host --cap-add audit_control -v /var/lib:/var/lib -v /var/run/docker.sock:/var/run/docker.sock --label docker_bench_security docker/docker-bench-security