mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
@@ -41,7 +41,9 @@ func TestTraffic(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
cla: &xdspb.ClusterLoadAssignment{},
|
cla: &xdspb.ClusterLoadAssignment{},
|
||||||
cluster: "does-not-exist", qtype: dns.TypeA, rcode: dns.RcodeNameError, ns: true},
|
cluster: "does-not-exist", qtype: dns.TypeA, rcode: dns.RcodeNameError, ns: true,
|
||||||
|
},
|
||||||
|
// healthy backend
|
||||||
{
|
{
|
||||||
cla: &xdspb.ClusterLoadAssignment{
|
cla: &xdspb.ClusterLoadAssignment{
|
||||||
ClusterName: "web",
|
ClusterName: "web",
|
||||||
@@ -49,6 +51,7 @@ func TestTraffic(t *testing.T) {
|
|||||||
},
|
},
|
||||||
cluster: "web", qtype: dns.TypeA, rcode: dns.RcodeSuccess, answer: "127.0.0.1",
|
cluster: "web", qtype: dns.TypeA, rcode: dns.RcodeSuccess, answer: "127.0.0.1",
|
||||||
},
|
},
|
||||||
|
// unknown backend
|
||||||
{
|
{
|
||||||
cla: &xdspb.ClusterLoadAssignment{
|
cla: &xdspb.ClusterLoadAssignment{
|
||||||
ClusterName: "web",
|
ClusterName: "web",
|
||||||
@@ -56,6 +59,17 @@ func TestTraffic(t *testing.T) {
|
|||||||
},
|
},
|
||||||
cluster: "web", qtype: dns.TypeA, rcode: dns.RcodeSuccess, ns: true,
|
cluster: "web", qtype: dns.TypeA, rcode: dns.RcodeSuccess, ns: true,
|
||||||
},
|
},
|
||||||
|
// unknown backend and healthy backend
|
||||||
|
{
|
||||||
|
cla: &xdspb.ClusterLoadAssignment{
|
||||||
|
ClusterName: "web",
|
||||||
|
Endpoints: endpoints([]EndpointHealth{
|
||||||
|
{"127.0.0.1", corepb.HealthStatus_UNKNOWN},
|
||||||
|
{"127.0.0.2", corepb.HealthStatus_HEALTHY},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
cluster: "web", qtype: dns.TypeA, rcode: dns.RcodeSuccess, answer: "127.0.0.2",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := context.TODO()
|
ctx := context.TODO()
|
||||||
|
|||||||
Reference in New Issue
Block a user