diff options
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/client_channel/lb_policies_test.c | 16 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_call_init_fails.c | 1 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_causes_close.c | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/test/core/client_channel/lb_policies_test.c b/test/core/client_channel/lb_policies_test.c index 844db5e6cb..857ba6bd52 100644 --- a/test/core/client_channel/lb_policies_test.c +++ b/test/core/client_channel/lb_policies_test.c @@ -638,6 +638,21 @@ static void test_pending_calls(size_t concurrent_calls) { test_spec_destroy(spec); } +static void test_get_channel_info() { + grpc_channel *channel = grpc_insecure_channel_create( + "test:127.0.0.1:1234?lb_policy=round_robin", NULL, NULL); + // Ensures that resolver returns. + grpc_channel_check_connectivity_state(channel, true /* try_to_connect */); + char *lb_policy_name = NULL; + grpc_channel_info channel_info; + channel_info.lb_policy_name = &lb_policy_name; + grpc_channel_get_info(channel, &channel_info); + GPR_ASSERT(lb_policy_name != NULL); + GPR_ASSERT(strcmp(lb_policy_name, "round_robin") == 0); + gpr_free(lb_policy_name); + grpc_channel_destroy(channel); +} + static void print_failed_expectations(const int *expected_connection_sequence, const int *actual_connection_sequence, const size_t expected_seq_length, @@ -933,6 +948,7 @@ int main(int argc, char **argv) { test_pending_calls(4); test_ping(); + test_get_channel_info(); grpc_exec_ctx_finish(&exec_ctx); grpc_shutdown(); diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c index 0e5692f4c9..2f8a2a4d04 100644 --- a/test/core/end2end/tests/filter_call_init_fails.c +++ b/test/core/end2end/tests/filter_call_init_fails.c @@ -231,6 +231,7 @@ static const grpc_channel_filter test_filter = { init_channel_elem, destroy_channel_elem, grpc_call_next_get_peer, + grpc_channel_next_get_info, "filter_call_init_fails"}; /******************************************************************************* diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index d5eddc7330..da554142e8 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -258,6 +258,7 @@ static const grpc_channel_filter test_filter = { init_channel_elem, destroy_channel_elem, grpc_call_next_get_peer, + grpc_channel_next_get_info, "filter_causes_close"}; /******************************************************************************* |