Add TLS resolver connection reusing and pooling
Also, fix caching issues and add more tests
This commit is contained in:
27
resolver/namerecord_test.go
Normal file
27
resolver/namerecord_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package resolver
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNameRecordStorage(t *testing.T) {
|
||||
testDomain := "Mk35mMqOWEHXSMk11MYcbjLOjTE8PQvDiAVUxf4BvwtgR.example.com."
|
||||
testQuestion := "A"
|
||||
|
||||
testNameRecord := &NameRecord{
|
||||
Domain: testDomain,
|
||||
Question: testQuestion,
|
||||
}
|
||||
|
||||
err := testNameRecord.Save()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
r, err := GetNameRecord(testDomain, testQuestion)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if r.Domain != testDomain || r.Question != testQuestion {
|
||||
t.Fatal("mismatch")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user