tstest/integration/vms: add in-process DERP server (#2108)
Previously this test would reach out to the public DERP servers in order to help machines connect with eachother. This is not ideal given our plans to run these tests completely disconnected from the internet. This patch introduces an in-process DERP server running on its own randomly assigned HTTP port. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
This commit is contained in:
@@ -546,7 +546,8 @@ func TestVMIntegrationEndToEnd(t *testing.T) {
|
||||
|
||||
rex := distroRex.Unwrap()
|
||||
|
||||
ln, err := net.Listen("tcp", deriveBindhost(t)+":0")
|
||||
bindHost := deriveBindhost(t)
|
||||
ln, err := net.Listen("tcp", net.JoinHostPort(bindHost, "0"))
|
||||
if err != nil {
|
||||
t.Fatalf("can't make TCP listener: %v", err)
|
||||
}
|
||||
@@ -555,6 +556,9 @@ func TestVMIntegrationEndToEnd(t *testing.T) {
|
||||
|
||||
cs := &testcontrol.Server{}
|
||||
|
||||
derpMap := integration.RunDERPAndSTUN(t, t.Logf, bindHost)
|
||||
cs.DERPMap = derpMap
|
||||
|
||||
var (
|
||||
ipMu sync.Mutex
|
||||
ipMap = map[string]ipMapping{}
|
||||
|
||||
Reference in New Issue
Block a user