-
Notifications
You must be signed in to change notification settings - Fork 4
/
goresolver_test.go
44 lines (38 loc) · 1.05 KB
/
goresolver_test.go
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package goresolver
import (
"testing"
)
func TestSetClientConfig(t *testing.T) {
resolver, err := NewResolver("./testdata/resolv.conf")
if resolver.dnsClientConfig == nil || err != nil {
t.Errorf("resolv.conf not found: %v", resolver.dnsClientConfig)
}
}
func TestDnsMessageInit(t *testing.T) {
msg := NewDNSMessage()
opt := msg.IsEdns0()
if opt.Do() != true {
t.Logf("DO bit not enabled")
}
}
func TestPopulateChainOfTrust(t *testing.T) {
//var Config = spew.ConfigState{
// Indent: " ",
// DisablePointerMethods: false,
// DisableCapacities: true,
// DisablePointerAddresses: true,
//}
//resolver, err := NewResolver("./testdata/resolv.conf")
//chainOfTrust, err := resolver.Populate("testnet-seed.decred.org.")
//
//if err != nil || chainOfTrust == nil {
// t.Error("Populate unexpected return value")
//}
//fmt.Printf("%#v", chainOfTrust)
//m,err:=json.Marshal(chainOfTrust)
//fmt.Printf("%s\n\n",m)
//Config.Dump(chainOfTrust)
//fmt.Printf("%v", chainOfTrust)
}
func TestValidateChainOfTrust(t *testing.T) {
}