tstest/natlab/vmtest: start migrating old natlab tests to vmtest (#19727)
Instead of having two entry points for running natlab tests, start converting the connectivity tests to use the vmtest framework. Grid and pair tests have yet to be moved over. Updates #13038 Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
@@ -446,13 +446,14 @@ func (e *Env) AddNode(name string, opts ...any) *Node {
|
||||
return n
|
||||
}
|
||||
|
||||
// LanIP returns the LAN IPv4 address of this node on the given network.
|
||||
// This is only valid after Env.Start() has been called.
|
||||
// Name returns the node's name as set in [Env.AddNode].
|
||||
// Name returns the name of the Node.
|
||||
func (n *Node) Name() string {
|
||||
return n.name
|
||||
}
|
||||
|
||||
// LanIP returns the LAN IPv4 address of this node on the given network.
|
||||
// This is only valid after Env.Start() has been called.
|
||||
// Name returns the node's name as set in [Env.AddNode].
|
||||
func (n *Node) LanIP(net *vnet.Network) netip.Addr {
|
||||
return n.vnetNode.LanIP(net)
|
||||
}
|
||||
@@ -1818,3 +1819,8 @@ func (e *Env) PingExpect(from, to *Node, wantRoute PingRoute, timeout time.Durat
|
||||
}
|
||||
return fmt.Errorf("ping route = %q, want %q (after %v)", lastRoute, wantRoute, timeout)
|
||||
}
|
||||
|
||||
// NumNodes returns the current number of nodes configured in the env.
|
||||
func (env *Env) NumNodes() int {
|
||||
return len(env.nodes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user