mirror of
https://github.com/coredns/coredns.git
synced 2026-07-11 18:20:10 -04:00
fix(forward): make dnstap FORWARDER_* describe the socket from CoreDNS to upstream (#8184)
Signed-off-by: Jaime Hablutzel <hablutzel1@gmail.com>
This commit is contained in:
@@ -36,7 +36,7 @@ func TestProxy(t *testing.T) {
|
||||
rec := dnstest.NewRecorder(&test.ResponseWriter{})
|
||||
req := request.Request{Req: m, W: rec}
|
||||
|
||||
resp, err := p.Connect(context.Background(), req, Options{PreferUDP: true})
|
||||
resp, _, _, err := p.Connect(context.Background(), req, Options{PreferUDP: true})
|
||||
if err != nil {
|
||||
t.Errorf("Failed to connect to testdnsserver: %s", err)
|
||||
}
|
||||
@@ -67,7 +67,7 @@ func TestProxyTLSFail(t *testing.T) {
|
||||
rec := dnstest.NewRecorder(&test.ResponseWriter{})
|
||||
req := request.Request{Req: m, W: rec}
|
||||
|
||||
_, err := p.Connect(context.Background(), req, Options{})
|
||||
_, _, _, err := p.Connect(context.Background(), req, Options{})
|
||||
if err == nil {
|
||||
t.Fatal("Expected *not* to receive reply, but got one")
|
||||
}
|
||||
@@ -121,7 +121,7 @@ func TestProtocolSelection(t *testing.T) {
|
||||
Req: m,
|
||||
}
|
||||
|
||||
resp, err := p.Connect(context.Background(), req, tc.opts)
|
||||
resp, _, proto, err := p.Connect(context.Background(), req, tc.opts)
|
||||
if err != nil {
|
||||
t.Fatalf("Connect failed: %v", err)
|
||||
}
|
||||
@@ -133,6 +133,10 @@ func TestProtocolSelection(t *testing.T) {
|
||||
if receivedProto != tc.expectedProto {
|
||||
t.Errorf("Expected protocol %q, but server received %q", tc.expectedProto, receivedProto)
|
||||
}
|
||||
|
||||
if proto != tc.expectedProto {
|
||||
t.Errorf("Expected Connect to report proto %q, got %q", tc.expectedProto, proto)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -214,7 +218,7 @@ func TestCoreDNSOverflow(t *testing.T) {
|
||||
recorder := dnstest.NewRecorder(&test.ResponseWriter{})
|
||||
request := request.Request{Req: queryMsg, W: recorder}
|
||||
|
||||
response, err := p.Connect(context.Background(), request, options)
|
||||
response, _, _, err := p.Connect(context.Background(), request, options)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to connect to testdnsserver: %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user