From 7faf792b9d4d58beae713ab2ebbd197d7142166e Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Fri, 13 Oct 2017 23:23:07 +0100 Subject: [PATCH] Use letsencrypt/boulder as ACME server in e2e tests --- .travis.yml | 2 ++ hack/test/setup-boulder.sh | 27 +++++++++++++++++++++++++++ test/e2e/issuer/issuer_acme.go | 2 +- test/util/util.go | 1 + 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 hack/test/setup-boulder.sh diff --git a/.travis.yml b/.travis.yml index 0e38b8abb..28b05d21e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ jobs: go: 1.8 env: - KUBERNETES_VERSION=v1.7.0 + before_script: + - ./hack/test/setup-boulder.sh script: - set -e - curl -Lo helm.tar.gz https://storage.googleapis.com/kubernetes-helm/helm-v2.6.1-linux-amd64.tar.gz && tar xvf helm.tar.gz && sudo mv linux-amd64/helm /usr/local/bin diff --git a/hack/test/setup-boulder.sh b/hack/test/setup-boulder.sh new file mode 100755 index 000000000..1f9d3b760 --- /dev/null +++ b/hack/test/setup-boulder.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail + +BOULDER_REPO="github.com/letsencrypt/boulder" + +echo "Fetching ${BOULDER_REPO}" +go get -d github.com/letsencrypt/boulder || true +echo "Retrieved boulder repository" +cd "${GOPATH}/src/${BOULDER_REPO}" + +# Modify boulder configuration +sed -i 's/FAKE_DNS: 127.0.0.1/FAKE_DNS: 10.0.0.10/' docker-compose.yml +sed -i 's/127.0.0.1:8053/10.0.0.10:53/' test/config/va.json +sed -i 's/5002/80/' test/config/va.json +# TODO: set ratelimits + +docker-compose up & + +while ! curl http://localhost:4000/ > /dev/null 2>&1 ; do + echo "Waiting for boulder API to be available..." + sleep 5 +done + +echo "Boulder API now available at http://localhost:4000/" \ No newline at end of file diff --git a/test/e2e/issuer/issuer_acme.go b/test/e2e/issuer/issuer_acme.go index cbdf1fe1e..b0038e1b9 100644 --- a/test/e2e/issuer/issuer_acme.go +++ b/test/e2e/issuer/issuer_acme.go @@ -71,7 +71,7 @@ var _ = framework.CertManagerDescribe("ACME Issuer", func() { }) }) -const testingACMEURL = "https://acme-staging.api.letsencrypt.org/directory" +const testingACMEURL = "http://127.0.0.1:4000/directory" const invalidACMEURL = "http://not-a-real-acme-url.com" const testingACMEEmail = "test@example.com" const testingACMEPrivateKey = "test-acme-private-key" diff --git a/test/util/util.go b/test/util/util.go index 96177d8d3..611777031 100644 --- a/test/util/util.go +++ b/test/util/util.go @@ -103,6 +103,7 @@ func NewCertManagerControllerPod(name string, args ...string) *v1.Pod { }, }, Spec: v1.PodSpec{ + HostNetwork: true, Containers: []v1.Container{ { Name: name,