From b86a74475189e0ed97cdd3ddc48d96e94cec366a Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 11 Jul 2018 17:11:01 -0700 Subject: Expose GetChannel and GetTopChannels Core API --- test/core/channel/channelz_test.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/core/channel') diff --git a/test/core/channel/channelz_test.cc b/test/core/channel/channelz_test.cc index d12f529726..ad5f86d934 100644 --- a/test/core/channel/channelz_test.cc +++ b/test/core/channel/channelz_test.cc @@ -95,6 +95,11 @@ void ValidateGetTopChannels(size_t expected_channels) { EXPECT_EQ(end->type, GRPC_JSON_TRUE); grpc_json_destroy(parsed_json); gpr_free(json_str); + // also check that the core API formats this correctly + char* core_api_json_str = grpc_channelz_get_top_channels(0); + grpc::testing::ValidateGetTopChannelsResponseProtoJsonTranslation( + core_api_json_str); + gpr_free(core_api_json_str); } class ChannelFixture { @@ -151,6 +156,11 @@ void ValidateChannel(ChannelNode* channel, validate_channel_data_args args) { grpc::testing::ValidateChannelProtoJsonTranslation(json_str); ValidateCounters(json_str, args); gpr_free(json_str); + // also check that the core API formats this the correct way + char* core_api_json_str = grpc_channelz_get_channel(channel->channel_uuid()); + grpc::testing::ValidateGetChannelResponseProtoJsonTranslation( + core_api_json_str); + gpr_free(core_api_json_str); } grpc_millis GetLastCallStartedMillis(ChannelNode* channel) { -- cgit v1.2.3