wip: migrate to mono-repo. SPN has already been moved to spn/

This commit is contained in:
Patrick Pacher
2024-03-15 11:55:13 +01:00
parent b30fd00ccf
commit 8579430db9
577 changed files with 35981 additions and 818 deletions

View File

@@ -0,0 +1,46 @@
package resolver
import (
"testing"
"github.com/miekg/dns"
)
func TestCaching(t *testing.T) {
t.Parallel()
testDomain := "Mk35mMqOWEHXSMk11MYcbjLOjTE8PQvDiAVUxf4BvwtgR.example.com."
testQuestion := "A"
testNameRecord := &NameRecord{
Domain: testDomain,
Question: testQuestion,
Resolver: &ResolverInfo{
Type: "dns",
},
}
err := testNameRecord.Save()
if err != nil {
t.Fatal(err)
}
rrCache, err := GetRRCache(testDomain, dns.Type(dns.TypeA))
if err != nil {
t.Fatal(err)
}
err = rrCache.Save()
if err != nil {
t.Fatal(err)
}
rrCache2, err := GetRRCache(testDomain, dns.Type(dns.TypeA))
if err != nil {
t.Fatal(err)
}
if rrCache2.Domain != rrCache.Domain {
t.Fatal("something very is wrong")
}
}