Skip to content

Commit

Permalink
Use new names to resolve magic dns
Browse files Browse the repository at this point in the history
  • Loading branch information
kradalby committed May 18, 2022
1 parent 802eb93 commit 4a9d3be
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,13 @@ func (s *IntegrationTestSuite) TestMagicDNS() {
for namespace, scales := range s.namespaces {
ips, err := getIPs(scales.tailscales)
assert.Nil(s.T(), err)

hostnames, err := getDNSNames(&s.headscale)
assert.Nil(s.T(), err)

for hostname, tailscale := range scales.tailscales {
for peername, ips := range ips {
if peername == hostname {
for _, peername := range hostnames {
if strings.Contains(peername, hostname) {
continue
}
s.T().Run(fmt.Sprintf("%s-%s", hostname, peername), func(t *testing.T) {
Expand All @@ -663,7 +667,9 @@ func (s *IntegrationTestSuite) TestMagicDNS() {
assert.Nil(t, err)
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())
}
})
Expand Down

0 comments on commit 4a9d3be

Please sign in to comment.