mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 13:35:23 +00:00
Uncomment previous test and update them for no boundries
This commit is contained in:
parent
e03b3d558f
commit
d9e7f37280
27
dns_test.go
27
dns_test.go
@ -1,6 +1,8 @@
|
|||||||
package headscale
|
package headscale
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"gopkg.in/check.v1"
|
"gopkg.in/check.v1"
|
||||||
"inet.af/netaddr"
|
"inet.af/netaddr"
|
||||||
"tailscale.com/tailcfg"
|
"tailscale.com/tailcfg"
|
||||||
@ -241,20 +243,19 @@ func (s *Suite) TestDNSConfigMapResponseWithMagicDNS(c *check.C) {
|
|||||||
)
|
)
|
||||||
c.Assert(dnsConfig, check.NotNil)
|
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, 3)
|
||||||
// c.Assert(len(dnsConfig.Routes), check.Equals, 2)
|
|
||||||
|
|
||||||
// domainRouteShared1 := fmt.Sprintf("%s.%s", namespaceShared1.Name, baseDomain)
|
domainRouteShared1 := fmt.Sprintf("%s.%s", namespaceShared1.Name, baseDomain)
|
||||||
// _, ok := dnsConfig.Routes[domainRouteShared1]
|
_, ok := dnsConfig.Routes[domainRouteShared1]
|
||||||
// c.Assert(ok, check.Equals, true)
|
c.Assert(ok, check.Equals, true)
|
||||||
//
|
|
||||||
// domainRouteShared2 := fmt.Sprintf("%s.%s", namespaceShared2.Name, baseDomain)
|
domainRouteShared2 := fmt.Sprintf("%s.%s", namespaceShared2.Name, baseDomain)
|
||||||
// _, ok = dnsConfig.Routes[domainRouteShared2]
|
_, ok = dnsConfig.Routes[domainRouteShared2]
|
||||||
// c.Assert(ok, check.Equals, true)
|
c.Assert(ok, check.Equals, true)
|
||||||
//
|
|
||||||
// domainRouteShared3 := fmt.Sprintf("%s.%s", namespaceShared3.Name, baseDomain)
|
domainRouteShared3 := fmt.Sprintf("%s.%s", namespaceShared3.Name, baseDomain)
|
||||||
// _, ok = dnsConfig.Routes[domainRouteShared3]
|
_, ok = dnsConfig.Routes[domainRouteShared3]
|
||||||
// c.Assert(ok, check.Equals, false)
|
c.Assert(ok, check.Equals, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestDNSConfigMapResponseWithoutMagicDNS(c *check.C) {
|
func (s *Suite) TestDNSConfigMapResponseWithoutMagicDNS(c *check.C) {
|
||||||
|
@ -205,35 +205,33 @@ func (s *Suite) TestGetMapResponseUserProfiles(c *check.C) {
|
|||||||
}
|
}
|
||||||
app.db.Save(machine2InShared1)
|
app.db.Save(machine2InShared1)
|
||||||
|
|
||||||
// TODO: Remove comment out when we have all nodes available to every node
|
peersOfMachine1InShared1, err := app.getPeers(machineInShared1)
|
||||||
// peersOfMachine1InShared1, err := app.getPeers(machineInShared1)
|
c.Assert(err, check.IsNil)
|
||||||
// c.Assert(err, check.IsNil)
|
|
||||||
|
|
||||||
// userProfiles := getMapResponseUserProfiles(
|
userProfiles := getMapResponseUserProfiles(
|
||||||
// *machineInShared1,
|
*machineInShared1,
|
||||||
// peersOfMachine1InShared1,
|
peersOfMachine1InShared1,
|
||||||
// )
|
)
|
||||||
//
|
|
||||||
// log.Trace().Msgf("userProfiles %#v", userProfiles)
|
c.Assert(len(userProfiles), check.Equals, 3)
|
||||||
// c.Assert(len(userProfiles), check.Equals, 2)
|
|
||||||
//
|
found := false
|
||||||
// found := false
|
for _, userProfiles := range userProfiles {
|
||||||
// for _, userProfiles := range userProfiles {
|
if userProfiles.DisplayName == namespaceShared1.Name {
|
||||||
// if userProfiles.DisplayName == namespaceShared1.Name {
|
found = true
|
||||||
// found = true
|
|
||||||
//
|
break
|
||||||
// break
|
}
|
||||||
// }
|
}
|
||||||
// }
|
c.Assert(found, check.Equals, true)
|
||||||
// c.Assert(found, check.Equals, true)
|
|
||||||
//
|
found = false
|
||||||
// found = false
|
for _, userProfile := range userProfiles {
|
||||||
// for _, userProfile := range userProfiles {
|
if userProfile.DisplayName == namespaceShared2.Name {
|
||||||
// if userProfile.DisplayName == namespaceShared2.Name {
|
found = true
|
||||||
// found = true
|
|
||||||
//
|
break
|
||||||
// break
|
}
|
||||||
// }
|
}
|
||||||
// }
|
c.Assert(found, check.Equals, true)
|
||||||
// c.Assert(found, check.Equals, true)
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user