mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-24 02:25:24 +00:00
Use new names to resolve magic dns
This commit is contained in:
parent
802eb931d1
commit
4a9d3bedf9
@ -639,9 +639,13 @@ func (s *IntegrationTestSuite) TestMagicDNS() {
|
|||||||
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)
|
||||||
|
|
||||||
|
hostnames, err := getDNSNames(&s.headscale)
|
||||||
|
assert.Nil(s.T(), err)
|
||||||
|
|
||||||
for hostname, tailscale := range scales.tailscales {
|
for hostname, tailscale := range scales.tailscales {
|
||||||
for peername, ips := range ips {
|
for _, peername := range hostnames {
|
||||||
if peername == hostname {
|
if strings.Contains(peername, hostname) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
s.T().Run(fmt.Sprintf("%s-%s", hostname, peername), func(t *testing.T) {
|
s.T().Run(fmt.Sprintf("%s-%s", hostname, peername), func(t *testing.T) {
|
||||||
@ -663,7 +667,9 @@ func (s *IntegrationTestSuite) TestMagicDNS() {
|
|||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
log.Printf("Result for %s: %s\n", hostname, result)
|
log.Printf("Result for %s: %s\n", hostname, result)
|
||||||
|
|
||||||
for _, ip := range ips {
|
peerBaseName := peername[:len(peername)-MachineGivenNameHashLength-1]
|
||||||
|
expectedAddresses := ips[peerBaseName]
|
||||||
|
for _, ip := range expectedAddresses {
|
||||||
assert.Contains(t, result, ip.String())
|
assert.Contains(t, result, ip.String())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user