mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
On some platforms, the gateway may not be a usable DNS. So extending the current approach to allow retrieving DNS from many sources.
22 lines
408 B
Go
22 lines
408 B
Go
package ctrld
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestUpstreamConfig_SetupBootstrapIP(t *testing.T) {
|
|
uc := &UpstreamConfig{
|
|
Name: "test",
|
|
Type: ResolverTypeDOH,
|
|
Endpoint: "https://freedns.controld.com/p2",
|
|
Timeout: 5000,
|
|
}
|
|
uc.Init()
|
|
uc.setupBootstrapIP(false)
|
|
if uc.BootstrapIP == "" {
|
|
t.Log(availableNameservers())
|
|
t.Fatal("could not bootstrap ip without bootstrap DNS")
|
|
}
|
|
t.Log(uc)
|
|
}
|