Skip to content

Commit

Permalink
Enable channelz for xds_interop_client and xds_interop_server (grpc#2…
Browse files Browse the repository at this point in the history
…5939)

* Enable channelz for xds_interop_client and xds_interop_server

* Regenerate projects
  • Loading branch information
yashykt committed Apr 13, 2021
1 parent 1ab9b7f commit efcc77d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14853,7 +14853,7 @@ target_link_libraries(xds_interop_client
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpcpp_channelz
grpc_test_util
grpc++_test_config
)
Expand Down Expand Up @@ -14908,7 +14908,7 @@ target_link_libraries(xds_interop_server
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpcpp_channelz
grpc_test_util
grpc++_test_config
)
Expand Down
4 changes: 2 additions & 2 deletions build_autogenerated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6638,7 +6638,7 @@ targets:
- test/cpp/interop/xds_interop_client.cc
deps:
- absl/flags:flag
- grpc++
- grpcpp_channelz
- grpc_test_util
- grpc++_test_config
- name: xds_interop_server
Expand All @@ -6656,7 +6656,7 @@ targets:
- test/cpp/interop/xds_interop_server.cc
deps:
- absl/flags:flag
- grpc++
- grpcpp_channelz
- grpc_test_util
- grpc++_test_config
tests: []
2 changes: 2 additions & 0 deletions test/cpp/interop/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ grpc_cc_binary(
],
deps = [
"//:grpc++",
"//:grpcpp_channelz",
"//src/proto/grpc/testing:empty_proto",
"//src/proto/grpc/testing:messages_proto",
"//src/proto/grpc/testing:test_proto",
Expand All @@ -248,6 +249,7 @@ grpc_cc_binary(
],
deps = [
"//:grpc++",
"//:grpcpp_channelz",
"//src/proto/grpc/testing:empty_proto",
"//src/proto/grpc/testing:messages_proto",
"//src/proto/grpc/testing:test_proto",
Expand Down
2 changes: 2 additions & 0 deletions test/cpp/interop/xds_interop_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*
*/

#include <grpcpp/ext/channelz_service_plugin.h>
#include <grpcpp/grpcpp.h>
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
Expand Down Expand Up @@ -574,6 +575,7 @@ void BuildRpcConfigsFromFlags(RpcConfigurationsQueue* rpc_configs_queue) {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
grpc::testing::InitTest(&argc, &argv, true);
grpc::channelz::experimental::InitChannelzService();
// Validate the expect_status flag.
grpc_status_code code;
GPR_ASSERT(grpc_status_code_from_string(
Expand Down
3 changes: 2 additions & 1 deletion test/cpp/interop/xds_interop_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpcpp/ext/channelz_service_plugin.h>
#include <grpcpp/health_check_service_interface.h>
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
Expand Down Expand Up @@ -155,7 +156,7 @@ void RunServer(bool secure_mode, const int port, const int maintenance_port,
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
grpc::testing::InitTest(&argc, &argv, true);

grpc::channelz::experimental::InitChannelzService();
char* hostname = grpc_gethostname();
if (hostname == nullptr) {
std::cout << "Failed to get hostname, terminating" << std::endl;
Expand Down

0 comments on commit efcc77d

Please sign in to comment.