tstest/integration/vms: test DNS configuration

This uses a neat little tool to dump the output of DNS queries to
standard out. This is the first end-to-end test of DNS that runs against
actual linux systems. The /etc/resolv.conf test may look superflous,
however this will help for correlating system state if one of the DNS
tests fails.

Signed-off-by: Christine Dodrill <xe@tailscale.com>
This commit is contained in:
Christine Dodrill
2021-07-21 10:27:50 -04:00
committed by David Crawshaw
parent 00b3c1c042
commit 0b9e938152
4 changed files with 113 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ type Server struct {
DERPMap *tailcfg.DERPMap // nil means to use prod DERP map
RequireAuth bool
Verbose bool
DNSConfig *tailcfg.DNSConfig // nil means no DNS config
// ExplicitBaseURL or HTTPTestServer must be set.
ExplicitBaseURL string // e.g. "http://127.0.0.1:1234" with no trailing URL
@@ -453,6 +454,7 @@ func (s *Server) serveRegister(w http.ResponseWriter, r *http.Request, mkey tail
MachineAuthorized: machineAuthorized,
Addresses: allowedIPs,
AllowedIPs: allowedIPs,
Hostinfo: *req.Hostinfo,
}
requireAuth := s.RequireAuth
if requireAuth && s.nodeKeyAuthed[req.NodeKey] {
@@ -691,6 +693,7 @@ func (s *Server) MapResponse(req *tailcfg.MapRequest) (res *tailcfg.MapResponse,
Debug: &tailcfg.Debug{
DisableUPnP: "true",
},
DNSConfig: s.DNSConfig,
}
for _, p := range s.AllNodes() {
if p.StableID != node.StableID {