2019-06-10 01:33:19 -07:00
|
|
|
package home
|
2019-05-21 04:53:13 -07:00
|
|
|
|
2019-06-04 10:38:53 -07:00
|
|
|
import (
|
2019-10-02 06:59:34 -07:00
|
|
|
"os"
|
2019-06-04 10:38:53 -07:00
|
|
|
"testing"
|
|
|
|
)
|
2019-05-21 04:53:13 -07:00
|
|
|
|
|
|
|
func TestResolveRDNS(t *testing.T) {
|
2019-10-02 06:59:34 -07:00
|
|
|
_ = os.RemoveAll(config.getDataDir())
|
|
|
|
defer func() { _ = os.RemoveAll(config.getDataDir()) }()
|
|
|
|
|
2019-05-30 05:36:39 -07:00
|
|
|
config.DNS.BindHost = "1.1.1.1"
|
2019-10-02 06:53:23 -07:00
|
|
|
initDNSServer()
|
2019-09-18 08:44:27 -07:00
|
|
|
if r := config.dnsctx.rdns.resolve("1.1.1.1"); r != "one.one.one.one" {
|
2019-05-21 04:53:13 -07:00
|
|
|
t.Errorf("resolveRDNS(): %s", r)
|
|
|
|
}
|
|
|
|
}
|