refactor: spin geoipx off geolocate (#893)
A bunch of packages (including oohelperd) just need the ability to use MaxMind-like databases. They don't need the additional functionality implemented by the geolocate package. Such a package, in fact, is mostly (if not only) needed by the engine package. Therefore, move code to query MaxMind-like databases to a separate package, and avoid depending on geolocate in all the packages for which it's sufficient to use geoipx. Part of https://github.com/ooni/probe/issues/2240
This commit is contained in:
parent
1e7384d1cc
commit
110a11828b
23 changed files with 224 additions and 211 deletions
|
|
@ -23,7 +23,7 @@ func TestSTUNIPLookupCanceledContext(t *testing.T) {
|
|||
if !errors.Is(err, context.Canceled) {
|
||||
t.Fatalf("not the error we expected: %+v", err)
|
||||
}
|
||||
if ip != DefaultProbeIP {
|
||||
if ip != model.DefaultProbeIP {
|
||||
t.Fatalf("not the IP address we expected: %+v", ip)
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ func TestSTUNIPLookupDialFailure(t *testing.T) {
|
|||
if !errors.Is(err, expected) {
|
||||
t.Fatalf("not the error we expected: %+v", err)
|
||||
}
|
||||
if ip != DefaultProbeIP {
|
||||
if ip != model.DefaultProbeIP {
|
||||
t.Fatalf("not the IP address we expected: %+v", ip)
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +79,7 @@ func TestSTUNIPLookupStartReturnsError(t *testing.T) {
|
|||
if !errors.Is(err, expected) {
|
||||
t.Fatalf("not the error we expected: %+v", err)
|
||||
}
|
||||
if ip != DefaultProbeIP {
|
||||
if ip != model.DefaultProbeIP {
|
||||
t.Fatalf("not the IP address we expected: %+v", ip)
|
||||
}
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ func TestSTUNIPLookupStunEventContainsError(t *testing.T) {
|
|||
if !errors.Is(err, expected) {
|
||||
t.Fatalf("not the error we expected: %+v", err)
|
||||
}
|
||||
if ip != DefaultProbeIP {
|
||||
if ip != model.DefaultProbeIP {
|
||||
t.Fatalf("not the IP address we expected: %+v", ip)
|
||||
}
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ func TestSTUNIPLookupCannotDecodeMessage(t *testing.T) {
|
|||
if !errors.Is(err, stun.ErrAttributeNotFound) {
|
||||
t.Fatalf("not the error we expected: %+v", err)
|
||||
}
|
||||
if ip != DefaultProbeIP {
|
||||
if ip != model.DefaultProbeIP {
|
||||
t.Fatalf("not the IP address we expected: %+v", ip)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue