4 Commits

Author SHA1 Message Date
Alberto Bertogli
948cee1ce1 Improve bash quoting, and other similar best practices
This patch updates the shell scripts with some of the common best
practices, which should make them more resilient to unusual failures and
unexpected environments (in particular, directories with spaces).

Most of these were identified by shellcheck.
2022-11-13 11:09:19 +00:00
Alberto Bertogli
3aa7bb4555 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.
2019-10-19 13:06:26 +01:00
Alberto Bertogli
0d3bbe11c0 test: In the docker entrypoint, wait for minidns to come up
The tests might start running and attempting to do DNS resolutions
before minidns has come up, which can cause false positives and flaky
tests.

This patch makes the entrypoint wait until minidns has come up, to fix
the problem.
2019-08-04 04:55:07 +01:00
Alberto Bertogli
dd7cfaebf2 test: Use minidns in the Docker tests
The integration tests depend on having a DNS server that resolves
"localhost", which is unfortunate but currently unavoidable given
glibc's limitations ($HOSTALIASES only works on DNS-level aliases, and
does not do lookups in /etc/hosts).

Even under docker, this makes the tests depend on the DNS server, and
whether it resolves localhost or not.

In order to make the docker tests more hermetic and isolated from the
environment, this patch introduces a docker entrypoint that, within the
container, will launch minidns and override /etc/resolv.conf to use it.

This guarantees that the tests will be able to resolve localhost, and
also avoid accidental reliance on external DNS zones.
2018-11-30 10:03:48 +00:00