state: add indexer test for services.ID index

This commit is contained in:
Daniel Nephin 2021-03-10 18:34:19 -05:00
parent dbd3cef1ed
commit 0c14f3818d

View File

@ -145,6 +145,36 @@ func testIndexerTableNodes() map[string]indexerTestCase {
func testIndexerTableServices() map[string]indexerTestCase {
return map[string]indexerTestCase{
indexID: {
read: indexValue{
source: NodeServiceQuery{
Node: "NoDeId",
Service: "SeRvIcE",
},
expected: []byte("nodeid\x00service\x00"),
},
write: indexValue{
source: &structs.ServiceNode{
Node: "NoDeId",
ServiceID: "SeRviCe",
},
expected: []byte("nodeid\x00service\x00"),
},
prefix: []indexValue{
{
source: (*structs.EnterpriseMeta)(nil),
expected: nil,
},
{
source: structs.EnterpriseMeta{},
expected: nil,
},
{
source: Query{Value: "NoDeId"},
expected: []byte("nodeid\x00"),
},
},
},
indexNode: {
read: indexValue{
source: Query{