mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-25 21:55:52 -05:00
integration-test: use tailscale ip to test dual-stack MagicDNS
This commit is contained in:
parent
beb3e9abc2
commit
e2f8c69e2e
@ -719,7 +719,7 @@ func (s *IntegrationTestSuite) TestPingAllPeersByHostname() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf(
|
fmt.Printf(
|
||||||
"Pinging using Hostname from %s to %s\n",
|
"Pinging using hostname from %s to %s\n",
|
||||||
hostname,
|
hostname,
|
||||||
peername,
|
peername,
|
||||||
)
|
)
|
||||||
@ -737,11 +737,7 @@ func (s *IntegrationTestSuite) TestPingAllPeersByHostname() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO:
|
func (s *IntegrationTestSuite) TestMagicDNS() {
|
||||||
// * With manual testing, MagicDNS does not respond to AAAA queries. Why?
|
|
||||||
// * Tailscaled only adds a route to the IPv4 (100.100.100.100) address of the MagicDNS service,
|
|
||||||
// event though there is an IPv6 one (fd7a:115c:a1e0::53) as well.
|
|
||||||
func (s *IntegrationTestSuite) TestMagicDNSv4() {
|
|
||||||
for namespace, scales := range s.namespaces {
|
for namespace, scales := range s.namespaces {
|
||||||
ips, err := getIPs(scales.tailscales)
|
ips, err := getIPs(scales.tailscales)
|
||||||
assert.Nil(s.T(), err)
|
assert.Nil(s.T(), err)
|
||||||
@ -750,15 +746,14 @@ func (s *IntegrationTestSuite) TestMagicDNSv4() {
|
|||||||
if peername == hostname {
|
if peername == hostname {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
s.T().Run(fmt.Sprintf("%s-%s-ipv4", hostname, peername), func(t *testing.T) {
|
s.T().Run(fmt.Sprintf("%s-%s", hostname, peername), func(t *testing.T) {
|
||||||
command := []string{
|
command := []string{
|
||||||
"host", "-4", "-t", "A",
|
"tailscale", "ip",
|
||||||
fmt.Sprintf("%s.%s.headscale.net", peername, namespace),
|
fmt.Sprintf("%s.%s.headscale.net", peername, namespace),
|
||||||
"100.100.100.100",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf(
|
fmt.Printf(
|
||||||
"Resolving name %s (IPv4) from %s over IPv4\n",
|
"Resolving name %s from %s\n",
|
||||||
peername,
|
peername,
|
||||||
hostname,
|
hostname,
|
||||||
)
|
)
|
||||||
@ -770,14 +765,9 @@ func (s *IntegrationTestSuite) TestMagicDNSv4() {
|
|||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
fmt.Printf("Result for %s: %s\n", hostname, result)
|
fmt.Printf("Result for %s: %s\n", hostname, result)
|
||||||
|
|
||||||
resolved := false
|
|
||||||
for _, ip := range ips {
|
for _, ip := range ips {
|
||||||
if strings.Contains(result, fmt.Sprintf("has address %s", ip.String())) {
|
assert.Contains(t, result, ip.String())
|
||||||
resolved = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
assert.Equal(t, true, resolved)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user