From b59c426fb195bceeeedff670f0f939ba282b15e5 Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Mon, 5 Feb 2024 20:57:10 +0300 Subject: [PATCH] fix tests --- management/server/geolocation/geolocation_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/management/server/geolocation/geolocation_test.go b/management/server/geolocation/geolocation_test.go index 8d4c71599be..8fb8d0e2406 100644 --- a/management/server/geolocation/geolocation_test.go +++ b/management/server/geolocation/geolocation_test.go @@ -3,10 +3,12 @@ package geolocation import ( "os" "path" + "sync" "testing" - "github.com/netbirdio/netbird/util" "github.com/stretchr/testify/assert" + + "github.com/netbirdio/netbird/util" ) // from https://github.com/maxmind/MaxMind-DB/blob/main/test-data/GeoLite2-City-Test.mmdb @@ -24,8 +26,14 @@ func TestGeoLite_Lookup(t *testing.T) { } }() - geo, err := NewGeolocation(tempDir) + db, err := openDB(mmdbPath) assert.NoError(t, err) + + geo := &Geolocation{ + mux: &sync.RWMutex{}, + db: db, + stopCh: make(chan struct{}), + } assert.NotNil(t, geo) defer func() { err = geo.Stop()