1
0
mirror of https://github.com/juanfont/headscale.git synced 2024-10-17 20:05:55 +02:00

Uncomment previous test and update them for no boundries

This commit is contained in:
Kristoffer Dalby 2022-02-25 10:27:27 +01:00
parent e03b3d558f
commit d9e7f37280
2 changed files with 42 additions and 43 deletions

View File

@ -1,6 +1,8 @@
package headscale
import (
"fmt"
"gopkg.in/check.v1"
"inet.af/netaddr"
"tailscale.com/tailcfg"
@ -241,20 +243,19 @@ func (s *Suite) TestDNSConfigMapResponseWithMagicDNS(c *check.C) {
)
c.Assert(dnsConfig, check.NotNil)
// TODO: Remove comment out when we have all nodes available to every node
// c.Assert(len(dnsConfig.Routes), check.Equals, 2)
c.Assert(len(dnsConfig.Routes), check.Equals, 3)
// domainRouteShared1 := fmt.Sprintf("%s.%s", namespaceShared1.Name, baseDomain)
// _, ok := dnsConfig.Routes[domainRouteShared1]
// c.Assert(ok, check.Equals, true)
//
// domainRouteShared2 := fmt.Sprintf("%s.%s", namespaceShared2.Name, baseDomain)
// _, ok = dnsConfig.Routes[domainRouteShared2]
// c.Assert(ok, check.Equals, true)
//
// domainRouteShared3 := fmt.Sprintf("%s.%s", namespaceShared3.Name, baseDomain)
// _, ok = dnsConfig.Routes[domainRouteShared3]
// c.Assert(ok, check.Equals, false)
domainRouteShared1 := fmt.Sprintf("%s.%s", namespaceShared1.Name, baseDomain)
_, ok := dnsConfig.Routes[domainRouteShared1]
c.Assert(ok, check.Equals, true)
domainRouteShared2 := fmt.Sprintf("%s.%s", namespaceShared2.Name, baseDomain)
_, ok = dnsConfig.Routes[domainRouteShared2]
c.Assert(ok, check.Equals, true)
domainRouteShared3 := fmt.Sprintf("%s.%s", namespaceShared3.Name, baseDomain)
_, ok = dnsConfig.Routes[domainRouteShared3]
c.Assert(ok, check.Equals, true)
}
func (s *Suite) TestDNSConfigMapResponseWithoutMagicDNS(c *check.C) {

View File

@ -205,35 +205,33 @@ func (s *Suite) TestGetMapResponseUserProfiles(c *check.C) {
}
app.db.Save(machine2InShared1)
// TODO: Remove comment out when we have all nodes available to every node
// peersOfMachine1InShared1, err := app.getPeers(machineInShared1)
// c.Assert(err, check.IsNil)
peersOfMachine1InShared1, err := app.getPeers(machineInShared1)
c.Assert(err, check.IsNil)
// userProfiles := getMapResponseUserProfiles(
// *machineInShared1,
// peersOfMachine1InShared1,
// )
//
// log.Trace().Msgf("userProfiles %#v", userProfiles)
// c.Assert(len(userProfiles), check.Equals, 2)
//
// found := false
// for _, userProfiles := range userProfiles {
// if userProfiles.DisplayName == namespaceShared1.Name {
// found = true
//
// break
// }
// }
// c.Assert(found, check.Equals, true)
//
// found = false
// for _, userProfile := range userProfiles {
// if userProfile.DisplayName == namespaceShared2.Name {
// found = true
//
// break
// }
// }
// c.Assert(found, check.Equals, true)
userProfiles := getMapResponseUserProfiles(
*machineInShared1,
peersOfMachine1InShared1,
)
c.Assert(len(userProfiles), check.Equals, 3)
found := false
for _, userProfiles := range userProfiles {
if userProfiles.DisplayName == namespaceShared1.Name {
found = true
break
}
}
c.Assert(found, check.Equals, true)
found = false
for _, userProfile := range userProfiles {
if userProfile.DisplayName == namespaceShared2.Name {
found = true
break
}
}
c.Assert(found, check.Equals, true)
}