From deec3bef9eb7ec368c828363cafeb31c4bccacc5 Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Wed, 1 Apr 2015 10:57:37 -0700 Subject: [PATCH] agent: fix dns test --- command/agent/dns_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/command/agent/dns_test.go b/command/agent/dns_test.go index 440e72d9d5..fbc2fee001 100644 --- a/command/agent/dns_test.go +++ b/command/agent/dns_test.go @@ -1192,7 +1192,7 @@ func TestDNS_ServiceLookup_CNAME(t *testing.T) { t.Fatalf("err: %v", err) } - if len(in.Answer) != 4 { + if len(in.Answer) < 2 { t.Fatalf("Bad: %#v", in) } @@ -1206,9 +1206,9 @@ func TestDNS_ServiceLookup_CNAME(t *testing.T) { } // Check we recursively resolve - for i := 1; i < 4; i++ { - if _, ok := in.Answer[i].(*dns.A); !ok { - t.Fatalf("Bad: %#v", in.Answer[i]) + for _, ans := range in.Answer[1:] { + if _, ok := ans.(*dns.A); !ok { + t.Fatalf("Bad: %#v", ans) } } }