Fix tsig tests and tweak q

This commit is contained in:
Miek Gieben 2013-10-12 15:35:26 +01:00
parent 675f170a3d
commit f3d8fc6c34
1 changed files with 7 additions and 12 deletions

View File

@ -81,13 +81,13 @@ Loop:
func TestClientTsigAXFR(t *testing.T) {
m := new(Msg)
m.SetAxfr("miek.nl.")
m.SetAxfr("example.nl.")
m.SetTsig("axfr.", HmacMD5, 300, time.Now().Unix())
tr := new(Transfer)
tr.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="}
if a, err := tr.n(m, "176.58.119.54:53"); err != nil {
if a, err := tr.In(m, "176.58.119.54:53"); err != nil {
t.Log("Failed to setup axfr: " + err.Error())
t.Fatal()
} else {
@ -103,17 +103,13 @@ func TestClientTsigAXFR(t *testing.T) {
}
}
}
*/
/*
func TestClientAXFRMultipleMessages(t *testing.T) {
func TestClientAXFRMultipleEnvelopes(t *testing.T) {
m := new(Msg)
m.SetAxfr("dnsex.nl.")
m.SetAxfr("nlnetlabs.nl.")
c := new(Client)
c.Net = "tcp"
if a, err := c.TransferIn(m, "37.251.95.53:53"); err != nil {
tr := new(Transfer)
if a, err := tr.In(m, "213.154.224.1:53"); err != nil {
t.Log("Failed to setup axfr" + err.Error())
t.Fail()
return
@ -127,10 +123,9 @@ func TestClientAXFRMultipleMessages(t *testing.T) {
}
}
}
*/
// not really a test, but shows how to use update leases
func TestUpdateLeaseTSIG(t *testing.T) {
func ExampleUpdateLeaseTSIG(t *testing.T) {
m := new(Msg)
m.SetUpdate("t.local.ip6.io.")
rr, _ := NewRR("t.local.ip6.io. 30 A 127.0.0.1")