mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 02:43:05 +00:00
tests: fix TestDERPVerifyEndpoint
This commit is contained in:
parent
dfebd176df
commit
b39925f576
2 changed files with 4 additions and 3 deletions
|
@ -33,10 +33,10 @@ func TestDERPVerifyEndpoint(t *testing.T) {
|
||||||
|
|
||||||
scenario, err := NewScenario(dockertestMaxWait())
|
scenario, err := NewScenario(dockertestMaxWait())
|
||||||
assertNoErr(t, err)
|
assertNoErr(t, err)
|
||||||
defer scenario.Shutdown()
|
defer scenario.ShutdownAssertNoPanics(t)
|
||||||
|
|
||||||
spec := map[string]int{
|
spec := map[string]int{
|
||||||
"user1": 10,
|
"user1": len(MustTestVersions),
|
||||||
}
|
}
|
||||||
|
|
||||||
derper, err := scenario.CreateDERPServer("head",
|
derper, err := scenario.CreateDERPServer("head",
|
||||||
|
|
|
@ -25,6 +25,7 @@ import (
|
||||||
"github.com/juanfont/headscale/integration/integrationutil"
|
"github.com/juanfont/headscale/integration/integrationutil"
|
||||||
"github.com/ory/dockertest/v3"
|
"github.com/ory/dockertest/v3"
|
||||||
"github.com/ory/dockertest/v3/docker"
|
"github.com/ory/dockertest/v3/docker"
|
||||||
|
"gopkg.in/yaml.v3"
|
||||||
"tailscale.com/tailcfg"
|
"tailscale.com/tailcfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -221,7 +222,7 @@ func WithEmbeddedDERPServerOnly() Option {
|
||||||
// DERP server only.
|
// DERP server only.
|
||||||
func WithDERPConfig(derpMap tailcfg.DERPMap) Option {
|
func WithDERPConfig(derpMap tailcfg.DERPMap) Option {
|
||||||
return func(hsic *HeadscaleInContainer) {
|
return func(hsic *HeadscaleInContainer) {
|
||||||
contents, err := json.Marshal(derpMap)
|
contents, err := yaml.Marshal(derpMap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to marshal DERP map: %s", err)
|
log.Fatalf("failed to marshal DERP map: %s", err)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue