1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-19 14:57:04 +00:00

test: Adjust Dockerfile to support modules

When modules are configured, go will now attempt to fetch them on build,
using the proxy.

That causes the integration tests run via Docker to fail, because go
build attempts to contact the proxy within the test environment, which
has the external DNS resolvers disabled.

This patch fixes the problem by adjusting the pre-run fetch to use the
new modules system. We fetch the dependencies to the cache so that when
they're needed within the environment, they are present and there's no
need to use the proxy.
This commit is contained in:
Alberto Bertogli
2019-10-18 23:04:19 +01:00
parent 80b4f7f832
commit 3aa7bb4555
2 changed files with 18 additions and 11 deletions

View File

@@ -20,8 +20,6 @@ trap - EXIT
set -v
go build -o /tmp/minidns "${UTILDIR}/minidns.go"
# The DNS server resolves only "localhost"; tests will rely on this, as we
# $HOSTALIASES to point our test hostnames to localhost, so it needs to
# resolve.
@@ -40,6 +38,10 @@ echo "nameserver ::1" >> /etc/resolv.conf
# Wait until the minidns resolver comes up.
wait_until_ready 53
# Disable the Go proxy, since now there is no external network access.
# Modules should be already be made available in the environment.
export GOPROXY=off
# Launch arguments, which come from docker CMD, as "chasquid" user.
# Running tests as root makes some integration tests more difficult, as for
# example Exim has hard-coded protections against running as root.