[management] Fix peer update test for MetricsConfig in NetbirdConfig

Update TestUpdateAccountPeers assertions: NetbirdConfig is no longer
nil in peer update responses since it now carries MetricsConfig even
when STUN/TURN config is absent.
This commit is contained in:
Zoltán Papp
2026-04-14 17:43:12 +02:00
parent 10bb6cc700
commit 02958887bc
2 changed files with 6 additions and 2 deletions

View File

@@ -224,7 +224,7 @@ func (c *ClientMetrics) UpdatePushFromMgm(ctx context.Context, enabled bool) {
if c.push == nil {
return
}
log.Infof("disabled metrics push by managmenet")
log.Infof("disabled metrics push by management")
c.stopPushLocked()
}
}

View File

@@ -1062,7 +1062,11 @@ func testUpdateAccountPeers(t *testing.T) {
for _, channel := range peerChannels {
update := <-channel
assert.Nil(t, update.Update.NetbirdConfig)
assert.NotNil(t, update.Update.NetbirdConfig)
assert.Nil(t, update.Update.NetbirdConfig.Stuns)
assert.Nil(t, update.Update.NetbirdConfig.Turns)
assert.Nil(t, update.Update.NetbirdConfig.Signal)
assert.Nil(t, update.Update.NetbirdConfig.Relay)
assert.Equal(t, tc.peers, len(update.Update.NetworkMap.RemotePeers))
assert.Equal(t, tc.peers*2, len(update.Update.NetworkMap.FirewallRules))
}