mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-05 17:37:03 +00:00
test: Replace dnsmasq with minidns
This commit replaces test/t-14-tls_tracking usage of dnsmasq (an external test dependency) with our new minidns.
This commit is contained in:
@@ -25,8 +25,7 @@ RUN apt-get install -y -q python3 msmtp
|
||||
# Install the optional packages for the integration tests.
|
||||
RUN apt-get install -y -q \
|
||||
gettext-base dovecot-imapd \
|
||||
exim4-daemon-light \
|
||||
dnsmasq
|
||||
exim4-daemon-light
|
||||
|
||||
# Prepare exim.
|
||||
RUN mkdir -p test/t-02-exim/.exim4 \
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# Configuration for dnsmasq, for testing purposes.
|
||||
|
||||
interface=lo
|
||||
port=9053
|
||||
no-resolv
|
||||
no-poll
|
||||
no-hosts
|
||||
|
||||
log-queries
|
||||
|
||||
# Note we need both ipv4 and ipv6 A record because some test environments may
|
||||
# not support one or the other.
|
||||
|
||||
# srv-a zone
|
||||
address=/srv-a/::1
|
||||
address=/srv-a/127.0.0.1
|
||||
mx-host=srv-a,srv-a,10
|
||||
txt-record=srv-a,"v=spf1 a"
|
||||
|
||||
# srv-b zone
|
||||
address=/srv-b/::1
|
||||
address=/srv-b/127.0.0.1
|
||||
mx-host=srv-b,srv-b,10
|
||||
txt-record=srv-b,"v=spf1 a"
|
||||
@@ -7,11 +7,6 @@ set -e
|
||||
|
||||
init
|
||||
|
||||
if ! dnsmasq --version > /dev/null; then
|
||||
skip "dnsmasq binary is not functional"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# To fake SPF we need to override the resolver, which is only supported in Go
|
||||
# >= 1.8, so this test depends on that version.
|
||||
# TODO: remove this once we only support go >= 1.8.
|
||||
@@ -25,11 +20,8 @@ fi
|
||||
# Build with the DNS override, so we can fake DNS records.
|
||||
export GOTAGS="dnsoverride"
|
||||
|
||||
# Launch dnsmasq in the background using our configuration.
|
||||
# We run with -d as it takes care of a lot of options (log file, pid file,
|
||||
# etc.) for our use case.
|
||||
# It listens on localhost:9053 as configuration.
|
||||
dnsmasq --conf-file=dnsmasq.conf -d >> .dnsmasq.log 2>&1 &
|
||||
# Launch minidns in the background using our configuration.
|
||||
minidns --addr=":9053" -zones=zones >> .minidns.log 2>&1 &
|
||||
|
||||
|
||||
# Two chasquid servers:
|
||||
|
||||
11
test/t-14-tls_tracking/zones
Normal file
11
test/t-14-tls_tracking/zones
Normal file
@@ -0,0 +1,11 @@
|
||||
# srv-a zone
|
||||
srv-a A 127.0.0.1
|
||||
srv-a AAAA ::1
|
||||
srv-a MX srv-a
|
||||
srv-a TXT v=spf1 a
|
||||
|
||||
# srv-b zone
|
||||
srv-b A 127.0.0.1
|
||||
srv-b AAAA ::1
|
||||
srv-b MX srv-b
|
||||
srv-b TXT v=spf1 a
|
||||
Reference in New Issue
Block a user