|
|
|
@ -95,7 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) { |
|
|
|
|
grpc_completion_queue_destroy(f->cq); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void simple_request_body(grpc_end2end_test_fixture f) { |
|
|
|
|
static void simple_request_body(grpc_end2end_test_config config, |
|
|
|
|
grpc_end2end_test_fixture f) { |
|
|
|
|
grpc_call *c; |
|
|
|
|
grpc_call *s; |
|
|
|
|
gpr_timespec deadline = five_seconds_time(); |
|
|
|
@ -112,9 +113,10 @@ static void simple_request_body(grpc_end2end_test_fixture f) { |
|
|
|
|
size_t details_capacity = 0; |
|
|
|
|
int was_cancelled = 2; |
|
|
|
|
|
|
|
|
|
c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, |
|
|
|
|
"/foo", "foo.test.google.fr:1234", deadline, |
|
|
|
|
NULL); |
|
|
|
|
c = grpc_channel_create_call( |
|
|
|
|
f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo", |
|
|
|
|
get_host_override_string("foo.test.google.fr:1234", config), deadline, |
|
|
|
|
NULL); |
|
|
|
|
GPR_ASSERT(c); |
|
|
|
|
|
|
|
|
|
grpc_metadata_array_init(&initial_metadata_recv); |
|
|
|
@ -185,7 +187,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { |
|
|
|
|
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED); |
|
|
|
|
GPR_ASSERT(0 == strcmp(details, "xyz")); |
|
|
|
|
GPR_ASSERT(0 == strcmp(call_details.method, "/foo")); |
|
|
|
|
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234")); |
|
|
|
|
validate_host_override_string("foo.test.google.fr:1234", call_details.host, |
|
|
|
|
config); |
|
|
|
|
GPR_ASSERT(was_cancelled == 1); |
|
|
|
|
|
|
|
|
|
gpr_free(details); |
|
|
|
@ -250,20 +253,22 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { |
|
|
|
|
|
|
|
|
|
/* perform a ping-pong to ensure that settings have had a chance to round
|
|
|
|
|
trip */ |
|
|
|
|
simple_request_body(f); |
|
|
|
|
simple_request_body(config, f); |
|
|
|
|
/* perform another one to make sure that the one stream case still works */ |
|
|
|
|
simple_request_body(f); |
|
|
|
|
simple_request_body(config, f); |
|
|
|
|
|
|
|
|
|
/* start two requests - ensuring that the second is not accepted until
|
|
|
|
|
the first completes */ |
|
|
|
|
deadline = n_seconds_time(1000); |
|
|
|
|
c1 = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, |
|
|
|
|
"/alpha", "foo.test.google.fr:1234", deadline, |
|
|
|
|
NULL); |
|
|
|
|
c1 = grpc_channel_create_call( |
|
|
|
|
f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/alpha", |
|
|
|
|
get_host_override_string("foo.test.google.fr:1234", config), deadline, |
|
|
|
|
NULL); |
|
|
|
|
GPR_ASSERT(c1); |
|
|
|
|
c2 = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, |
|
|
|
|
"/beta", "foo.test.google.fr:1234", deadline, |
|
|
|
|
NULL); |
|
|
|
|
c2 = grpc_channel_create_call( |
|
|
|
|
f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/beta", |
|
|
|
|
get_host_override_string("foo.test.google.fr:1234", config), deadline, |
|
|
|
|
NULL); |
|
|
|
|
GPR_ASSERT(c2); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( |
|
|
|
|