mirror of https://github.com/hashicorp/consul
state: add tests for checks indexers
parent
ce631d0bba
commit
628eed3748
|
@ -8,9 +8,11 @@ import (
|
||||||
|
|
||||||
func testIndexerTableChecks() map[string]indexerTestCase {
|
func testIndexerTableChecks() map[string]indexerTestCase {
|
||||||
obj := &structs.HealthCheck{
|
obj := &structs.HealthCheck{
|
||||||
Node: "NoDe",
|
Node: "NoDe",
|
||||||
ServiceID: "SeRvIcE",
|
ServiceID: "SeRvIcE",
|
||||||
CheckID: "CheckID",
|
ServiceName: "ServiceName",
|
||||||
|
CheckID: "CheckID",
|
||||||
|
Status: "PASSING",
|
||||||
}
|
}
|
||||||
return map[string]indexerTestCase{
|
return map[string]indexerTestCase{
|
||||||
indexID: {
|
indexID: {
|
||||||
|
@ -36,6 +38,30 @@ func testIndexerTableChecks() map[string]indexerTestCase {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
indexStatus: {
|
||||||
|
read: indexValue{
|
||||||
|
source: []interface{}{
|
||||||
|
"PASSING",
|
||||||
|
},
|
||||||
|
expected: []byte("PASSING\x00"),
|
||||||
|
},
|
||||||
|
write: indexValue{
|
||||||
|
source: obj,
|
||||||
|
expected: []byte("PASSING\x00"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
indexService: {
|
||||||
|
read: indexValue{
|
||||||
|
source: []interface{}{
|
||||||
|
"ServiceName",
|
||||||
|
},
|
||||||
|
expected: []byte("servicename\x00"),
|
||||||
|
},
|
||||||
|
write: indexValue{
|
||||||
|
source: obj,
|
||||||
|
expected: []byte("servicename\x00"),
|
||||||
|
},
|
||||||
|
},
|
||||||
indexNodeService: {
|
indexNodeService: {
|
||||||
read: indexValue{
|
read: indexValue{
|
||||||
source: NodeServiceQuery{
|
source: NodeServiceQuery{
|
||||||
|
|
Loading…
Reference in New Issue