Fix tests after config refactor

This commit is contained in:
Frank Schroeder 2017-09-26 14:39:47 +02:00
parent fa67334361
commit abe41d231c
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD
1 changed files with 4 additions and 8 deletions

View File

@ -394,8 +394,7 @@ func TestDNS_NodeLookup_CNAME(t *testing.T) {
} }
func TestDNS_NodeLookup_TXT(t *testing.T) { func TestDNS_NodeLookup_TXT(t *testing.T) {
cfg := TestConfig() a := NewTestAgent(t.Name(), ``)
a := NewTestAgent(t.Name(), cfg)
defer a.Shutdown() defer a.Shutdown()
args := &structs.RegisterRequest{ args := &structs.RegisterRequest{
@ -417,8 +416,7 @@ func TestDNS_NodeLookup_TXT(t *testing.T) {
m.SetQuestion("google.node.consul.", dns.TypeTXT) m.SetQuestion("google.node.consul.", dns.TypeTXT)
c := new(dns.Client) c := new(dns.Client)
addr, _ := a.Config.ClientListener("", a.Config.Ports.DNS) in, _, err := c.Exchange(m, a.DNSAddr())
in, _, err := c.Exchange(m, addr.String())
if err != nil { if err != nil {
t.Fatalf("err: %v", err) t.Fatalf("err: %v", err)
} }
@ -441,8 +439,7 @@ func TestDNS_NodeLookup_TXT(t *testing.T) {
} }
func TestDNS_NodeLookup_ANY(t *testing.T) { func TestDNS_NodeLookup_ANY(t *testing.T) {
cfg := TestConfig() a := NewTestAgent(t.Name(), ``)
a := NewTestAgent(t.Name(), cfg)
defer a.Shutdown() defer a.Shutdown()
args := &structs.RegisterRequest{ args := &structs.RegisterRequest{
@ -463,8 +460,7 @@ func TestDNS_NodeLookup_ANY(t *testing.T) {
m.SetQuestion("bar.node.consul.", dns.TypeANY) m.SetQuestion("bar.node.consul.", dns.TypeANY)
c := new(dns.Client) c := new(dns.Client)
addr, _ := a.Config.ClientListener("", a.Config.Ports.DNS) in, _, err := c.Exchange(m, a.DNSAddr())
in, _, err := c.Exchange(m, addr.String())
if err != nil { if err != nil {
t.Fatalf("err: %v", err) t.Fatalf("err: %v", err)
} }