DataHoarder
e258da67dd
All checks were successful
continuous-integration/drone/push Build is passing
33 lines
551 B
Go
33 lines
551 B
Go
package dns_api
|
|
|
|
import (
|
|
"net"
|
|
"testing"
|
|
)
|
|
|
|
const testZone = "example.com."
|
|
|
|
func TestRecordSign(t *testing.T) {
|
|
|
|
zone := NewZoneFromPrivateKey(testZone, DecodeTorPrivateKey(testPrivateKey))
|
|
t.Logf("zone name %s", zone.Name())
|
|
|
|
if err := zone.AddRecordA("test."+zone.Name(), net.IPv4(1, 2, 3, 4), 3600); err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
rrsigs, err := zone.Sign()
|
|
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
for _, rr := range zone.GetRRSet() {
|
|
t.Logf(" %s\n", rr.String())
|
|
}
|
|
|
|
for _, rr := range rrsigs {
|
|
t.Logf(" %s\n", rr.String())
|
|
}
|
|
}
|