diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-07-07 13:50:59 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-07-07 13:50:59 -0700 |
commit | 22e217d8fdffac425f64a11b18886026060e767c (patch) | |
tree | 33048e60357a7fe96a985df59139f4943a39a38d /test/core/end2end/fixtures | |
parent | 737aa9f1aec55e7f8e1d3f44d291aa5ea758c08c (diff) | |
parent | 772187cdf0ff9dfafd2e693474c51eeddfe4c800 (diff) |
Merge github.com:grpc/grpc into flow-like-lava-to-a-barnyard
Diffstat (limited to 'test/core/end2end/fixtures')
9 files changed, 64 insertions, 54 deletions
diff --git a/test/core/end2end/fixtures/chttp2_fullstack.c b/test/core/end2end/fixtures/chttp2_fullstack.c index b83e227a89..8a1530e63b 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack.c +++ b/test/core/end2end/fixtures/chttp2_fullstack.c @@ -39,7 +39,6 @@ #include "src/core/channel/connected_channel.h" #include "src/core/channel/http_server_filter.h" #include "src/core/surface/channel.h" -#include "src/core/surface/client.h" #include "src/core/surface/server.h" #include "src/core/transport/chttp2_transport.h" #include <grpc/support/alloc.h> @@ -74,6 +73,7 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { fullstack_fixture_data *ffd = f->fixture_data; f->client = grpc_channel_create(ffd->localaddr, client_args); + GPR_ASSERT(f->client); } void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, diff --git a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c b/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c index 94b54253e4..351e1c5459 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c +++ b/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c @@ -42,7 +42,6 @@ #include "src/core/channel/http_server_filter.h" #include "src/core/support/string.h" #include "src/core/surface/channel.h" -#include "src/core/surface/client.h" #include "src/core/surface/server.h" #include "src/core/transport/chttp2_transport.h" #include <grpc/support/alloc.h> diff --git a/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c b/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c index 00322d4011..69860d04d5 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c +++ b/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c @@ -39,7 +39,6 @@ #include "src/core/channel/connected_channel.h" #include "src/core/channel/http_server_filter.h" #include "src/core/surface/channel.h" -#include "src/core/surface/client.h" #include "src/core/surface/server.h" #include "src/core/transport/chttp2_transport.h" #include <grpc/support/alloc.h> diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c index 237d072702..73a36116fb 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c +++ b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c @@ -105,7 +105,7 @@ static void chttp2_init_client_simple_ssl_secure_fullstack( GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, {"foo.test.google.fr"}}; grpc_channel_args *new_client_args = - grpc_channel_args_copy_and_add(client_args, &ssl_name_override); + grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1); chttp2_init_client_secure_fullstack(f, new_client_args, ssl_creds); grpc_channel_args_destroy(new_client_args); } diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c index ff5642642d..b1ac3e535f 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c +++ b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c @@ -105,7 +105,7 @@ static void chttp2_init_client_simple_ssl_secure_fullstack( GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, {"foo.test.google.fr"}}; grpc_channel_args *new_client_args = - grpc_channel_args_copy_and_add(client_args, &ssl_name_override); + grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1); chttp2_init_client_secure_fullstack(f, new_client_args, ssl_creds); grpc_channel_args_destroy(new_client_args); } diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c b/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c index d4bb5d3ef5..de418bf7ee 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c +++ b/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c @@ -108,7 +108,7 @@ static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack( GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, {"foo.test.google.fr"}}; grpc_channel_args *new_client_args = - grpc_channel_args_copy_and_add(client_args, &ssl_name_override); + grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1); chttp2_init_client_secure_fullstack(f, new_client_args, ssl_oauth2_creds); grpc_channel_args_destroy(new_client_args); grpc_credentials_release(ssl_creds); diff --git a/test/core/end2end/fixtures/chttp2_socket_pair.c b/test/core/end2end/fixtures/chttp2_socket_pair.c index d84405224b..be523608d0 100644 --- a/test/core/end2end/fixtures/chttp2_socket_pair.c +++ b/test/core/end2end/fixtures/chttp2_socket_pair.c @@ -42,7 +42,6 @@ #include "src/core/iomgr/endpoint_pair.h" #include "src/core/iomgr/iomgr.h" #include "src/core/surface/channel.h" -#include "src/core/surface/client.h" #include "src/core/surface/server.h" #include "src/core/transport/chttp2_transport.h" #include <grpc/support/alloc.h> @@ -56,14 +55,14 @@ /* chttp2 transport that is immediately available (used for testing connected_channel without a client_channel */ -static grpc_transport_setup_result server_setup_transport( - void *ts, grpc_transport *transport, grpc_mdctx *mdctx) { +static void server_setup_transport(void *ts, grpc_transport *transport, + grpc_mdctx *mdctx) { grpc_end2end_test_fixture *f = ts; static grpc_channel_filter const *extra_filters[] = { &grpc_http_server_filter}; - return grpc_server_setup_transport(f->server, transport, extra_filters, - GPR_ARRAY_SIZE(extra_filters), mdctx, - grpc_server_get_channel_args(f->server)); + grpc_server_setup_transport(f->server, transport, extra_filters, + GPR_ARRAY_SIZE(extra_filters), mdctx, + grpc_server_get_channel_args(f->server)); } typedef struct { @@ -71,12 +70,11 @@ typedef struct { grpc_channel_args *client_args; } sp_client_setup; -static grpc_transport_setup_result client_setup_transport( - void *ts, grpc_transport *transport, grpc_mdctx *mdctx) { +static void client_setup_transport(void *ts, grpc_transport *transport, + grpc_mdctx *mdctx) { sp_client_setup *cs = ts; - const grpc_channel_filter *filters[] = {&grpc_client_surface_filter, - &grpc_http_client_filter, + const grpc_channel_filter *filters[] = {&grpc_http_client_filter, &grpc_connected_channel_filter}; size_t nfilters = sizeof(filters) / sizeof(*filters); grpc_channel *channel = grpc_channel_create_from_filters( @@ -84,8 +82,8 @@ static grpc_transport_setup_result client_setup_transport( cs->f->client = channel; - return grpc_connected_channel_bind_transport( - grpc_channel_get_channel_stack(channel), transport); + grpc_connected_channel_bind_transport(grpc_channel_get_channel_stack(channel), + transport); } static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( @@ -105,23 +103,29 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { grpc_endpoint_pair *sfd = f->fixture_data; + grpc_transport *transport; + grpc_mdctx *mdctx = grpc_mdctx_create(); sp_client_setup cs; cs.client_args = client_args; cs.f = f; - grpc_create_chttp2_transport(client_setup_transport, &cs, client_args, - sfd->client, NULL, 0, grpc_mdctx_create(), 1); + transport = grpc_create_chttp2_transport(client_args, sfd->client, mdctx, 1); + client_setup_transport(&cs, transport, mdctx); GPR_ASSERT(f->client); + grpc_chttp2_transport_start_reading(transport, NULL, 0); } static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { grpc_endpoint_pair *sfd = f->fixture_data; + grpc_mdctx *mdctx = grpc_mdctx_create(); + grpc_transport *transport; GPR_ASSERT(!f->server); f->server = grpc_server_create_from_filters(NULL, 0, server_args); grpc_server_register_completion_queue(f->server, f->cq); grpc_server_start(f->server); - grpc_create_chttp2_transport(server_setup_transport, f, server_args, - sfd->server, NULL, 0, grpc_mdctx_create(), 0); + transport = grpc_create_chttp2_transport(server_args, sfd->server, mdctx, 0); + server_setup_transport(f, transport, mdctx); + grpc_chttp2_transport_start_reading(transport, NULL, 0); } static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) { diff --git a/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c b/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c index ac8b5eb86d..f875ca54a5 100644 --- a/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c +++ b/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c @@ -42,7 +42,6 @@ #include "src/core/iomgr/endpoint_pair.h" #include "src/core/iomgr/iomgr.h" #include "src/core/surface/channel.h" -#include "src/core/surface/client.h" #include "src/core/surface/server.h" #include "src/core/transport/chttp2_transport.h" #include <grpc/support/alloc.h> @@ -56,14 +55,14 @@ /* chttp2 transport that is immediately available (used for testing connected_channel without a client_channel */ -static grpc_transport_setup_result server_setup_transport( - void *ts, grpc_transport *transport, grpc_mdctx *mdctx) { +static void server_setup_transport(void *ts, grpc_transport *transport, + grpc_mdctx *mdctx) { grpc_end2end_test_fixture *f = ts; static grpc_channel_filter const *extra_filters[] = { &grpc_http_server_filter}; - return grpc_server_setup_transport(f->server, transport, extra_filters, - GPR_ARRAY_SIZE(extra_filters), mdctx, - grpc_server_get_channel_args(f->server)); + grpc_server_setup_transport(f->server, transport, extra_filters, + GPR_ARRAY_SIZE(extra_filters), mdctx, + grpc_server_get_channel_args(f->server)); } typedef struct { @@ -71,12 +70,11 @@ typedef struct { grpc_channel_args *client_args; } sp_client_setup; -static grpc_transport_setup_result client_setup_transport( - void *ts, grpc_transport *transport, grpc_mdctx *mdctx) { +static void client_setup_transport(void *ts, grpc_transport *transport, + grpc_mdctx *mdctx) { sp_client_setup *cs = ts; - const grpc_channel_filter *filters[] = {&grpc_client_surface_filter, - &grpc_http_client_filter, + const grpc_channel_filter *filters[] = {&grpc_http_client_filter, &grpc_connected_channel_filter}; size_t nfilters = sizeof(filters) / sizeof(*filters); grpc_channel *channel = grpc_channel_create_from_filters( @@ -84,8 +82,8 @@ static grpc_transport_setup_result client_setup_transport( cs->f->client = channel; - return grpc_connected_channel_bind_transport( - grpc_channel_get_channel_stack(channel), transport); + grpc_connected_channel_bind_transport(grpc_channel_get_channel_stack(channel), + transport); } static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( @@ -105,23 +103,29 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { grpc_endpoint_pair *sfd = f->fixture_data; + grpc_transport *transport; + grpc_mdctx *mdctx = grpc_mdctx_create(); sp_client_setup cs; cs.client_args = client_args; cs.f = f; - grpc_create_chttp2_transport(client_setup_transport, &cs, client_args, - sfd->client, NULL, 0, grpc_mdctx_create(), 1); + transport = grpc_create_chttp2_transport(client_args, sfd->client, mdctx, 1); + client_setup_transport(&cs, transport, mdctx); GPR_ASSERT(f->client); + grpc_chttp2_transport_start_reading(transport, NULL, 0); } static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { grpc_endpoint_pair *sfd = f->fixture_data; + grpc_mdctx *mdctx = grpc_mdctx_create(); + grpc_transport *transport; GPR_ASSERT(!f->server); f->server = grpc_server_create_from_filters(NULL, 0, server_args); grpc_server_register_completion_queue(f->server, f->cq); grpc_server_start(f->server); - grpc_create_chttp2_transport(server_setup_transport, f, server_args, - sfd->server, NULL, 0, grpc_mdctx_create(), 0); + transport = grpc_create_chttp2_transport(server_args, sfd->server, mdctx, 0); + server_setup_transport(f, transport, mdctx); + grpc_chttp2_transport_start_reading(transport, NULL, 0); } static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) { diff --git a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c b/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c index e160812fa3..52c0e2ca8b 100644 --- a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c +++ b/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c @@ -43,7 +43,6 @@ #include "src/core/iomgr/iomgr.h" #include "src/core/support/env.h" #include "src/core/surface/channel.h" -#include "src/core/surface/client.h" #include "src/core/surface/server.h" #include "src/core/transport/chttp2_transport.h" #include <grpc/support/alloc.h> @@ -57,14 +56,14 @@ /* chttp2 transport that is immediately available (used for testing connected_channel without a client_channel */ -static grpc_transport_setup_result server_setup_transport( - void *ts, grpc_transport *transport, grpc_mdctx *mdctx) { +static void server_setup_transport(void *ts, grpc_transport *transport, + grpc_mdctx *mdctx) { grpc_end2end_test_fixture *f = ts; static grpc_channel_filter const *extra_filters[] = { &grpc_http_server_filter}; - return grpc_server_setup_transport(f->server, transport, extra_filters, - GPR_ARRAY_SIZE(extra_filters), mdctx, - grpc_server_get_channel_args(f->server)); + grpc_server_setup_transport(f->server, transport, extra_filters, + GPR_ARRAY_SIZE(extra_filters), mdctx, + grpc_server_get_channel_args(f->server)); } typedef struct { @@ -72,12 +71,11 @@ typedef struct { grpc_channel_args *client_args; } sp_client_setup; -static grpc_transport_setup_result client_setup_transport( - void *ts, grpc_transport *transport, grpc_mdctx *mdctx) { +static void client_setup_transport(void *ts, grpc_transport *transport, + grpc_mdctx *mdctx) { sp_client_setup *cs = ts; - const grpc_channel_filter *filters[] = {&grpc_client_surface_filter, - &grpc_http_client_filter, + const grpc_channel_filter *filters[] = {&grpc_http_client_filter, &grpc_connected_channel_filter}; size_t nfilters = sizeof(filters) / sizeof(*filters); grpc_channel *channel = grpc_channel_create_from_filters( @@ -85,8 +83,8 @@ static grpc_transport_setup_result client_setup_transport( cs->f->client = channel; - return grpc_connected_channel_bind_transport( - grpc_channel_get_channel_stack(channel), transport); + grpc_connected_channel_bind_transport(grpc_channel_get_channel_stack(channel), + transport); } static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( @@ -106,23 +104,29 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { grpc_endpoint_pair *sfd = f->fixture_data; + grpc_transport *transport; + grpc_mdctx *mdctx = grpc_mdctx_create(); sp_client_setup cs; cs.client_args = client_args; cs.f = f; - grpc_create_chttp2_transport(client_setup_transport, &cs, client_args, - sfd->client, NULL, 0, grpc_mdctx_create(), 1); + transport = grpc_create_chttp2_transport(client_args, sfd->client, mdctx, 1); + client_setup_transport(&cs, transport, mdctx); GPR_ASSERT(f->client); + grpc_chttp2_transport_start_reading(transport, NULL, 0); } static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { grpc_endpoint_pair *sfd = f->fixture_data; + grpc_mdctx *mdctx = grpc_mdctx_create(); + grpc_transport *transport; GPR_ASSERT(!f->server); f->server = grpc_server_create_from_filters(NULL, 0, server_args); grpc_server_register_completion_queue(f->server, f->cq); grpc_server_start(f->server); - grpc_create_chttp2_transport(server_setup_transport, f, server_args, - sfd->server, NULL, 0, grpc_mdctx_create(), 0); + transport = grpc_create_chttp2_transport(server_args, sfd->server, mdctx, 0); + server_setup_transport(f, transport, mdctx); + grpc_chttp2_transport_start_reading(transport, NULL, 0); } static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) { |