Move tests and start update_test.go
Put the update tests in a seperate file.
This commit is contained in:
parent
eff0e9354f
commit
a8bb44f5e5
|
@ -165,7 +165,7 @@ func TestClientAXFRMultipleEnvelopes(t *testing.T) {
|
|||
}
|
||||
*/
|
||||
|
||||
// ExapleUpdateLeaseTSIG shows how to update a lease signed with TSIG.
|
||||
// ExampleUpdateLeaseTSIG shows how to update a lease signed with TSIG.
|
||||
func ExampleUpdateLeaseTSIG(t *testing.T) {
|
||||
m := new(Msg)
|
||||
m.SetUpdate("t.local.ip6.io.")
|
||||
|
|
|
@ -1225,23 +1225,6 @@ func TestMalformedPackets(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestDynamicUpdateParsing(t *testing.T) {
|
||||
prefix := "example.com. IN "
|
||||
for _, typ := range TypeToString {
|
||||
if typ == "CAA" || typ == "OPT" || typ == "AXFR" || typ == "IXFR" || typ == "ANY" || typ == "TKEY" ||
|
||||
typ == "TSIG" || typ == "ISDN" || typ == "UNSPEC" || typ == "NULL" || typ == "ATMA" {
|
||||
continue
|
||||
}
|
||||
r, e := NewRR(prefix + typ)
|
||||
if e != nil {
|
||||
t.Log("failure to parse: " + prefix + typ)
|
||||
t.Fail()
|
||||
} else {
|
||||
t.Logf("parsed: %s", r.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type algorithm struct {
|
||||
name uint8
|
||||
bits int
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package dns
|
||||
|
||||
func TestDynamicUpdateParsing(t *testing.T) {
|
||||
prefix := "example.com. IN "
|
||||
for _, typ := range TypeToString {
|
||||
if typ == "CAA" || typ == "OPT" || typ == "AXFR" || typ == "IXFR" || typ == "ANY" || typ == "TKEY" ||
|
||||
typ == "TSIG" || typ == "ISDN" || typ == "UNSPEC" || typ == "NULL" || typ == "ATMA" {
|
||||
continue
|
||||
}
|
||||
r, e := NewRR(prefix + typ)
|
||||
if e != nil {
|
||||
t.Log("failure to parse: " + prefix + typ)
|
||||
t.Fail()
|
||||
} else {
|
||||
t.Logf("parsed: %s", r.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue