1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
package dns_test
import (
"context"
"testing"
"time"
. "v2ray.com/core/app/dns"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
)
func TestLocalNameServer(t *testing.T) {
t.Skip() // fails on git-pbuilder and debomatic
s := NewLocalNameServer()
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
ips, err := s.QueryIP(ctx, "google.com", net.IP{}, IPOption{
IPv4Enable: true,
IPv6Enable: true,
})
cancel()
common.Must(err)
if len(ips) == 0 {
t.Error("expect some ips, but got 0")
}
}
|