You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
746 B
30 lines
746 B
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package magicsock
|
|
|
|
import (
|
|
"net/netip"
|
|
"testing"
|
|
|
|
"tailscale.com/disco"
|
|
"tailscale.com/types/key"
|
|
)
|
|
|
|
func TestRelayManagerInitAndIdle(t *testing.T) {
|
|
rm := relayManager{}
|
|
rm.allocateAndHandshakeAllServers(&endpoint{})
|
|
<-rm.runLoopStoppedCh
|
|
|
|
rm = relayManager{}
|
|
rm.stopWork(&endpoint{})
|
|
<-rm.runLoopStoppedCh
|
|
|
|
rm = relayManager{}
|
|
rm.handleCallMeMaybeVia(&endpoint{c: &Conn{discoPrivate: key.NewDisco()}}, &disco.CallMeMaybeVia{ServerDisco: key.NewDisco().Public()})
|
|
<-rm.runLoopStoppedCh
|
|
|
|
rm = relayManager{}
|
|
rm.handleBindUDPRelayEndpointChallenge(&disco.BindUDPRelayEndpointChallenge{}, &discoInfo{}, netip.AddrPort{}, 0)
|
|
<-rm.runLoopStoppedCh
|
|
}
|
|
|