mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-14 19:00:50 +01:00
Fix test
This commit is contained in:
parent
a4ba8bd3b8
commit
c42f7628d7
@ -419,7 +419,11 @@ func startManagement(t *testing.T, config *Config) (*grpc.Server, string, error)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
turnManager := NewTimeBasedAuthSecretsManager(peersUpdateManager, config.TURNConfig, "")
|
|
||||||
|
rc := &RelayConfig{
|
||||||
|
Address: "localhost:0",
|
||||||
|
}
|
||||||
|
turnManager := NewTimeBasedAuthSecretsManager(peersUpdateManager, config.TURNConfig, rc)
|
||||||
|
|
||||||
ephemeralMgr := NewEphemeralManager(store, accountManager)
|
ephemeralMgr := NewEphemeralManager(store, accountManager)
|
||||||
mgmtServer, err := NewServer(context.Background(), config, accountManager, peersUpdateManager, turnManager, nil, ephemeralMgr)
|
mgmtServer, err := NewServer(context.Background(), config, accountManager, peersUpdateManager, turnManager, nil, ephemeralMgr)
|
||||||
|
@ -546,7 +546,11 @@ func startServer(config *server.Config) (*grpc.Server, net.Listener) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed creating a manager: %v", err)
|
log.Fatalf("failed creating a manager: %v", err)
|
||||||
}
|
}
|
||||||
turnManager := server.NewTimeBasedAuthSecretsManager(peersUpdateManager, config.TURNConfig, "")
|
|
||||||
|
rc := &server.RelayConfig{
|
||||||
|
Address: "localhost:0",
|
||||||
|
}
|
||||||
|
turnManager := server.NewTimeBasedAuthSecretsManager(peersUpdateManager, config.TURNConfig, rc)
|
||||||
mgmtServer, err := server.NewServer(context.Background(), config, accountManager, peersUpdateManager, turnManager, nil, nil)
|
mgmtServer, err := server.NewServer(context.Background(), config, accountManager, peersUpdateManager, turnManager, nil, nil)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
mgmtProto.RegisterManagementServiceServer(s, mgmtServer)
|
mgmtProto.RegisterManagementServiceServer(s, mgmtServer)
|
||||||
|
@ -23,11 +23,14 @@ func TestTimeBasedAuthSecretsManager_GenerateCredentials(t *testing.T) {
|
|||||||
secret := "some_secret"
|
secret := "some_secret"
|
||||||
peersManager := NewPeersUpdateManager(nil)
|
peersManager := NewPeersUpdateManager(nil)
|
||||||
|
|
||||||
|
rc := &RelayConfig{
|
||||||
|
Address: "localhost:0",
|
||||||
|
}
|
||||||
tested := NewTimeBasedAuthSecretsManager(peersManager, &TURNConfig{
|
tested := NewTimeBasedAuthSecretsManager(peersManager, &TURNConfig{
|
||||||
CredentialsTTL: ttl,
|
CredentialsTTL: ttl,
|
||||||
Secret: secret,
|
Secret: secret,
|
||||||
Turns: []*Host{TurnTestHost},
|
Turns: []*Host{TurnTestHost},
|
||||||
}, "")
|
}, rc)
|
||||||
|
|
||||||
credentials, _ := tested.Generate()
|
credentials, _ := tested.Generate()
|
||||||
|
|
||||||
@ -49,11 +52,14 @@ func TestTimeBasedAuthSecretsManager_SetupRefresh(t *testing.T) {
|
|||||||
peer := "some_peer"
|
peer := "some_peer"
|
||||||
updateChannel := peersManager.CreateChannel(context.Background(), peer)
|
updateChannel := peersManager.CreateChannel(context.Background(), peer)
|
||||||
|
|
||||||
|
rc := &RelayConfig{
|
||||||
|
Address: "localhost:0",
|
||||||
|
}
|
||||||
tested := NewTimeBasedAuthSecretsManager(peersManager, &TURNConfig{
|
tested := NewTimeBasedAuthSecretsManager(peersManager, &TURNConfig{
|
||||||
CredentialsTTL: ttl,
|
CredentialsTTL: ttl,
|
||||||
Secret: secret,
|
Secret: secret,
|
||||||
Turns: []*Host{TurnTestHost},
|
Turns: []*Host{TurnTestHost},
|
||||||
}, "")
|
}, rc)
|
||||||
|
|
||||||
tested.SetupRefresh(context.Background(), peer)
|
tested.SetupRefresh(context.Background(), peer)
|
||||||
|
|
||||||
@ -97,11 +103,14 @@ func TestTimeBasedAuthSecretsManager_CancelRefresh(t *testing.T) {
|
|||||||
peersManager := NewPeersUpdateManager(nil)
|
peersManager := NewPeersUpdateManager(nil)
|
||||||
peer := "some_peer"
|
peer := "some_peer"
|
||||||
|
|
||||||
|
rc := &RelayConfig{
|
||||||
|
Address: "localhost:0",
|
||||||
|
}
|
||||||
tested := NewTimeBasedAuthSecretsManager(peersManager, &TURNConfig{
|
tested := NewTimeBasedAuthSecretsManager(peersManager, &TURNConfig{
|
||||||
CredentialsTTL: ttl,
|
CredentialsTTL: ttl,
|
||||||
Secret: secret,
|
Secret: secret,
|
||||||
Turns: []*Host{TurnTestHost},
|
Turns: []*Host{TurnTestHost},
|
||||||
}, "")
|
}, rc)
|
||||||
|
|
||||||
tested.SetupRefresh(context.Background(), peer)
|
tested.SetupRefresh(context.Background(), peer)
|
||||||
if _, ok := tested.cancelMap[peer]; !ok {
|
if _, ok := tested.cancelMap[peer]; !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user