diff options
author | ncteisen <ncteisen@gmail.com> | 2018-11-02 16:55:06 -0400 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2018-11-02 16:55:06 -0400 |
commit | 131eedaa408be824d0ff222e6b6fcb64f82f5495 (patch) | |
tree | d355399fe5913ae3dd82d018b87647044abaf5e9 | |
parent | c8ee12c0f5bdb76d12f4c20c42144383e8a669fb (diff) |
Add test
-rw-r--r-- | test/cpp/end2end/channelz_service_test.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/cpp/end2end/channelz_service_test.cc b/test/cpp/end2end/channelz_service_test.cc index 5f25278534..24b00e849a 100644 --- a/test/cpp/end2end/channelz_service_test.cc +++ b/test/cpp/end2end/channelz_service_test.cc @@ -650,6 +650,28 @@ TEST_F(ChannelzServerTest, GetServerSocketsTest) { EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message(); EXPECT_EQ(get_server_sockets_response.socket_ref_size(), 1); } +TEST_F(ChannelzServerTest, GetServerListenSocketsTest) { + ResetStubs(); + ConfigureProxy(1); + GetServersRequest get_server_request; + GetServersResponse get_server_response; + get_server_request.set_start_server_id(0); + ClientContext get_server_context; + Status s = channelz_stub_->GetServers(&get_server_context, get_server_request, + &get_server_response); + EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message(); + EXPECT_EQ(get_server_response.server_size(), 1); + EXPECT_EQ(get_server_response.server(0).listen_socket_size(), 1); + GetSocketRequest get_socket_request; + GetSocketResponse get_socket_response; + get_socket_request.set_socket_id( + get_server_response.server(0).listen_socket(0).socket_id()); + ClientContext get_socket_context; + s = channelz_stub_->GetSocket(&get_socket_context, + get_socket_request, + &get_socket_response); + EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message(); +} } // namespace testing } // namespace grpc |