get e2e working with notary service

Signed-off-by: Daniel Nephin <dnephin@docker.com>
master
Daniel Nephin 2017-10-06 19:11:01 -04:00 committed by Riyaz Faizullabhoy
parent 6e3bafd06b
commit ade675d36c
5 changed files with 19 additions and 7 deletions

View File

@ -1,7 +1,7 @@
FROM golang:1.8.4-alpine
RUN apk add -U git make bash coreutils
RUN apk add -U git make bash coreutils ca-certificates
ARG VNDR_SHA=a6e196d8b4b0cbbdc29aebdb20c59ac6926bb384
RUN go get -d github.com/LK4D4/vndr && \

View File

@ -1,6 +1,6 @@
FROM docker/compose:1.15.0
RUN apk add -U bash curl ca-certificates
RUN apk add -U bash curl
ARG DOCKER_CHANNEL=edge
ARG DOCKER_VERSION=17.06.0-ce
@ -13,8 +13,5 @@ ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
WORKDIR /work
COPY scripts/test/e2e scripts/test/e2e
COPY e2e/compose-env.yaml e2e/compose-env.yaml
COPY e2e/testdata e2e/testdata
COPY e2e/testdata/notary/root-ca.cert /usr/local/share/ca-certificates/notary.cert
RUN update-ca-certificates
ENTRYPOINT ["bash", "/work/scripts/test/e2e/run"]

View File

@ -14,5 +14,8 @@ services:
ports:
- 4443:4443
volumes:
- ./testdata/notary:/fixtures
- notary-fixtures:/fixtures
command: ['notary-server', '-config=/fixtures/notary-config.json']
volumes:
notary-fixtures: {}

View File

@ -33,12 +33,14 @@ function is_swarm_enabled {
}
function cleanup {
COMPOSE_PROJECT_NAME=$1 COMPOSE_FILE=$2 docker-compose down >&2
COMPOSE_PROJECT_NAME=$1 COMPOSE_FILE=$2 docker-compose down -v >&2
}
function runtests {
local engine_host=$1
# TODO: only run if inside a container
update-ca-certificates
# shellcheck disable=SC2086
env -i \
TEST_DOCKER_HOST="$engine_host" \

View File

@ -22,13 +22,23 @@ docker build \
-t "$dev_image" \
-f dockerfiles/Dockerfile.dev .
notary_volume="${unique_id}_notary-fixtures"
docker volume create "$notary_volume"
docker run --rm \
-v "$PWD:/go/src/github.com/docker/cli" \
-v "$notary_volume:/data" \
"$dev_image" \
cp -r ./e2e/testdata/notary/* /data/
engine_host=$(run_in_env setup)
testexit=0
docker run -i --rm \
-v "$PWD:/go/src/github.com/docker/cli" \
-v "$PWD/e2e/testdata/notary/root-ca.cert:/usr/local/share/ca-certificates/notary.cert" \
--network "${unique_id}_default" \
-e TESTFLAGS \
"$dev_image" \
./scripts/test/e2e/run test "$engine_host" || testexit="$?"
run_in_env cleanup
exit "$testexit"