Repository navigation
Commit cb0d1e7
committed
tests: resolve through the local dnsmasq cache in CI.
23ab627 added the cache but dropped the TEST_NGINX_RESOLVER export along
with it, so nothing points the tests at 127.0.0.1 any more. Every test file
carries its own default:
$ENV{TEST_NGINX_RESOLVER} ||= '8.8.8.8';
so nginx's resolver directive goes straight out to a public resolver and
the cache only ever serves the warm-up digs. Public resolvers do not answer
"localhost" -- RFC 6761 leaves that to the stub resolver -- which is why
t/014-bugs.t TEST 37 and t/058-tcp-socket.t TEST 4 fail with "Host not
found".
Export TEST_NGINX_RESOLVER=127.0.0.1 so queries go through the cache, move
dnsmasq to 127.0.0.1:53, and answer the names the resolver tests need from
--host-record, since --no-hosts keeps /etc/hosts out. Port 53 keeps the
resolver addressable as a bare IP, which t/087-udp-socket.t TEST 10 needs:
it passes $TEST_NGINX_RESOLVER to setpeername() with port 53.
systemd-resolved's stub listener owns 127.0.0.53:53 only, and
--bind-interfaces keeps dnsmasq off every other address.
TEST 37 exercises nginx's resolver against a name with a trailing dot, so
give it a multi-label name, trailing-dot.test., rather than the single
label it used before. The answer still comes from a real DNS server, just
a local one.1 parent a9abc49 commit cb0d1e7
2 files changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
887 | | - | |
| 887 | + | |
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
| |||
0 commit comments