mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-12 05:37:32 +00:00
tstest/integration/nat: add sameLAN node type
To test local connections. Updates #13038 Change-Id: I575dcab31ca812edf7d04fa126772611cf89b9a7 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Maisem Ali

parent
730fec1cfd
commit
194ff6ee3d
@@ -33,6 +33,13 @@ func (c *Config) NumNodes() int {
|
||||
return len(c.nodes)
|
||||
}
|
||||
|
||||
func (c *Config) FirstNetwork() *Network {
|
||||
if len(c.networks) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.networks[0]
|
||||
}
|
||||
|
||||
// AddNode creates a new node in the world.
|
||||
//
|
||||
// The opts may be of the following types:
|
||||
@@ -145,6 +152,13 @@ type Network struct {
|
||||
err error // carried error
|
||||
}
|
||||
|
||||
func (n *Network) CanTakeMoreNodes() bool {
|
||||
if n.natType == One2OneNAT {
|
||||
return len(n.nodes) == 0
|
||||
}
|
||||
return len(n.nodes) < 150
|
||||
}
|
||||
|
||||
// NetworkService is a service that can be added to a network.
|
||||
type NetworkService string
|
||||
|
||||
|
Reference in New Issue
Block a user