mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-19 07:09:56 +00:00
Fix test
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/netip"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/pion/transport/v3/stdnet"
|
||||
@@ -454,8 +453,8 @@ func TestManagerUpdateRoutes(t *testing.T) {
|
||||
}
|
||||
require.Len(t, routeManager.clientNetworks, expectedWatchers, "client networks size should match")
|
||||
|
||||
if runtime.GOOS == "linux" && routeManager.serverRouter != nil {
|
||||
require.Len(t, routeManager.serverRouter.routes, testCase.serverRoutesExpected, "server networks size should match")
|
||||
if routeManager.serverRouter != nil {
|
||||
require.Equal(t, testCase.serverRoutesExpected, routeManager.serverRouter.RoutesCount(), "server networks size should match")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -133,6 +133,12 @@ func (r *Router) CleanUp() {
|
||||
r.statusRecorder.CleanLocalPeerStateRoutes()
|
||||
}
|
||||
|
||||
func (r *Router) RoutesCount() int {
|
||||
r.mux.Lock()
|
||||
defer r.mux.Unlock()
|
||||
return len(r.routes)
|
||||
}
|
||||
|
||||
func routeToRouterPair(route *route.Route, useNewDNSRoute bool) firewall.RouterPair {
|
||||
source := getDefaultPrefix(route.Network)
|
||||
destination := firewall.Network{}
|
||||
|
||||
Reference in New Issue
Block a user