extend setup key logic (#91)

* feature: extend setup key logic

* fix: login test

* test: change test data to support new setup key fields

* test: add setup key tests

* test: add setup key UUID format validation

* test: add AddAccount test

* test: add more AccountManager tests

* fix: golint errors

* test: increase client interface up timout
This commit is contained in:
Mikhail Bragin
2021-08-20 19:48:42 +02:00
committed by GitHub
parent 8364e03944
commit d75353fbb8
11 changed files with 428 additions and 32 deletions

View File

@@ -7,6 +7,7 @@ import (
mgmt "github.com/wiretrustee/wiretrustee/management/server"
"github.com/wiretrustee/wiretrustee/util"
"path/filepath"
"strings"
"testing"
)
@@ -38,7 +39,7 @@ func TestLogin(t *testing.T) {
"--config",
confPath,
"--setup-key",
"a2c8e62b-38f5-4553-b31e-dd66c696cebb",
strings.ToUpper("a2c8e62b-38f5-4553-b31e-dd66c696cebb"),
"--management-url",
mgmtURL,
})

View File

@@ -9,7 +9,6 @@ import (
"net/url"
"os"
"path/filepath"
"strings"
"testing"
"time"
)
@@ -71,7 +70,7 @@ func TestUp(t *testing.T) {
"--config",
confPath,
"--setup-key",
strings.ToUpper("a2c8e62b-38f5-4553-b31e-dd66c696cebb"),
"A2C8E62B-38F5-4553-B31E-DD66C696CEBB",
"--management-url",
mgmtURL.String(),
})
@@ -93,7 +92,7 @@ func TestUp(t *testing.T) {
}()
exists := false
for start := time.Now(); time.Since(start) < 7*time.Second; {
for start := time.Now(); time.Since(start) < 15*time.Second; {
e, err := iface.Exists(iface.WgInterfaceDefault)
if err != nil {
continue