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:
Brad Fitzpatrick
2024-08-08 14:11:07 -07:00
committed by Maisem Ali
parent 730fec1cfd
commit 194ff6ee3d
2 changed files with 43 additions and 4 deletions

View File

@@ -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