ooni-probe-cli/internal/engine/sessionresolver/integration_test.go
Simone Basso 1153850aca
cleanup: doh.powerdns.org is not working anymore (#924)
While there, `.../internal/sessionresolver` => `.../sessionresolver`

See https://github.com/ooni/probe/issues/2255
2022-09-02 14:44:23 +02:00

33 lines
693 B
Go

package sessionresolver_test
import (
"context"
"testing"
"github.com/ooni/probe-cli/v3/internal/engine/sessionresolver"
"github.com/ooni/probe-cli/v3/internal/kvstore"
)
func TestSessionResolverGood(t *testing.T) {
if testing.Short() {
t.Skip("skip test in short mode")
}
reso := &sessionresolver.Resolver{
KVStore: &kvstore.Memory{},
}
defer reso.CloseIdleConnections()
if reso.Network() != "sessionresolver" {
t.Fatal("unexpected Network")
}
if reso.Address() != "" {
t.Fatal("unexpected Address")
}
addrs, err := reso.LookupHost(context.Background(), "google.com")
if err != nil {
t.Fatal(err)
}
if len(addrs) < 1 {
t.Fatal("expected some addrs here")
}
}