diff --git a/go/vt/vtadmin/api_authz_test.go b/go/vt/vtadmin/api_authz_test.go index b676b8cf9e3..a59283f695f 100644 --- a/go/vt/vtadmin/api_authz_test.go +++ b/go/vt/vtadmin/api_authz_test.go @@ -3608,6 +3608,37 @@ func testClusters(t testing.TB) []*cluster.Cluster { }, }, }, + GetSrvVSchemaResults: map[string]struct { + Response *vtctldatapb.GetSrvVSchemaResponse + Error error + }{ + "zone1": { + Response: &vtctldatapb.GetSrvVSchemaResponse{ + SrvVSchema: &vschemapb.SrvVSchema{ + Keyspaces: map[string]*vschemapb.Keyspace{ + "test": { + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "id": { + Type: "hash", + }, + }, + Tables: map[string]*vschemapb.Table{ + "t1": { + ColumnVindexes: []*vschemapb.ColumnVindex{ + { + Name: "id", + Column: "id", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, GetVSchemaResults: map[string]struct { Response *vtctldatapb.GetVSchemaResponse Error error diff --git a/go/vt/vtadmin/testutil/authztestgen/config.json b/go/vt/vtadmin/testutil/authztestgen/config.json index 2828a1ef27e..799384b6999 100644 --- a/go/vt/vtadmin/testutil/authztestgen/config.json +++ b/go/vt/vtadmin/testutil/authztestgen/config.json @@ -80,7 +80,12 @@ "type": "map[string]struct{\nResponse *vtctldatapb.GetSchemaResponse\nError error}", "value": "\"zone1-0000000100\": {\nResponse: &vtctldatapb.GetSchemaResponse{\nSchema: &tabletmanagerdatapb.SchemaDefinition{\nTableDefinitions: []*tabletmanagerdatapb.TableDefinition{\n{Name: \"t1\", Schema: \"create table t1 (id int(11) not null primary key);\",},\n{Name: \"t2\"},\n},\n},\n},\n}," }, - + { + "field": "GetSrvVSchemaResults", + "type": "map[string]struct{\nResponse *vtctldatapb.GetSrvVSchemaResponse\nError error}", + "value": "\"zone1\": {\nResponse: &vtctldatapb.GetSrvVSchemaResponse{\nSrvVSchema: &vschemapb.SrvVSchema{\nKeyspaces: map[string]*vschemapb.Keyspace{\n\"test\": {\nSharded: true,\nVindexes: map[string]*vschemapb.Vindex{\n\"id\": {\nType: \"hash\",\n},\n},\nTables: map[string]*vschemapb.Table{\n\"t1\": {\nColumnVindexes: []*vschemapb.ColumnVindex{\n{\nName: \"id\",\nColumn: \"id\",\n},\n},\n},\n},\n},\n},\n},\n},\n},", + "comment": "this structure exists primarily to support the VExplain test cases; for GetSrvVSchema(s) itself, an empty but non-nil map is sufficient" + }, { "field": "GetVSchemaResults", "type": "map[string]struct{\nResponse *vtctldatapb.GetVSchemaResponse\nError error}",