git » dnss » commit befaea2

test: Include TTL in the test zones

author Alberto Bertogli
2017-10-03 01:42:44 UTC
committer Alberto Bertogli
2017-10-03 01:42:44 UTC
parent 546f998bfdc6a112c0eae4640dd9d02136d86fa3

test: Include TTL in the test zones

The DNS library now requires a TTL to be set, so include one to fix the
breakage.

For reference, this is the DNS library commit which triggered this:
https://github.com/miekg/dns/commit/eccf8bbe836c8cedcdbfbb593ef04da003a0b034

dnss_test.go +3 -3

diff --git a/dnss_test.go b/dnss_test.go
index 8c573aa..e1fa284 100644
--- a/dnss_test.go
+++ b/dnss_test.go
@@ -152,7 +152,7 @@ func handleFakeDNS(w dns.ResponseWriter, r *dns.Msg) {
 
 func TestEndToEnd(t *testing.T) {
 	resetAnswers()
-	addAnswers(t, "test.blah. A 1.2.3.4")
+	addAnswers(t, "test.blah. 3600 A 1.2.3.4")
 	_, ans, err := testutil.DNSQuery(ServerAddr, "test.blah.", dns.TypeA)
 	if err != nil {
 		t.Errorf("dns query returned error: %v", err)
@@ -161,7 +161,7 @@ func TestEndToEnd(t *testing.T) {
 		t.Errorf("unexpected result: %q", ans)
 	}
 
-	addAnswers(t, "test.blah. MX 10 mail.test.blah.")
+	addAnswers(t, "test.blah. 3600 MX 10 mail.test.blah.")
 	_, ans, err = testutil.DNSQuery(ServerAddr, "test.blah.", dns.TypeMX)
 	if err != nil {
 		t.Errorf("dns query returned error: %v", err)
@@ -185,7 +185,7 @@ func TestEndToEnd(t *testing.T) {
 
 func BenchmarkSimple(b *testing.B) {
 	resetAnswers()
-	addAnswers(b, "test.blah. A 1.2.3.4")
+	addAnswers(b, "test.blah. 3600 A 1.2.3.4")
 	b.ResetTimer()
 
 	var err error