Commit c7dcd633 authored by Miek Gieben's avatar Miek Gieben

more tests

Signed-off-by: default avatarMiek Gieben <miek@miek.nl>
parent 9433da1a
...@@ -41,7 +41,9 @@ func TestTraffic(t *testing.T) { ...@@ -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) { ...@@ -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) { ...@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment