diff options
Diffstat (limited to 'test/core')
507 files changed, 2917 insertions, 947 deletions
diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index f753b6fd24..24ee3387a0 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -62,7 +62,7 @@ static void thd_func(void *arg) { gpr_event_set(&a->done_thd, (void *)1); } -static void done_write(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { thd_args *a = arg; gpr_event_set(&a->done_write, (void *)1); } @@ -81,7 +81,7 @@ typedef struct { gpr_event read_done; } read_args; -static void read_done(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void read_done(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { read_args *a = arg; a->validator(&a->incoming); gpr_event_set(&a->read_done, (void *)1); diff --git a/test/core/bad_client/tests/large_metadata.c b/test/core/bad_client/tests/large_metadata.c index b7d329cb74..ded5f17d4a 100644 --- a/test/core/bad_client/tests/large_metadata.c +++ b/test/core/bad_client/tests/large_metadata.c @@ -163,6 +163,7 @@ static void server_verifier_sends_too_much_metadata(grpc_server *server, meta.value_length = metadata_value_size; grpc_op op; + memset(&op, 0, sizeof(op)); op.op = GRPC_OP_SEND_INITIAL_METADATA; op.data.send_initial_metadata.count = 1; op.data.send_initial_metadata.metadata = &meta; diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c index c4ae212ec2..bb06ab0bb9 100644 --- a/test/core/bad_ssl/bad_ssl_test.c +++ b/test/core/bad_ssl/bad_ssl_test.c @@ -84,6 +84,7 @@ static void run_test(const char *target, size_t nops) { "/foo", "foo.test.google.fr:1234", deadline, NULL); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/bad_ssl/servers/cert.c b/test/core/bad_ssl/servers/cert.c index bd11efd314..91dd9de81b 100644 --- a/test/core/bad_ssl/servers/cert.c +++ b/test/core/bad_ssl/servers/cert.c @@ -38,7 +38,7 @@ #include <grpc/support/log.h> #include <grpc/support/useful.h> -#include "src/core/lib/support/load_file.h" +#include "src/core/lib/iomgr/load_file.h" #include "test/core/bad_ssl/server_common.h" #include "test/core/end2end/data/ssl_test_data.h" @@ -52,16 +52,15 @@ int main(int argc, char **argv) { grpc_server_credentials *ssl_creds; grpc_server *server; gpr_slice cert_slice, key_slice; - int ok; grpc_init(); - cert_slice = - gpr_load_file("src/core/lib/tsi/test_creds/badserver.pem", 1, &ok); - GPR_ASSERT(ok); - key_slice = - gpr_load_file("src/core/lib/tsi/test_creds/badserver.key", 1, &ok); - GPR_ASSERT(ok); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "load_file", grpc_load_file("src/core/lib/tsi/test_creds/badserver.pem", + 1, &cert_slice))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "load_file", grpc_load_file("src/core/lib/tsi/test_creds/badserver.key", + 1, &key_slice))); pem_key_cert_pair.private_key = (const char *)GPR_SLICE_START_PTR(key_slice); pem_key_cert_pair.cert_chain = (const char *)GPR_SLICE_START_PTR(cert_slice); diff --git a/test/core/channel/channel_args_test.c b/test/core/channel/channel_args_test.c index c2fc05095a..8ef1bff22e 100644 --- a/test/core/channel/channel_args_test.c +++ b/test/core/channel/channel_args_test.c @@ -136,8 +136,10 @@ static void test_compression_algorithm_states(void) { int main(int argc, char **argv) { grpc_test_init(argc, argv); + grpc_init(); test_create(); test_set_compression_algorithm(); test_compression_algorithm_states(); + grpc_shutdown(); return 0; } diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c index 1a5594bde8..f9561bed70 100644 --- a/test/core/channel/channel_stack_test.c +++ b/test/core/channel/channel_stack_test.c @@ -63,7 +63,7 @@ static void channel_destroy_func(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) {} static void call_destroy_func(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - void *ignored) { + const grpc_call_stats *stats, void *ignored) { ++*(int *)(elem->channel_data); } @@ -81,28 +81,30 @@ static char *get_peer(grpc_exec_ctx *exec_ctx, grpc_call_element *elem) { return gpr_strdup("peer"); } -static void free_channel(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void free_channel(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { grpc_channel_stack_destroy(exec_ctx, arg); gpr_free(arg); } -static void free_call(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - grpc_call_stack_destroy(exec_ctx, arg, NULL); +static void free_call(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { + grpc_call_stack_destroy(exec_ctx, arg, NULL, NULL); gpr_free(arg); } static void test_create_channel_stack(void) { - const grpc_channel_filter filter = {call_func, - channel_func, - sizeof(int), - call_init_func, - grpc_call_stack_ignore_set_pollset, - call_destroy_func, - sizeof(int), - channel_init_func, - channel_destroy_func, - get_peer, - "some_test_filter"}; + const grpc_channel_filter filter = { + call_func, + channel_func, + sizeof(int), + call_init_func, + grpc_call_stack_ignore_set_pollset_or_pollset_set, + call_destroy_func, + sizeof(int), + channel_init_func, + channel_destroy_func, + get_peer, + "some_test_filter"}; const grpc_channel_filter *filters = &filter; grpc_channel_stack *channel_stack; grpc_call_stack *call_stack; @@ -123,7 +125,7 @@ static void test_create_channel_stack(void) { channel_stack = gpr_malloc(grpc_channel_stack_size(&filters, 1)); grpc_channel_stack_init(&exec_ctx, 1, free_channel, channel_stack, &filters, - 1, &chan_args, "test", channel_stack); + 1, &chan_args, NULL, "test", channel_stack); GPR_ASSERT(channel_stack->count == 1); channel_elem = grpc_channel_stack_element(channel_stack, 0); channel_data = (int *)channel_elem->channel_data; diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c index 2ec46124a8..3160312db6 100644 --- a/test/core/client_config/lb_policies_test.c +++ b/test/core/client_config/lb_policies_test.c @@ -135,7 +135,7 @@ static void drain_cq(grpc_completion_queue *cq) { } static void kill_server(const servers_fixture *f, size_t i) { - gpr_log(GPR_INFO, "KILLING SERVER %d", i); + gpr_log(GPR_INFO, "KILLING SERVER %" PRIuPTR, i); GPR_ASSERT(f->servers[i] != NULL); grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); GPR_ASSERT( @@ -157,7 +157,7 @@ typedef struct request_data { static void revive_server(const servers_fixture *f, request_data *rdata, size_t i) { int got_port; - gpr_log(GPR_INFO, "RAISE AGAIN SERVER %d", i); + gpr_log(GPR_INFO, "RAISE AGAIN SERVER %" PRIuPTR, i); GPR_ASSERT(f->servers[i] == NULL); gpr_log(GPR_DEBUG, "revive: %s", f->servers_hostports[i]); @@ -275,6 +275,7 @@ static int *perform_request(servers_fixture *f, grpc_channel *client, GPR_ASSERT(c); completed_client = 0; + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -310,7 +311,7 @@ static int *perform_request(servers_fixture *f, grpc_channel *client, .type != GRPC_QUEUE_TIMEOUT) { GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); read_tag = ((int)(intptr_t)ev.tag); - gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%d", + gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%" PRIuPTR, ev.success, ev.type, read_tag, iter_num); if (ev.success && read_tag >= 1000) { GPR_ASSERT(s_idx == -1); /* only one server must reply */ @@ -327,6 +328,7 @@ static int *perform_request(servers_fixture *f, grpc_channel *client, } if (s_idx >= 0) { + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -415,6 +417,7 @@ static grpc_call **perform_multirequest(servers_fixture *f, kill_server(f, i); } + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -640,7 +643,8 @@ static void print_failed_expectations(const int *expected_connection_sequence, const size_t num_iters) { size_t i; for (i = 0; i < num_iters; i++) { - gpr_log(GPR_ERROR, "FAILURE: Iter, expected, actual:%d (%d, %d)", i, + gpr_log(GPR_ERROR, + "FAILURE: Iter (expected, actual): %" PRIuPTR " (%d, %d)", i, expected_connection_sequence[i % expected_seq_length], actual_connection_sequence[i]); } @@ -664,8 +668,6 @@ static void verify_vanilla_round_robin(const servers_fixture *f, const int actual = actual_connection_sequence[i]; const int expected = expected_connection_sequence[i % expected_seq_length]; if (actual != expected) { - gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %d", expected, - actual, i); print_failed_expectations(expected_connection_sequence, actual_connection_sequence, expected_seq_length, num_iters); @@ -692,24 +694,21 @@ static void verify_vanishing_floor_round_robin( memcpy(expected_connection_sequence, actual_connection_sequence + 2, expected_seq_length * sizeof(int)); - /* first three elements of the sequence should be [<1st>, -1] */ - if (actual_connection_sequence[0] != expected_connection_sequence[0]) { - gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %d", - expected_connection_sequence[0], actual_connection_sequence[0], 0); - print_failed_expectations(expected_connection_sequence, - actual_connection_sequence, expected_seq_length, - 1u); - abort(); - } - + /* first two elements of the sequence should be [0 (1st server), -1 (failure)] + */ + GPR_ASSERT(actual_connection_sequence[0] == 0); GPR_ASSERT(actual_connection_sequence[1] == -1); + /* the next two element must be [3, 0], repeating from that point: the 3 is + * brought forth by servers 1 and 2 disappearing after the intial pick of 0 */ + GPR_ASSERT(actual_connection_sequence[2] == 3); + GPR_ASSERT(actual_connection_sequence[3] == 0); + + /* make sure that the expectation obliges */ for (i = 2; i < num_iters; i++) { const int actual = actual_connection_sequence[i]; const int expected = expected_connection_sequence[i % expected_seq_length]; if (actual != expected) { - gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %d", expected, - actual, i); print_failed_expectations(expected_connection_sequence, actual_connection_sequence, expected_seq_length, num_iters); @@ -728,8 +727,8 @@ static void verify_total_carnage_round_robin( const int actual = actual_connection_sequence[i]; const int expected = -1; if (actual != expected) { - gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %d", expected, - actual, i); + gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %" PRIuPTR, + expected, actual, i); abort(); } } @@ -757,8 +756,6 @@ static void verify_partial_carnage_round_robin( const int actual = actual_connection_sequence[i]; const int expected = expected_connection_sequence[i % expected_seq_length]; if (actual != expected) { - gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %d", expected, - actual, i); print_failed_expectations(expected_connection_sequence, actual_connection_sequence, expected_seq_length, num_iters); @@ -856,8 +853,6 @@ static void verify_rebirth_round_robin(const servers_fixture *f, const int expected = expected_connection_sequence[j++ % expected_seq_length]; if (actual != expected) { - gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %d", expected, - actual, i); print_failed_expectations(expected_connection_sequence, actual_connection_sequence, expected_seq_length, num_iters); @@ -887,7 +882,8 @@ int main(int argc, char **argv) { GPR_ASSERT(grpc_lb_policy_create(&exec_ctx, NULL, NULL) == NULL); spec = test_spec_create(NUM_ITERS, NUM_SERVERS); - /* everything is fine, all servers stay up the whole time and life's peachy */ + /* everything is fine, all servers stay up the whole time and life's peachy + */ spec->verifier = verify_vanilla_round_robin; spec->description = "test_all_server_up"; run_spec(spec); diff --git a/test/core/client_config/resolvers/dns_resolver_connectivity_test.c b/test/core/client_config/resolvers/dns_resolver_connectivity_test.c index 2322aa688a..69c07d83f4 100644 --- a/test/core/client_config/resolvers/dns_resolver_connectivity_test.c +++ b/test/core/client_config/resolvers/dns_resolver_connectivity_test.c @@ -67,21 +67,21 @@ static grpc_client_channel_factory cc_factory = {&sc_vtable}; static gpr_mu g_mu; static bool g_fail_resolution = true; -static grpc_resolved_addresses *my_resolve_address(const char *name, - const char *addr) { +static grpc_error *my_resolve_address(const char *name, const char *addr, + grpc_resolved_addresses **addrs) { gpr_mu_lock(&g_mu); GPR_ASSERT(0 == strcmp("test", name)); if (g_fail_resolution) { g_fail_resolution = false; gpr_mu_unlock(&g_mu); - return NULL; + return GRPC_ERROR_CREATE("Forced Failure"); } else { gpr_mu_unlock(&g_mu); - grpc_resolved_addresses *addrs = gpr_malloc(sizeof(*addrs)); - addrs->naddrs = 1; - addrs->addrs = gpr_malloc(sizeof(*addrs->addrs)); - addrs->addrs[0].len = 123; - return addrs; + *addrs = gpr_malloc(sizeof(**addrs)); + (*addrs)->naddrs = 1; + (*addrs)->addrs = gpr_malloc(sizeof(*(*addrs)->addrs)); + (*addrs)->addrs[0].len = 123; + return GRPC_ERROR_NONE; } } @@ -100,7 +100,7 @@ static grpc_resolver *create_resolver(const char *name) { return resolver; } -static void on_done(grpc_exec_ctx *exec_ctx, void *ev, bool success) { +static void on_done(grpc_exec_ctx *exec_ctx, void *ev, grpc_error *error) { gpr_event_set(ev, (void *)1); } diff --git a/test/core/client_config/set_initial_connect_string_test.c b/test/core/client_config/set_initial_connect_string_test.c index 5390c4ab98..1b51424f7e 100644 --- a/test/core/client_config/set_initial_connect_string_test.c +++ b/test/core/client_config/set_initial_connect_string_test.c @@ -65,11 +65,11 @@ static int server_port; static struct rpc_state state; static grpc_closure on_read; -static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - GPR_ASSERT(success); +static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); gpr_slice_buffer_move_into(&state.temp_incoming_buffer, &state.incoming_buffer); - gpr_log(GPR_DEBUG, "got %d bytes, magic is %d bytes", + gpr_log(GPR_DEBUG, "got %" PRIuPTR " bytes, magic is %" PRIuPTR " bytes", state.incoming_buffer.length, strlen(magic_connect_string)); if (state.incoming_buffer.length > strlen(magic_connect_string)) { gpr_atm_rel_store(&state.done_atm, 1); @@ -136,6 +136,7 @@ static void start_rpc(int use_creds, int target_port) { state.call = grpc_channel_create_call( state.channel, NULL, GRPC_PROPAGATE_DEFAULTS, state.cq, "/Service/Method", "localhost", gpr_inf_future(GPR_CLOCK_REALTIME), NULL); + memset(&state.op, 0, sizeof(state.op)); state.op.op = GRPC_OP_SEND_INITIAL_METADATA; state.op.data.send_initial_metadata.count = 0; state.op.flags = 0; @@ -172,8 +173,8 @@ static void actually_poll_server(void *arg) { bool done = gpr_atm_acq_load(&state.done_atm) != 0; gpr_timespec time_left = gpr_time_sub(deadline, gpr_now(GPR_CLOCK_REALTIME)); - gpr_log(GPR_DEBUG, "done=%d, time_left=%d.%09d", done, time_left.tv_sec, - time_left.tv_nsec); + gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRId64 ".%09" PRId32, done, + time_left.tv_sec, time_left.tv_nsec); if (done || gpr_time_cmp(time_left, gpr_time_0(GPR_TIMESPAN)) < 0) { break; } diff --git a/test/core/client_config/uri_fuzzer_test.c b/test/core/client_config/uri_fuzzer_test.c index eb976fc9f5..f297140559 100644 --- a/test/core/client_config/uri_fuzzer_test.c +++ b/test/core/client_config/uri_fuzzer_test.c @@ -31,6 +31,7 @@ * */ +#include <stdbool.h> #include <stdint.h> #include <string.h> @@ -38,6 +39,9 @@ #include "src/core/ext/client_config/uri_parser.h" +bool squelch = true; +bool leak_check = true; + int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { char *s = gpr_malloc(size + 1); memcpy(s, data, size); diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c index 1a93903346..47ecf72e08 100644 --- a/test/core/compression/message_compress_test.c +++ b/test/core/compression/message_compress_test.c @@ -66,13 +66,14 @@ static void assert_passthrough(gpr_slice value, char *algorithm_name; GPR_ASSERT(grpc_compression_algorithm_name(algorithm, &algorithm_name) != 0); - gpr_log(GPR_INFO, - "assert_passthrough: value_length=%d value_hash=0x%08x " - "algorithm='%s' uncompressed_split='%s' compressed_split='%s'", - GPR_SLICE_LENGTH(value), gpr_murmur_hash3(GPR_SLICE_START_PTR(value), - GPR_SLICE_LENGTH(value), 0), - algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode), - grpc_slice_split_mode_name(compressed_split_mode)); + gpr_log( + GPR_INFO, "assert_passthrough: value_length=%" PRIuPTR + " value_hash=0x%08x " + "algorithm='%s' uncompressed_split='%s' compressed_split='%s'", + GPR_SLICE_LENGTH(value), + gpr_murmur_hash3(GPR_SLICE_START_PTR(value), GPR_SLICE_LENGTH(value), 0), + algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode), + grpc_slice_split_mode_name(compressed_split_mode)); gpr_slice_buffer_init(&input); gpr_slice_buffer_init(&compressed_raw); diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c index 77afe588d7..8e9fa70b0e 100644 --- a/test/core/end2end/cq_verifier.c +++ b/test/core/end2end/cq_verifier.c @@ -284,6 +284,6 @@ static expectation *add(cq_verifier *v, grpc_completion_type type, void *tag) { return e; } -void cq_expect_completion(cq_verifier *v, void *tag, int success) { +void cq_expect_completion(cq_verifier *v, void *tag, bool success) { add(v, GRPC_OP_COMPLETE, tag)->success = success; } diff --git a/test/core/end2end/cq_verifier.h b/test/core/end2end/cq_verifier.h index b3e07c45a5..8c9a85c218 100644 --- a/test/core/end2end/cq_verifier.h +++ b/test/core/end2end/cq_verifier.h @@ -34,6 +34,8 @@ #ifndef GRPC_TEST_CORE_END2END_CQ_VERIFIER_H #define GRPC_TEST_CORE_END2END_CQ_VERIFIER_H +#include <stdbool.h> + #include <grpc/grpc.h> #include "test/core/util/test_config.h" @@ -57,7 +59,7 @@ void cq_verify_empty(cq_verifier *v); Any functions taking ... expect a NULL terminated list of key/value pairs (each pair using two parameter slots) of metadata that MUST be present in the event. */ -void cq_expect_completion(cq_verifier *v, void *tag, int success); +void cq_expect_completion(cq_verifier *v, void *tag, bool success); int byte_buffer_eq_string(grpc_byte_buffer *byte_buffer, const char *string); int contains_metadata(grpc_metadata_array *array, const char *key, diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index 202fb3b6a8..65a8deb663 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -167,6 +167,7 @@ void test_connect(const char *server_host, const char *client_host, int port, "/foo", "foo.test.google.fr", deadline, NULL); GPR_ASSERT(c); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -201,6 +202,7 @@ void test_connect(const char *server_host, const char *client_host, int port, cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -271,7 +273,9 @@ void test_connect(const char *server_host, const char *client_host, int port, } int external_dns_works(const char *host) { - grpc_resolved_addresses *res = grpc_blocking_resolve_address(host, "80"); + grpc_resolved_addresses *res; + grpc_error *error = grpc_blocking_resolve_address(host, "80", &res); + GRPC_ERROR_UNREF(error); if (res != NULL) { grpc_resolved_addresses_destroy(res); return 1; diff --git a/test/core/end2end/end2end_nosec_tests.c b/test/core/end2end/end2end_nosec_tests.c index b71299c09e..2893bddc43 100644 --- a/test/core/end2end/end2end_nosec_tests.c +++ b/test/core/end2end/end2end_nosec_tests.c @@ -115,6 +115,8 @@ extern void simple_metadata(grpc_end2end_test_config config); extern void simple_metadata_pre_init(void); extern void simple_request(grpc_end2end_test_config config); extern void simple_request_pre_init(void); +extern void streaming_error_response(grpc_end2end_test_config config); +extern void streaming_error_response_pre_init(void); extern void trailing_metadata(grpc_end2end_test_config config); extern void trailing_metadata_pre_init(void); @@ -157,6 +159,7 @@ void grpc_end2end_tests_pre_init(void) { simple_delayed_request_pre_init(); simple_metadata_pre_init(); simple_request_pre_init(); + streaming_error_response_pre_init(); trailing_metadata_pre_init(); } @@ -203,6 +206,7 @@ void grpc_end2end_tests(int argc, char **argv, simple_delayed_request(config); simple_metadata(config); simple_request(config); + streaming_error_response(config); trailing_metadata(config); return; } @@ -352,6 +356,10 @@ void grpc_end2end_tests(int argc, char **argv, simple_request(config); continue; } + if (0 == strcmp("streaming_error_response", argv[i])) { + streaming_error_response(config); + continue; + } if (0 == strcmp("trailing_metadata", argv[i])) { trailing_metadata(config); continue; diff --git a/test/core/end2end/end2end_tests.c b/test/core/end2end/end2end_tests.c index 00c9c44a78..96a38e76dc 100644 --- a/test/core/end2end/end2end_tests.c +++ b/test/core/end2end/end2end_tests.c @@ -117,6 +117,8 @@ extern void simple_metadata(grpc_end2end_test_config config); extern void simple_metadata_pre_init(void); extern void simple_request(grpc_end2end_test_config config); extern void simple_request_pre_init(void); +extern void streaming_error_response(grpc_end2end_test_config config); +extern void streaming_error_response_pre_init(void); extern void trailing_metadata(grpc_end2end_test_config config); extern void trailing_metadata_pre_init(void); @@ -160,6 +162,7 @@ void grpc_end2end_tests_pre_init(void) { simple_delayed_request_pre_init(); simple_metadata_pre_init(); simple_request_pre_init(); + streaming_error_response_pre_init(); trailing_metadata_pre_init(); } @@ -207,6 +210,7 @@ void grpc_end2end_tests(int argc, char **argv, simple_delayed_request(config); simple_metadata(config); simple_request(config); + streaming_error_response(config); trailing_metadata(config); return; } @@ -360,6 +364,10 @@ void grpc_end2end_tests(int argc, char **argv, simple_request(config); continue; } + if (0 == strcmp("streaming_error_response", argv[i])) { + streaming_error_response(config); + continue; + } if (0 == strcmp("trailing_metadata", argv[i])) { trailing_metadata(config); continue; diff --git a/test/core/end2end/fixtures/h2_fd.c b/test/core/end2end/fixtures/h2_fd.c new file mode 100644 index 0000000000..89fa02517d --- /dev/null +++ b/test/core/end2end/fixtures/h2_fd.c @@ -0,0 +1,128 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/core/end2end/end2end_tests.h" + +#include <fcntl.h> +#include <string.h> + +#include <grpc/grpc.h> +#include <grpc/grpc_posix.h> +#include <grpc/support/alloc.h> +#include <grpc/support/log.h> +#include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/iomgr/socket_utils_posix.h" +#include "src/core/lib/iomgr/unix_sockets_posix.h" +#include "test/core/util/test_config.h" + +typedef struct { int fd_pair[2]; } sp_fixture_data; + +static void create_sockets(int sv[2]) { + int flags; + grpc_create_socketpair_if_unix(sv); + flags = fcntl(sv[0], F_GETFL, 0); + GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0); + flags = fcntl(sv[1], F_GETFL, 0); + GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0); + GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[0]) == GRPC_ERROR_NONE); + GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[1]) == GRPC_ERROR_NONE); +} + +static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( + grpc_channel_args *client_args, grpc_channel_args *server_args) { + sp_fixture_data *fixture_data = gpr_malloc(sizeof(*fixture_data)); + + grpc_end2end_test_fixture f; + memset(&f, 0, sizeof(f)); + f.fixture_data = fixture_data; + f.cq = grpc_completion_queue_create(NULL); + + create_sockets(fixture_data->fd_pair); + + return f; +} + +static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, + grpc_channel_args *client_args) { + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + sp_fixture_data *sfd = f->fixture_data; + + GPR_ASSERT(!f->client); + f->client = grpc_insecure_channel_create_from_fd( + "fixture_client", sfd->fd_pair[0], client_args); + GPR_ASSERT(f->client); + + grpc_exec_ctx_finish(&exec_ctx); +} + +static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, + grpc_channel_args *server_args) { + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + sp_fixture_data *sfd = f->fixture_data; + GPR_ASSERT(!f->server); + f->server = grpc_server_create(server_args, NULL); + GPR_ASSERT(f->server); + grpc_server_register_completion_queue(f->server, f->cq, NULL); + grpc_server_start(f->server); + + grpc_server_add_insecure_channel_from_fd(f->server, f->cq, sfd->fd_pair[1]); + + grpc_exec_ctx_finish(&exec_ctx); +} + +static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) { + gpr_free(f->fixture_data); +} + +/* All test configurations */ +static grpc_end2end_test_config configs[] = { + {"chttp2/fd", 0, chttp2_create_fixture_socketpair, + chttp2_init_client_socketpair, chttp2_init_server_socketpair, + chttp2_tear_down_socketpair}, +}; + +int main(int argc, char **argv) { + size_t i; + + grpc_test_init(argc, argv); + grpc_end2end_tests_pre_init(); + grpc_init(); + + for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) { + grpc_end2end_tests(argc, argv, configs[i]); + } + + grpc_shutdown(); + + return 0; +} diff --git a/test/core/end2end/fixtures/h2_loadreporting.c b/test/core/end2end/fixtures/h2_loadreporting.c new file mode 100644 index 0000000000..4ed02f9728 --- /dev/null +++ b/test/core/end2end/fixtures/h2_loadreporting.c @@ -0,0 +1,184 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/core/end2end/end2end_tests.h" + +#include <string.h> + +#include <grpc/support/alloc.h> +#include <grpc/support/host_port.h> +#include <grpc/support/log.h> +#include <grpc/support/sync.h> +#include <grpc/support/thd.h> +#include <grpc/support/useful.h> +#include "src/core/ext/client_config/client_channel.h" +#include "src/core/ext/load_reporting/load_reporting.h" +#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" +#include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" +#include "src/core/lib/surface/channel.h" +#include "src/core/lib/surface/server.h" +#include "test/core/util/port.h" +#include "test/core/util/test_config.h" + +static grpc_load_reporting_config *g_client_lrc; +static grpc_load_reporting_config *g_server_lrc; + +typedef struct fullstack_fixture_data { + char *localaddr; +} fullstack_fixture_data; + +static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( + grpc_channel_args *client_args, grpc_channel_args *server_args) { + grpc_end2end_test_fixture f; + int port = grpc_pick_unused_port_or_die(); + fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + memset(&f, 0, sizeof(f)); + + gpr_join_host_port(&ffd->localaddr, "localhost", port); + + f.fixture_data = ffd; + f.cq = grpc_completion_queue_create(NULL); + + return f; +} + +typedef struct { + int64_t total_bytes; + bool fully_processed; + uint32_t initial_token; + uint32_t final_token; +} aggregated_bw_stats; + +static void sample_fn(const grpc_load_reporting_call_data *call_data, + void *user_data) { + GPR_ASSERT(user_data != NULL); + aggregated_bw_stats *custom_stats = (aggregated_bw_stats *)user_data; + if (call_data == NULL) { + /* initial invocation */ + custom_stats->initial_token = 0xDEADBEEF; + } else { + /* final invocation */ + custom_stats->total_bytes = + (int64_t)(call_data->stats->transport_stream_stats.outgoing.data_bytes + + call_data->stats->transport_stream_stats.incoming.data_bytes); + custom_stats->final_token = 0xCAFED00D; + custom_stats->fully_processed = true; + } +} + +void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, + grpc_channel_args *client_args) { + fullstack_fixture_data *ffd = f->fixture_data; + grpc_arg arg = grpc_load_reporting_config_create_arg(g_client_lrc); + client_args = grpc_channel_args_copy_and_add(client_args, &arg, 1); + f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); + grpc_channel_args_destroy(client_args); + GPR_ASSERT(f->client); +} + +void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, + grpc_channel_args *server_args) { + fullstack_fixture_data *ffd = f->fixture_data; + if (f->server) { + grpc_server_destroy(f->server); + } + grpc_arg arg = grpc_load_reporting_config_create_arg(g_server_lrc); + server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1); + f->server = grpc_server_create(server_args, NULL); + grpc_channel_args_destroy(server_args); + grpc_server_register_completion_queue(f->server, f->cq, NULL); + GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr)); + grpc_server_start(f->server); +} + +void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { + fullstack_fixture_data *ffd = f->fixture_data; + gpr_free(ffd->localaddr); + gpr_free(ffd); +} + +/* All test configurations */ +static grpc_end2end_test_config configs[] = { + {"chttp2/fullstack+loadreporting", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION, + chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, + chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, +}; + +int main(int argc, char **argv) { + size_t i; + + aggregated_bw_stats *aggr_stats_client = + gpr_malloc(sizeof(aggregated_bw_stats)); + aggr_stats_client->total_bytes = -1; + aggr_stats_client->fully_processed = false; + aggregated_bw_stats *aggr_stats_server = + gpr_malloc(sizeof(aggregated_bw_stats)); + aggr_stats_server->total_bytes = -1; + aggr_stats_server->fully_processed = false; + + g_client_lrc = + grpc_load_reporting_config_create(sample_fn, aggr_stats_client); + g_server_lrc = + grpc_load_reporting_config_create(sample_fn, aggr_stats_server); + + grpc_test_init(argc, argv); + grpc_end2end_tests_pre_init(); + grpc_init(); + + for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) { + grpc_end2end_tests(argc, argv, configs[i]); + } + + grpc_shutdown(); + + grpc_load_reporting_config_destroy(g_client_lrc); + grpc_load_reporting_config_destroy(g_server_lrc); + + if (aggr_stats_client->fully_processed) { + GPR_ASSERT(aggr_stats_client->total_bytes >= 0); + GPR_ASSERT(aggr_stats_client->initial_token == 0xDEADBEEF); + GPR_ASSERT(aggr_stats_client->final_token == 0xCAFED00D); + } + if (aggr_stats_server->fully_processed) { + GPR_ASSERT(aggr_stats_server->total_bytes >= 0); + GPR_ASSERT(aggr_stats_server->initial_token == 0xDEADBEEF); + GPR_ASSERT(aggr_stats_server->final_token == 0xCAFED00D); + } + + gpr_free(aggr_stats_client); + gpr_free(aggr_stats_server); + + return 0; +} diff --git a/test/core/end2end/fixtures/h2_ssl_cert.c b/test/core/end2end/fixtures/h2_ssl_cert.c index 0fa525175b..b476bf5516 100644 --- a/test/core/end2end/fixtures/h2_ssl_cert.c +++ b/test/core/end2end/fixtures/h2_ssl_cert.c @@ -321,6 +321,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, NULL); GPR_ASSERT(c); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.c index 7f10649fa6..beed80df81 100644 --- a/test/core/end2end/fixtures/proxy.c +++ b/test/core/end2end/fixtures/proxy.c @@ -170,6 +170,7 @@ static void on_p2s_recv_initial_metadata(void *arg, int success) { grpc_op op; grpc_call_error err; + memset(&op, 0, sizeof(op)); if (!pc->proxy->shutdown) { op.op = GRPC_OP_SEND_INITIAL_METADATA; op.flags = 0; @@ -329,6 +330,7 @@ static void on_new_call(void *arg, int success) { if (success) { grpc_op op; + memset(&op, 0, sizeof(op)); proxy_call *pc = gpr_malloc(sizeof(*pc)); memset(pc, 0, sizeof(*pc)); pc->proxy = proxy; diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index e6cd88acee..13b8bf7561 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -50,7 +50,8 @@ //////////////////////////////////////////////////////////////////////////////// // logging -static const bool squelch = true; +bool squelch = true; +bool leak_check = true; static void dont_log(gpr_log_func_args *args) {} @@ -186,21 +187,25 @@ static gpr_timespec now_impl(gpr_clock_type clock_type) { typedef struct addr_req { grpc_timer timer; char *addr; - grpc_resolve_cb cb; - void *arg; + grpc_closure *on_done; + grpc_resolved_addresses **addrs; } addr_req; -static void finish_resolve(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void finish_resolve(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { addr_req *r = arg; - if (success && 0 == strcmp(r->addr, "server")) { + if (error == GRPC_ERROR_NONE && 0 == strcmp(r->addr, "server")) { grpc_resolved_addresses *addrs = gpr_malloc(sizeof(*addrs)); addrs->naddrs = 1; addrs->addrs = gpr_malloc(sizeof(*addrs->addrs)); addrs->addrs[0].len = 0; - r->cb(exec_ctx, r->arg, addrs); + *r->addrs = addrs; + grpc_exec_ctx_sched(exec_ctx, r->on_done, GRPC_ERROR_NONE, NULL); } else { - r->cb(exec_ctx, r->arg, NULL); + grpc_exec_ctx_sched( + exec_ctx, r->on_done, + GRPC_ERROR_CREATE_REFERENCING("Resolution failed", &error, 1), NULL); } gpr_free(r->addr); @@ -208,12 +213,12 @@ static void finish_resolve(grpc_exec_ctx *exec_ctx, void *arg, bool success) { } void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr, - const char *default_port, grpc_resolve_cb cb, - void *arg) { + const char *default_port, grpc_closure *on_done, + grpc_resolved_addresses **addresses) { addr_req *r = gpr_malloc(sizeof(*r)); r->addr = gpr_strdup(addr); - r->cb = cb; - r->arg = arg; + r->on_done = on_done; + r->addrs = addresses; grpc_timer_init(exec_ctx, &r->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), gpr_time_from_seconds(1, GPR_TIMESPAN)), @@ -239,11 +244,11 @@ typedef struct { gpr_timespec deadline; } future_connect; -static void do_connect(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void do_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { future_connect *fc = arg; - if (!success) { + if (error != GRPC_ERROR_NONE) { *fc->ep = NULL; - grpc_exec_ctx_enqueue(exec_ctx, fc->closure, false, NULL); + grpc_exec_ctx_sched(exec_ctx, fc->closure, GRPC_ERROR_REF(error), NULL); } else if (g_server != NULL) { grpc_endpoint *client; grpc_endpoint *server; @@ -255,7 +260,7 @@ static void do_connect(grpc_exec_ctx *exec_ctx, void *arg, bool success) { grpc_server_setup_transport(exec_ctx, g_server, transport, NULL, NULL); grpc_chttp2_transport_start_reading(exec_ctx, transport, NULL, 0); - grpc_exec_ctx_enqueue(exec_ctx, fc->closure, false, NULL); + grpc_exec_ctx_sched(exec_ctx, fc->closure, GRPC_ERROR_NONE, NULL); } else { sched_connect(exec_ctx, fc->closure, fc->ep, fc->deadline); } @@ -266,7 +271,8 @@ static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_endpoint **ep, gpr_timespec deadline) { if (gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) < 0) { *ep = NULL; - grpc_exec_ctx_enqueue(exec_ctx, closure, false, NULL); + grpc_exec_ctx_sched(exec_ctx, closure, + GRPC_ERROR_CREATE("Connect deadline exceeded"), NULL); return; } @@ -674,7 +680,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (g_channel != NULL) { grpc_connectivity_state st = grpc_channel_check_connectivity_state(g_channel, 0); - if (st != GRPC_CHANNEL_FATAL_FAILURE) { + if (st != GRPC_CHANNEL_SHUTDOWN) { gpr_timespec deadline = gpr_time_add( gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_micros(read_uint32(&inp), GPR_TIMESPAN)); @@ -739,6 +745,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { break; } grpc_op *ops = gpr_malloc(sizeof(grpc_op) * num_ops); + memset(ops, 0, sizeof(grpc_op) * num_ops); bool ok = true; size_t i; grpc_op *op; diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0170e921ff5d052b228a26529116ea47fe9d3f0b b/test/core/end2end/fuzzers/api_fuzzer_corpus/0170e921ff5d052b228a26529116ea47fe9d3f0b Binary files differnew file mode 100644 index 0000000000..e837f03018 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0170e921ff5d052b228a26529116ea47fe9d3f0b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/01a344a0256386cc8abb8dcb65cb55e1244f7f97 b/test/core/end2end/fuzzers/api_fuzzer_corpus/01a344a0256386cc8abb8dcb65cb55e1244f7f97 Binary files differnew file mode 100644 index 0000000000..5ec993f3d0 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/01a344a0256386cc8abb8dcb65cb55e1244f7f97 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/01c59f0a030fa11c4af1b7c0cc85846e9ef3f6b9 b/test/core/end2end/fuzzers/api_fuzzer_corpus/01c59f0a030fa11c4af1b7c0cc85846e9ef3f6b9 Binary files differnew file mode 100644 index 0000000000..a836e0560d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/01c59f0a030fa11c4af1b7c0cc85846e9ef3f6b9 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/06b63ac01c261518e291461fb4707cb29d74e9c5 b/test/core/end2end/fuzzers/api_fuzzer_corpus/06b63ac01c261518e291461fb4707cb29d74e9c5 Binary files differnew file mode 100644 index 0000000000..8d2f820a8f --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/06b63ac01c261518e291461fb4707cb29d74e9c5 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/06eced19ea6819d7b0855c62da49a193b50067ab b/test/core/end2end/fuzzers/api_fuzzer_corpus/06eced19ea6819d7b0855c62da49a193b50067ab Binary files differnew file mode 100644 index 0000000000..ea4fa72470 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/06eced19ea6819d7b0855c62da49a193b50067ab diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/06eee533524c6723881c1591956edf704e0180d9 b/test/core/end2end/fuzzers/api_fuzzer_corpus/06eee533524c6723881c1591956edf704e0180d9 Binary files differnew file mode 100644 index 0000000000..4335fc754f --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/06eee533524c6723881c1591956edf704e0180d9 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0783c943aa7cdb8fdef5f7b1cf73e2bb2daf17f4 b/test/core/end2end/fuzzers/api_fuzzer_corpus/0783c943aa7cdb8fdef5f7b1cf73e2bb2daf17f4 Binary files differnew file mode 100644 index 0000000000..f8b4c6e787 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0783c943aa7cdb8fdef5f7b1cf73e2bb2daf17f4 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0963f5f7578c64e9c17d0ad9e4a99ced875cf813 b/test/core/end2end/fuzzers/api_fuzzer_corpus/0963f5f7578c64e9c17d0ad9e4a99ced875cf813 Binary files differnew file mode 100644 index 0000000000..bcff00690d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0963f5f7578c64e9c17d0ad9e4a99ced875cf813 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0a90826e3173642be15ea005c2cbe8ca36ac1c3d b/test/core/end2end/fuzzers/api_fuzzer_corpus/0a90826e3173642be15ea005c2cbe8ca36ac1c3d Binary files differnew file mode 100644 index 0000000000..bb6cf96d27 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0a90826e3173642be15ea005c2cbe8ca36ac1c3d diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0b151bf8080f87bd38c9b8521b3b96c40c708463 b/test/core/end2end/fuzzers/api_fuzzer_corpus/0b151bf8080f87bd38c9b8521b3b96c40c708463 Binary files differnew file mode 100644 index 0000000000..8459a6629e --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0b151bf8080f87bd38c9b8521b3b96c40c708463 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0bf51cb435845a49311a7ddc7341b5cfc8e5ab10 b/test/core/end2end/fuzzers/api_fuzzer_corpus/0bf51cb435845a49311a7ddc7341b5cfc8e5ab10 Binary files differnew file mode 100644 index 0000000000..b919511a28 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0bf51cb435845a49311a7ddc7341b5cfc8e5ab10 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0deeaca17aa93f66291407d3d2438685be5b85ba b/test/core/end2end/fuzzers/api_fuzzer_corpus/0deeaca17aa93f66291407d3d2438685be5b85ba Binary files differnew file mode 100644 index 0000000000..14680a821b --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0deeaca17aa93f66291407d3d2438685be5b85ba diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0dfd0ea582476b3861106c143c70d7af0f3d1357 b/test/core/end2end/fuzzers/api_fuzzer_corpus/0dfd0ea582476b3861106c143c70d7af0f3d1357 Binary files differnew file mode 100644 index 0000000000..3695055b6c --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0dfd0ea582476b3861106c143c70d7af0f3d1357 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0e79b68aa8b9c336f0bbf9029928c53079711423 b/test/core/end2end/fuzzers/api_fuzzer_corpus/0e79b68aa8b9c336f0bbf9029928c53079711423 Binary files differnew file mode 100644 index 0000000000..5b16d9d759 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0e79b68aa8b9c336f0bbf9029928c53079711423 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/0e91ce40cf8882adc75b8b532556d48a2b605ced b/test/core/end2end/fuzzers/api_fuzzer_corpus/0e91ce40cf8882adc75b8b532556d48a2b605ced Binary files differnew file mode 100644 index 0000000000..9d0b4159f7 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/0e91ce40cf8882adc75b8b532556d48a2b605ced diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/10f53c34f02d8c051fe0b8759aec08057433a497 b/test/core/end2end/fuzzers/api_fuzzer_corpus/10f53c34f02d8c051fe0b8759aec08057433a497 Binary files differnew file mode 100644 index 0000000000..471890c4c9 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/10f53c34f02d8c051fe0b8759aec08057433a497 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/110e019793b395202dfd8b499edc372cdaccff21 b/test/core/end2end/fuzzers/api_fuzzer_corpus/110e019793b395202dfd8b499edc372cdaccff21 Binary files differnew file mode 100644 index 0000000000..3a148cc127 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/110e019793b395202dfd8b499edc372cdaccff21 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/1239eef13562df4ff59856900eee2f871a2fd0f3 b/test/core/end2end/fuzzers/api_fuzzer_corpus/1239eef13562df4ff59856900eee2f871a2fd0f3 Binary files differnew file mode 100644 index 0000000000..ce1c1bf3bf --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/1239eef13562df4ff59856900eee2f871a2fd0f3 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/1560af88445d6c1e8b1300047f33056dce198e02 b/test/core/end2end/fuzzers/api_fuzzer_corpus/1560af88445d6c1e8b1300047f33056dce198e02 Binary files differnew file mode 100644 index 0000000000..008dcac29a --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/1560af88445d6c1e8b1300047f33056dce198e02 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/15890f893ee7bddcc08f831d684b10d19c369def b/test/core/end2end/fuzzers/api_fuzzer_corpus/15890f893ee7bddcc08f831d684b10d19c369def Binary files differnew file mode 100644 index 0000000000..6d80a11982 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/15890f893ee7bddcc08f831d684b10d19c369def diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/1727c0f6369bfb17d1b40ffa3d3f6b8be8a45c62 b/test/core/end2end/fuzzers/api_fuzzer_corpus/1727c0f6369bfb17d1b40ffa3d3f6b8be8a45c62 Binary files differnew file mode 100644 index 0000000000..8c8a1036b8 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/1727c0f6369bfb17d1b40ffa3d3f6b8be8a45c62 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/179817dab786637b3621ace60a9ab4c7c79432a4 b/test/core/end2end/fuzzers/api_fuzzer_corpus/179817dab786637b3621ace60a9ab4c7c79432a4 Binary files differnew file mode 100644 index 0000000000..cf3531fe41 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/179817dab786637b3621ace60a9ab4c7c79432a4 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/17fa8e029e35c88857b7abcad88609cf2d1ca9a4 b/test/core/end2end/fuzzers/api_fuzzer_corpus/17fa8e029e35c88857b7abcad88609cf2d1ca9a4 Binary files differnew file mode 100644 index 0000000000..83c2b4f3dc --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/17fa8e029e35c88857b7abcad88609cf2d1ca9a4 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/1870298c7042983e7716097018a031d105e397fd b/test/core/end2end/fuzzers/api_fuzzer_corpus/1870298c7042983e7716097018a031d105e397fd Binary files differnew file mode 100644 index 0000000000..42a78f4eb6 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/1870298c7042983e7716097018a031d105e397fd diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/1917c5996ac82e13143a414eb9448f171fdd751a b/test/core/end2end/fuzzers/api_fuzzer_corpus/1917c5996ac82e13143a414eb9448f171fdd751a Binary files differnew file mode 100644 index 0000000000..dc4176be67 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/1917c5996ac82e13143a414eb9448f171fdd751a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/19549ded404f9a9581d32a1827da96ff1420f0ae b/test/core/end2end/fuzzers/api_fuzzer_corpus/19549ded404f9a9581d32a1827da96ff1420f0ae Binary files differnew file mode 100644 index 0000000000..116ac96c36 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/19549ded404f9a9581d32a1827da96ff1420f0ae diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/1b09a1e5994952cda58b8339492f6850936a61f4 b/test/core/end2end/fuzzers/api_fuzzer_corpus/1b09a1e5994952cda58b8339492f6850936a61f4 Binary files differnew file mode 100644 index 0000000000..86af616087 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/1b09a1e5994952cda58b8339492f6850936a61f4 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/1cd257e53b8d5a57c9feabcfd9f8f22c30cdb4a8 b/test/core/end2end/fuzzers/api_fuzzer_corpus/1cd257e53b8d5a57c9feabcfd9f8f22c30cdb4a8 Binary files differnew file mode 100644 index 0000000000..3c4a5486ed --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/1cd257e53b8d5a57c9feabcfd9f8f22c30cdb4a8 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/1fd33a83549fb9fc5e7d05a2c308a044b7c9b167 b/test/core/end2end/fuzzers/api_fuzzer_corpus/1fd33a83549fb9fc5e7d05a2c308a044b7c9b167 Binary files differnew file mode 100644 index 0000000000..8385f54c72 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/1fd33a83549fb9fc5e7d05a2c308a044b7c9b167 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/202a15693f991889b5fdd97f016a5410778b07e1 b/test/core/end2end/fuzzers/api_fuzzer_corpus/202a15693f991889b5fdd97f016a5410778b07e1 Binary files differnew file mode 100644 index 0000000000..70df23d052 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/202a15693f991889b5fdd97f016a5410778b07e1 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/20a10c9a0c8cc48fd6317000f70070a0b2451e60 b/test/core/end2end/fuzzers/api_fuzzer_corpus/20a10c9a0c8cc48fd6317000f70070a0b2451e60 Binary files differnew file mode 100644 index 0000000000..9baa758e75 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/20a10c9a0c8cc48fd6317000f70070a0b2451e60 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/21357c3613a47180eb668b1c6c849ce9096a46eb b/test/core/end2end/fuzzers/api_fuzzer_corpus/21357c3613a47180eb668b1c6c849ce9096a46eb Binary files differnew file mode 100644 index 0000000000..4ed1578c8d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/21357c3613a47180eb668b1c6c849ce9096a46eb diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2372fe3d96fda1dae8846a781905c6c408555d3a b/test/core/end2end/fuzzers/api_fuzzer_corpus/2372fe3d96fda1dae8846a781905c6c408555d3a Binary files differnew file mode 100644 index 0000000000..d29897c239 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2372fe3d96fda1dae8846a781905c6c408555d3a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/23982956d17d2f55e61a5d9111b1c0c7ee530214 b/test/core/end2end/fuzzers/api_fuzzer_corpus/23982956d17d2f55e61a5d9111b1c0c7ee530214 Binary files differnew file mode 100644 index 0000000000..146b1b6e52 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/23982956d17d2f55e61a5d9111b1c0c7ee530214 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/25a2c5d4f55a083d2535b46a82e295fb169ffb32 b/test/core/end2end/fuzzers/api_fuzzer_corpus/25a2c5d4f55a083d2535b46a82e295fb169ffb32 Binary files differnew file mode 100644 index 0000000000..e3e284b7ab --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/25a2c5d4f55a083d2535b46a82e295fb169ffb32 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2721f5503254227af744243957ee859fa903e066 b/test/core/end2end/fuzzers/api_fuzzer_corpus/2721f5503254227af744243957ee859fa903e066 Binary files differnew file mode 100644 index 0000000000..a14f605806 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2721f5503254227af744243957ee859fa903e066 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/282003073c8b88d7ad43ce75677777cdb754228c b/test/core/end2end/fuzzers/api_fuzzer_corpus/282003073c8b88d7ad43ce75677777cdb754228c Binary files differnew file mode 100644 index 0000000000..154f3bd6f9 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/282003073c8b88d7ad43ce75677777cdb754228c diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2858613c057a236dbe306cca44df29232f6b48b3 b/test/core/end2end/fuzzers/api_fuzzer_corpus/2858613c057a236dbe306cca44df29232f6b48b3 Binary files differnew file mode 100644 index 0000000000..8f934748e7 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2858613c057a236dbe306cca44df29232f6b48b3 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/295d24a7705fe1821606f9224f241a7596481bed b/test/core/end2end/fuzzers/api_fuzzer_corpus/295d24a7705fe1821606f9224f241a7596481bed Binary files differnew file mode 100644 index 0000000000..58a4814491 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/295d24a7705fe1821606f9224f241a7596481bed diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2a08eb351e08f0e6ac1e1416b43ff962a4e3735c b/test/core/end2end/fuzzers/api_fuzzer_corpus/2a08eb351e08f0e6ac1e1416b43ff962a4e3735c Binary files differnew file mode 100644 index 0000000000..c1a88b04ff --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2a08eb351e08f0e6ac1e1416b43ff962a4e3735c diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2a1d70b04f4aba0ec93899485f0807a209a4b207 b/test/core/end2end/fuzzers/api_fuzzer_corpus/2a1d70b04f4aba0ec93899485f0807a209a4b207 Binary files differnew file mode 100644 index 0000000000..a04bc00691 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2a1d70b04f4aba0ec93899485f0807a209a4b207 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2a2ca2f6a1c03067f87bad61515688edc234bacc b/test/core/end2end/fuzzers/api_fuzzer_corpus/2a2ca2f6a1c03067f87bad61515688edc234bacc Binary files differnew file mode 100644 index 0000000000..48d26daa5a --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2a2ca2f6a1c03067f87bad61515688edc234bacc diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2aaee068ca624dcb746af9dc14591b24db033ffc b/test/core/end2end/fuzzers/api_fuzzer_corpus/2aaee068ca624dcb746af9dc14591b24db033ffc Binary files differnew file mode 100644 index 0000000000..ee202ea181 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2aaee068ca624dcb746af9dc14591b24db033ffc diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2ce30739d22f5380f96400f261fd26e95cc33927 b/test/core/end2end/fuzzers/api_fuzzer_corpus/2ce30739d22f5380f96400f261fd26e95cc33927 Binary files differnew file mode 100644 index 0000000000..725aa45654 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2ce30739d22f5380f96400f261fd26e95cc33927 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2e40d861a9fec3742c31971b583e28bf40e28dbe b/test/core/end2end/fuzzers/api_fuzzer_corpus/2e40d861a9fec3742c31971b583e28bf40e28dbe Binary files differnew file mode 100644 index 0000000000..8159fcb3ee --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2e40d861a9fec3742c31971b583e28bf40e28dbe diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2ec78409a7d3625126387512a1c58cae2ff0bcf7 b/test/core/end2end/fuzzers/api_fuzzer_corpus/2ec78409a7d3625126387512a1c58cae2ff0bcf7 Binary files differnew file mode 100644 index 0000000000..387120ddce --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2ec78409a7d3625126387512a1c58cae2ff0bcf7 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/2ffb878075ebb3d2d778c8aabcb0e96cb51060f0 b/test/core/end2end/fuzzers/api_fuzzer_corpus/2ffb878075ebb3d2d778c8aabcb0e96cb51060f0 Binary files differnew file mode 100644 index 0000000000..cb10119c1a --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/2ffb878075ebb3d2d778c8aabcb0e96cb51060f0 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/30c74b7b5c92bb602d26c3d703c267e288b432a2 b/test/core/end2end/fuzzers/api_fuzzer_corpus/30c74b7b5c92bb602d26c3d703c267e288b432a2 Binary files differnew file mode 100644 index 0000000000..c2552d60f3 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/30c74b7b5c92bb602d26c3d703c267e288b432a2 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/31498be283beb45294fb96f15b3af4e7de0ce584 b/test/core/end2end/fuzzers/api_fuzzer_corpus/31498be283beb45294fb96f15b3af4e7de0ce584 Binary files differnew file mode 100644 index 0000000000..dfad08ccaa --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/31498be283beb45294fb96f15b3af4e7de0ce584 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/314ea0a2c481639b6559b063399299259c43c9bb b/test/core/end2end/fuzzers/api_fuzzer_corpus/314ea0a2c481639b6559b063399299259c43c9bb Binary files differnew file mode 100644 index 0000000000..6a068384a3 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/314ea0a2c481639b6559b063399299259c43c9bb diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/31ef9c4ed85ae1b4e8a027fc5a1d3037dbbf3b3a b/test/core/end2end/fuzzers/api_fuzzer_corpus/31ef9c4ed85ae1b4e8a027fc5a1d3037dbbf3b3a Binary files differnew file mode 100644 index 0000000000..2edcd8e592 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/31ef9c4ed85ae1b4e8a027fc5a1d3037dbbf3b3a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/327e5a755e3307b121700f1ba23000a844e70596 b/test/core/end2end/fuzzers/api_fuzzer_corpus/327e5a755e3307b121700f1ba23000a844e70596 Binary files differnew file mode 100644 index 0000000000..b2152ccbe1 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/327e5a755e3307b121700f1ba23000a844e70596 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/3396a31b1075465bf358eb7836e6f5347a0be591 b/test/core/end2end/fuzzers/api_fuzzer_corpus/3396a31b1075465bf358eb7836e6f5347a0be591 Binary files differnew file mode 100644 index 0000000000..8dd0ffc90d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/3396a31b1075465bf358eb7836e6f5347a0be591 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/350a1f6d0fe784667d7ae78e1ed783cdf2263bfd b/test/core/end2end/fuzzers/api_fuzzer_corpus/350a1f6d0fe784667d7ae78e1ed783cdf2263bfd Binary files differnew file mode 100644 index 0000000000..83f2053a99 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/350a1f6d0fe784667d7ae78e1ed783cdf2263bfd diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/35cf9a1a6f81db0829d854fd3716916bae081c8c b/test/core/end2end/fuzzers/api_fuzzer_corpus/35cf9a1a6f81db0829d854fd3716916bae081c8c Binary files differnew file mode 100644 index 0000000000..836e04a1bd --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/35cf9a1a6f81db0829d854fd3716916bae081c8c diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/368f9368e43f7e743653d46360836b3db1b1ba8a b/test/core/end2end/fuzzers/api_fuzzer_corpus/368f9368e43f7e743653d46360836b3db1b1ba8a Binary files differnew file mode 100644 index 0000000000..dae7009170 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/368f9368e43f7e743653d46360836b3db1b1ba8a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/36dea0ab5bc764c2eb2f428bcbe2786e64da8bd3 b/test/core/end2end/fuzzers/api_fuzzer_corpus/36dea0ab5bc764c2eb2f428bcbe2786e64da8bd3 Binary files differnew file mode 100644 index 0000000000..5f8de544f2 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/36dea0ab5bc764c2eb2f428bcbe2786e64da8bd3 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/376f42635e918cc28706b82ad8923cc7401aa9e6 b/test/core/end2end/fuzzers/api_fuzzer_corpus/376f42635e918cc28706b82ad8923cc7401aa9e6 Binary files differnew file mode 100644 index 0000000000..32500f8c58 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/376f42635e918cc28706b82ad8923cc7401aa9e6 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/37cf256347732e86fa92089847b7381e964cc83f b/test/core/end2end/fuzzers/api_fuzzer_corpus/37cf256347732e86fa92089847b7381e964cc83f Binary files differnew file mode 100644 index 0000000000..a737c85a24 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/37cf256347732e86fa92089847b7381e964cc83f diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/38eb06643f87fff21483433dc4169e0388b0c9e1 b/test/core/end2end/fuzzers/api_fuzzer_corpus/38eb06643f87fff21483433dc4169e0388b0c9e1 Binary files differnew file mode 100644 index 0000000000..ff983d57b8 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/38eb06643f87fff21483433dc4169e0388b0c9e1 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/3b114f7e66bf6cbf256a5e656ab6620e3f31277f b/test/core/end2end/fuzzers/api_fuzzer_corpus/3b114f7e66bf6cbf256a5e656ab6620e3f31277f Binary files differnew file mode 100644 index 0000000000..1be83994d7 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/3b114f7e66bf6cbf256a5e656ab6620e3f31277f diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/3db644687c6a09fae4267f05b63a969f28024f87 b/test/core/end2end/fuzzers/api_fuzzer_corpus/3db644687c6a09fae4267f05b63a969f28024f87 Binary files differnew file mode 100644 index 0000000000..1a3281138d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/3db644687c6a09fae4267f05b63a969f28024f87 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/3dc1bcb27ed0616a2b905025a8898759d94a934d b/test/core/end2end/fuzzers/api_fuzzer_corpus/3dc1bcb27ed0616a2b905025a8898759d94a934d Binary files differnew file mode 100644 index 0000000000..a4a8de45e8 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/3dc1bcb27ed0616a2b905025a8898759d94a934d diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/3f2e5f90e1a93df61a1c9c09b8c9116149eec526 b/test/core/end2end/fuzzers/api_fuzzer_corpus/3f2e5f90e1a93df61a1c9c09b8c9116149eec526 Binary files differnew file mode 100644 index 0000000000..d1451d487f --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/3f2e5f90e1a93df61a1c9c09b8c9116149eec526 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/3f31d328c16207904d201406f7e9708360d5799b b/test/core/end2end/fuzzers/api_fuzzer_corpus/3f31d328c16207904d201406f7e9708360d5799b Binary files differnew file mode 100644 index 0000000000..4791cfd373 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/3f31d328c16207904d201406f7e9708360d5799b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/4141d93d6c387967967844423a6a83ad1793010a b/test/core/end2end/fuzzers/api_fuzzer_corpus/4141d93d6c387967967844423a6a83ad1793010a Binary files differnew file mode 100644 index 0000000000..9fd03853b6 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/4141d93d6c387967967844423a6a83ad1793010a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/48caf755ddcc6c45d3416ba6ab44709f360eb82b b/test/core/end2end/fuzzers/api_fuzzer_corpus/48caf755ddcc6c45d3416ba6ab44709f360eb82b Binary files differnew file mode 100644 index 0000000000..f29e9a7983 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/48caf755ddcc6c45d3416ba6ab44709f360eb82b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/4a4675803915c9dafe85b8026c93a0ca9c498233 b/test/core/end2end/fuzzers/api_fuzzer_corpus/4a4675803915c9dafe85b8026c93a0ca9c498233 Binary files differnew file mode 100644 index 0000000000..e72cdf2f27 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/4a4675803915c9dafe85b8026c93a0ca9c498233 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/4d345f45f808c5b0541976b5dff98c603611e9ab b/test/core/end2end/fuzzers/api_fuzzer_corpus/4d345f45f808c5b0541976b5dff98c603611e9ab Binary files differnew file mode 100644 index 0000000000..47c4276301 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/4d345f45f808c5b0541976b5dff98c603611e9ab diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/4d5e7091c1c67867f2760543d9a8a7256007bdef b/test/core/end2end/fuzzers/api_fuzzer_corpus/4d5e7091c1c67867f2760543d9a8a7256007bdef Binary files differnew file mode 100644 index 0000000000..418b06b4a2 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/4d5e7091c1c67867f2760543d9a8a7256007bdef diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/4e8dbf3eb7d11a4fdb994f281454be2a7ebb091c b/test/core/end2end/fuzzers/api_fuzzer_corpus/4e8dbf3eb7d11a4fdb994f281454be2a7ebb091c Binary files differnew file mode 100644 index 0000000000..c2895f60f9 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/4e8dbf3eb7d11a4fdb994f281454be2a7ebb091c diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/4eedb47e422ce761fc5b279582e56c7d1f3ed180 b/test/core/end2end/fuzzers/api_fuzzer_corpus/4eedb47e422ce761fc5b279582e56c7d1f3ed180 Binary files differnew file mode 100644 index 0000000000..e75ebcfda9 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/4eedb47e422ce761fc5b279582e56c7d1f3ed180 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/5109721ea8f74b08d455968fce90dd74c29aa95a b/test/core/end2end/fuzzers/api_fuzzer_corpus/5109721ea8f74b08d455968fce90dd74c29aa95a Binary files differnew file mode 100644 index 0000000000..b0fc4c1d84 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/5109721ea8f74b08d455968fce90dd74c29aa95a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/51be7e2267e32f2eb8079349882f8247dc397d0f b/test/core/end2end/fuzzers/api_fuzzer_corpus/51be7e2267e32f2eb8079349882f8247dc397d0f Binary files differnew file mode 100644 index 0000000000..3071957e72 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/51be7e2267e32f2eb8079349882f8247dc397d0f diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/521e1e27b0997a0dc168f628e8a0497f7f93ea6d b/test/core/end2end/fuzzers/api_fuzzer_corpus/521e1e27b0997a0dc168f628e8a0497f7f93ea6d Binary files differnew file mode 100644 index 0000000000..60a88d4c89 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/521e1e27b0997a0dc168f628e8a0497f7f93ea6d diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/541e87b9d3dc75ad40cb47935ed4de83b25af5b9 b/test/core/end2end/fuzzers/api_fuzzer_corpus/541e87b9d3dc75ad40cb47935ed4de83b25af5b9 Binary files differnew file mode 100644 index 0000000000..4eabbd5a8f --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/541e87b9d3dc75ad40cb47935ed4de83b25af5b9 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/5611060a04db105e03cc74da57352b8a09c411e0 b/test/core/end2end/fuzzers/api_fuzzer_corpus/5611060a04db105e03cc74da57352b8a09c411e0 Binary files differnew file mode 100644 index 0000000000..cd30ed8f27 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/5611060a04db105e03cc74da57352b8a09c411e0 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/56e0bd235d4ea1de80d753b2b12d03d43cd0aa06 b/test/core/end2end/fuzzers/api_fuzzer_corpus/56e0bd235d4ea1de80d753b2b12d03d43cd0aa06 Binary files differnew file mode 100644 index 0000000000..9bd9fe4ad4 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/56e0bd235d4ea1de80d753b2b12d03d43cd0aa06 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/57d4ef9e72f97aa8a1e6689f3be092fc2b24315c b/test/core/end2end/fuzzers/api_fuzzer_corpus/57d4ef9e72f97aa8a1e6689f3be092fc2b24315c Binary files differnew file mode 100644 index 0000000000..59226aa05f --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/57d4ef9e72f97aa8a1e6689f3be092fc2b24315c diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/5967be7b53e3bac677c726d30a513949e06e1fde b/test/core/end2end/fuzzers/api_fuzzer_corpus/5967be7b53e3bac677c726d30a513949e06e1fde Binary files differnew file mode 100644 index 0000000000..76c0024049 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/5967be7b53e3bac677c726d30a513949e06e1fde diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/598c513564bc043f831876ea61cb8283d43f6726 b/test/core/end2end/fuzzers/api_fuzzer_corpus/598c513564bc043f831876ea61cb8283d43f6726 Binary files differnew file mode 100644 index 0000000000..9c9acf2777 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/598c513564bc043f831876ea61cb8283d43f6726 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/59db3f98b38747d4a35524c1b3d31b5e90f53775 b/test/core/end2end/fuzzers/api_fuzzer_corpus/59db3f98b38747d4a35524c1b3d31b5e90f53775 Binary files differnew file mode 100644 index 0000000000..46274c5b74 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/59db3f98b38747d4a35524c1b3d31b5e90f53775 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/5c37a2f980223e737574dba8239378f643800c28 b/test/core/end2end/fuzzers/api_fuzzer_corpus/5c37a2f980223e737574dba8239378f643800c28 Binary files differnew file mode 100644 index 0000000000..3e3432fc62 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/5c37a2f980223e737574dba8239378f643800c28 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/5ddce6103cb33bc58571c8135b620443740e3646 b/test/core/end2end/fuzzers/api_fuzzer_corpus/5ddce6103cb33bc58571c8135b620443740e3646 Binary files differnew file mode 100644 index 0000000000..05798a6b7d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/5ddce6103cb33bc58571c8135b620443740e3646 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/5e31ededf3b3189d252148c450de7a8778653e72 b/test/core/end2end/fuzzers/api_fuzzer_corpus/5e31ededf3b3189d252148c450de7a8778653e72 Binary files differnew file mode 100644 index 0000000000..f8d4762cd5 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/5e31ededf3b3189d252148c450de7a8778653e72 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/5f61659c332f6153f9a59746bc02064155443b4a b/test/core/end2end/fuzzers/api_fuzzer_corpus/5f61659c332f6153f9a59746bc02064155443b4a Binary files differnew file mode 100644 index 0000000000..790bcc1f0b --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/5f61659c332f6153f9a59746bc02064155443b4a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/60ad6847b1fe72ee81decf28dcffa30ce372af6a b/test/core/end2end/fuzzers/api_fuzzer_corpus/60ad6847b1fe72ee81decf28dcffa30ce372af6a Binary files differnew file mode 100644 index 0000000000..c113b0b3b9 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/60ad6847b1fe72ee81decf28dcffa30ce372af6a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6245a105123761558a71a9207b3048d2f3d691f0 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6245a105123761558a71a9207b3048d2f3d691f0 Binary files differnew file mode 100644 index 0000000000..ea9e457b77 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6245a105123761558a71a9207b3048d2f3d691f0 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6619768ddd830ebe29021e827961fddb78751086 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6619768ddd830ebe29021e827961fddb78751086 Binary files differnew file mode 100644 index 0000000000..2508dc04f0 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6619768ddd830ebe29021e827961fddb78751086 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/682fdabcfc7243e9c93108d6b2d7d3e920e81970 b/test/core/end2end/fuzzers/api_fuzzer_corpus/682fdabcfc7243e9c93108d6b2d7d3e920e81970 Binary files differnew file mode 100644 index 0000000000..0138558e44 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/682fdabcfc7243e9c93108d6b2d7d3e920e81970 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6ad7afcf2d12025faf0e1812ee7a0a5d754620c6 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6ad7afcf2d12025faf0e1812ee7a0a5d754620c6 Binary files differnew file mode 100644 index 0000000000..c45f7e8dda --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6ad7afcf2d12025faf0e1812ee7a0a5d754620c6 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6ae8b3afc4f6e3a26fec5eaeb2bf64727927552b b/test/core/end2end/fuzzers/api_fuzzer_corpus/6ae8b3afc4f6e3a26fec5eaeb2bf64727927552b Binary files differnew file mode 100644 index 0000000000..041803801e --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6ae8b3afc4f6e3a26fec5eaeb2bf64727927552b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6be9f2d2967566ac929c27a27de40af792a6da90 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6be9f2d2967566ac929c27a27de40af792a6da90 Binary files differnew file mode 100644 index 0000000000..fb7267a703 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6be9f2d2967566ac929c27a27de40af792a6da90 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6c34a6b47ef9e11e02f7675087d888c2c994b010 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6c34a6b47ef9e11e02f7675087d888c2c994b010 Binary files differnew file mode 100644 index 0000000000..243e93f3d0 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6c34a6b47ef9e11e02f7675087d888c2c994b010 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6ce0f95767e8b1c58ff313d10f1a3eb1f9ab8496 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6ce0f95767e8b1c58ff313d10f1a3eb1f9ab8496 Binary files differnew file mode 100644 index 0000000000..f1dcb2c260 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6ce0f95767e8b1c58ff313d10f1a3eb1f9ab8496 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6cfe000a50ad8b908b3efa3af94c5df6382ff33d b/test/core/end2end/fuzzers/api_fuzzer_corpus/6cfe000a50ad8b908b3efa3af94c5df6382ff33d Binary files differnew file mode 100644 index 0000000000..56618545ad --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6cfe000a50ad8b908b3efa3af94c5df6382ff33d diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6d6d70df4499b8595851100ffb833d397cc87a18 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6d6d70df4499b8595851100ffb833d397cc87a18 Binary files differnew file mode 100644 index 0000000000..1a770cc52e --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6d6d70df4499b8595851100ffb833d397cc87a18 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6e3d43e98d7be45ecc1863eedfeb85a4cae4a007 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6e3d43e98d7be45ecc1863eedfeb85a4cae4a007 Binary files differnew file mode 100644 index 0000000000..38e2e33721 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6e3d43e98d7be45ecc1863eedfeb85a4cae4a007 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6e77e1cd328bb98d954043230716863c5133c1c4 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6e77e1cd328bb98d954043230716863c5133c1c4 Binary files differnew file mode 100644 index 0000000000..f321eab18d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6e77e1cd328bb98d954043230716863c5133c1c4 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/6f68ff31046fd15930657516873b8835fdbadfe3 b/test/core/end2end/fuzzers/api_fuzzer_corpus/6f68ff31046fd15930657516873b8835fdbadfe3 Binary files differnew file mode 100644 index 0000000000..be37cac366 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/6f68ff31046fd15930657516873b8835fdbadfe3 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/7030cb2c62b289459e459bc54bd84c8d7e6f5a98 b/test/core/end2end/fuzzers/api_fuzzer_corpus/7030cb2c62b289459e459bc54bd84c8d7e6f5a98 Binary files differnew file mode 100644 index 0000000000..035f23e899 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/7030cb2c62b289459e459bc54bd84c8d7e6f5a98 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/71f9eafe17e974062938a6a12433ce723fe07d40 b/test/core/end2end/fuzzers/api_fuzzer_corpus/71f9eafe17e974062938a6a12433ce723fe07d40 Binary files differnew file mode 100644 index 0000000000..51cc9f8928 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/71f9eafe17e974062938a6a12433ce723fe07d40 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/72160b48e0995ee82f116d77a7fb23a028c10932 b/test/core/end2end/fuzzers/api_fuzzer_corpus/72160b48e0995ee82f116d77a7fb23a028c10932 Binary files differnew file mode 100644 index 0000000000..be6505ac15 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/72160b48e0995ee82f116d77a7fb23a028c10932 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/756d77e9fb9ed9dac1db0b1c8cdcc6e05e47329b b/test/core/end2end/fuzzers/api_fuzzer_corpus/756d77e9fb9ed9dac1db0b1c8cdcc6e05e47329b Binary files differnew file mode 100644 index 0000000000..e662e294a8 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/756d77e9fb9ed9dac1db0b1c8cdcc6e05e47329b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/7590589db6b56b4e7db9333fba8d723b6461e0a6 b/test/core/end2end/fuzzers/api_fuzzer_corpus/7590589db6b56b4e7db9333fba8d723b6461e0a6 Binary files differnew file mode 100644 index 0000000000..93a98b4927 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/7590589db6b56b4e7db9333fba8d723b6461e0a6 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/75a242a8e6a0c453ac785fe6495d408e9650e17d b/test/core/end2end/fuzzers/api_fuzzer_corpus/75a242a8e6a0c453ac785fe6495d408e9650e17d Binary files differnew file mode 100644 index 0000000000..0198181523 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/75a242a8e6a0c453ac785fe6495d408e9650e17d diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/78d8b2a1732c4528d6acdb21c236f417a0f85798 b/test/core/end2end/fuzzers/api_fuzzer_corpus/78d8b2a1732c4528d6acdb21c236f417a0f85798 Binary files differnew file mode 100644 index 0000000000..77c2b2864c --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/78d8b2a1732c4528d6acdb21c236f417a0f85798 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/79975e5fb34f3569b0d2e40d34d6f7ab1bf82cf2 b/test/core/end2end/fuzzers/api_fuzzer_corpus/79975e5fb34f3569b0d2e40d34d6f7ab1bf82cf2 Binary files differnew file mode 100644 index 0000000000..ad1b3b317f --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/79975e5fb34f3569b0d2e40d34d6f7ab1bf82cf2 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/7b44a92a28ff5c96be7c4dae5c56a9e5fa272ad3 b/test/core/end2end/fuzzers/api_fuzzer_corpus/7b44a92a28ff5c96be7c4dae5c56a9e5fa272ad3 Binary files differnew file mode 100644 index 0000000000..dac2af4edb --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/7b44a92a28ff5c96be7c4dae5c56a9e5fa272ad3 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/7cfe9fd65c3daa43067dfc99dac2814b763b9f48 b/test/core/end2end/fuzzers/api_fuzzer_corpus/7cfe9fd65c3daa43067dfc99dac2814b763b9f48 Binary files differnew file mode 100644 index 0000000000..372e293e43 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/7cfe9fd65c3daa43067dfc99dac2814b763b9f48 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/7d3ff63f0b0019fef80e5e3cd82de8dfbcd07103 b/test/core/end2end/fuzzers/api_fuzzer_corpus/7d3ff63f0b0019fef80e5e3cd82de8dfbcd07103 Binary files differnew file mode 100644 index 0000000000..0f58ec75eb --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/7d3ff63f0b0019fef80e5e3cd82de8dfbcd07103 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/7f2a2a365669c88559036ed998b074b1b9a31e0b b/test/core/end2end/fuzzers/api_fuzzer_corpus/7f2a2a365669c88559036ed998b074b1b9a31e0b Binary files differnew file mode 100644 index 0000000000..be6cc539f7 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/7f2a2a365669c88559036ed998b074b1b9a31e0b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/81437c61aeca9becc91003af7b835dc65a3e03e4 b/test/core/end2end/fuzzers/api_fuzzer_corpus/81437c61aeca9becc91003af7b835dc65a3e03e4 Binary files differnew file mode 100644 index 0000000000..72700d75a3 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/81437c61aeca9becc91003af7b835dc65a3e03e4 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/81f8c545d77d93e6cb8239e9e4a4d7f8f8beeee9 b/test/core/end2end/fuzzers/api_fuzzer_corpus/81f8c545d77d93e6cb8239e9e4a4d7f8f8beeee9 Binary files differnew file mode 100644 index 0000000000..a16874c541 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/81f8c545d77d93e6cb8239e9e4a4d7f8f8beeee9 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/8272e45483cb4cc7113b0ffad71f9218542f9cd7 b/test/core/end2end/fuzzers/api_fuzzer_corpus/8272e45483cb4cc7113b0ffad71f9218542f9cd7 Binary files differnew file mode 100644 index 0000000000..0da408ead0 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/8272e45483cb4cc7113b0ffad71f9218542f9cd7 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/83e2bd562704e16ac57589b4273d0c61775d7c9c b/test/core/end2end/fuzzers/api_fuzzer_corpus/83e2bd562704e16ac57589b4273d0c61775d7c9c Binary files differnew file mode 100644 index 0000000000..40de3dcbc4 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/83e2bd562704e16ac57589b4273d0c61775d7c9c diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/84505278558cc406dc36109deab239f1e4cf1518 b/test/core/end2end/fuzzers/api_fuzzer_corpus/84505278558cc406dc36109deab239f1e4cf1518 Binary files differnew file mode 100644 index 0000000000..d681d33a29 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/84505278558cc406dc36109deab239f1e4cf1518 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/8525fa2b11288eda66418be4ecfcf8d7731d75a6 b/test/core/end2end/fuzzers/api_fuzzer_corpus/8525fa2b11288eda66418be4ecfcf8d7731d75a6 Binary files differnew file mode 100644 index 0000000000..b723cc19b8 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/8525fa2b11288eda66418be4ecfcf8d7731d75a6 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/85a50177266a832eca0563d37ccb03890f12c665 b/test/core/end2end/fuzzers/api_fuzzer_corpus/85a50177266a832eca0563d37ccb03890f12c665 Binary files differnew file mode 100644 index 0000000000..7c2870f1f2 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/85a50177266a832eca0563d37ccb03890f12c665 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/85afba0cb1eb440ed95ee5793a70c7e5d8465148 b/test/core/end2end/fuzzers/api_fuzzer_corpus/85afba0cb1eb440ed95ee5793a70c7e5d8465148 Binary files differnew file mode 100644 index 0000000000..1fc35b79f3 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/85afba0cb1eb440ed95ee5793a70c7e5d8465148 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/871196ccb877b7c6c7d6cafe3324fde440706de3 b/test/core/end2end/fuzzers/api_fuzzer_corpus/871196ccb877b7c6c7d6cafe3324fde440706de3 Binary files differnew file mode 100644 index 0000000000..81d2d757b6 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/871196ccb877b7c6c7d6cafe3324fde440706de3 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/8a13b47235d2967f5a5419cb0ad8d241a750a365 b/test/core/end2end/fuzzers/api_fuzzer_corpus/8a13b47235d2967f5a5419cb0ad8d241a750a365 Binary files differnew file mode 100644 index 0000000000..ca96913a47 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/8a13b47235d2967f5a5419cb0ad8d241a750a365 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/8a6ccd18dbc530ed34afd4a73beeff0449040c25 b/test/core/end2end/fuzzers/api_fuzzer_corpus/8a6ccd18dbc530ed34afd4a73beeff0449040c25 Binary files differnew file mode 100644 index 0000000000..93fc40f581 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/8a6ccd18dbc530ed34afd4a73beeff0449040c25 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/8bdd4dc6dee56fb6965655425ca378f784a42b6a b/test/core/end2end/fuzzers/api_fuzzer_corpus/8bdd4dc6dee56fb6965655425ca378f784a42b6a Binary files differnew file mode 100644 index 0000000000..b54fd86456 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/8bdd4dc6dee56fb6965655425ca378f784a42b6a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/8c6776521d0f100708ecb9f8504e572d586b8a21 b/test/core/end2end/fuzzers/api_fuzzer_corpus/8c6776521d0f100708ecb9f8504e572d586b8a21 Binary files differnew file mode 100644 index 0000000000..be00bec404 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/8c6776521d0f100708ecb9f8504e572d586b8a21 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/8de197bbdf4deaea5bd21af25c0b5c5f03b231ae b/test/core/end2end/fuzzers/api_fuzzer_corpus/8de197bbdf4deaea5bd21af25c0b5c5f03b231ae Binary files differnew file mode 100644 index 0000000000..5a98f90555 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/8de197bbdf4deaea5bd21af25c0b5c5f03b231ae diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/8e226a7f67b7c6e9d439c3627bfa5644af992593 b/test/core/end2end/fuzzers/api_fuzzer_corpus/8e226a7f67b7c6e9d439c3627bfa5644af992593 Binary files differnew file mode 100644 index 0000000000..a08862a965 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/8e226a7f67b7c6e9d439c3627bfa5644af992593 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/908b1f170a721682465838d0c0eca40810beb722 b/test/core/end2end/fuzzers/api_fuzzer_corpus/908b1f170a721682465838d0c0eca40810beb722 Binary files differnew file mode 100644 index 0000000000..f0dbace491 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/908b1f170a721682465838d0c0eca40810beb722 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/92882ccad7fc3e7bc1df7dfa5954a6d591d5dbc2 b/test/core/end2end/fuzzers/api_fuzzer_corpus/92882ccad7fc3e7bc1df7dfa5954a6d591d5dbc2 Binary files differnew file mode 100644 index 0000000000..b53afb9b94 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/92882ccad7fc3e7bc1df7dfa5954a6d591d5dbc2 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/92a87c7a2f2e336f92529bc40deee614dd8b4486 b/test/core/end2end/fuzzers/api_fuzzer_corpus/92a87c7a2f2e336f92529bc40deee614dd8b4486 Binary files differnew file mode 100644 index 0000000000..4d31488b22 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/92a87c7a2f2e336f92529bc40deee614dd8b4486 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/92e8c16eb9a816c5944ecb76cf9af08f05930aeb b/test/core/end2end/fuzzers/api_fuzzer_corpus/92e8c16eb9a816c5944ecb76cf9af08f05930aeb Binary files differnew file mode 100644 index 0000000000..ddc69e3f1b --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/92e8c16eb9a816c5944ecb76cf9af08f05930aeb diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/9345e2de4f0476428d941c53013535fbda8a2bca b/test/core/end2end/fuzzers/api_fuzzer_corpus/9345e2de4f0476428d941c53013535fbda8a2bca Binary files differnew file mode 100644 index 0000000000..634bfbc7a4 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/9345e2de4f0476428d941c53013535fbda8a2bca diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/97539b673cb482cfa4d876df515270611b28f22a b/test/core/end2end/fuzzers/api_fuzzer_corpus/97539b673cb482cfa4d876df515270611b28f22a Binary files differnew file mode 100644 index 0000000000..7d23be7cd6 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/97539b673cb482cfa4d876df515270611b28f22a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/9b014aa18fb8c033458b6d5fdb351e60d16e8bce b/test/core/end2end/fuzzers/api_fuzzer_corpus/9b014aa18fb8c033458b6d5fdb351e60d16e8bce Binary files differnew file mode 100644 index 0000000000..8c676b28b0 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/9b014aa18fb8c033458b6d5fdb351e60d16e8bce diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/9bbb726cd811fce33aecdbcce3d287c252ed71d5 b/test/core/end2end/fuzzers/api_fuzzer_corpus/9bbb726cd811fce33aecdbcce3d287c252ed71d5 Binary files differnew file mode 100644 index 0000000000..e6bd6e3c43 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/9bbb726cd811fce33aecdbcce3d287c252ed71d5 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/9dd5d09e1538e12b091c35d252ee43684d0f07bd b/test/core/end2end/fuzzers/api_fuzzer_corpus/9dd5d09e1538e12b091c35d252ee43684d0f07bd Binary files differnew file mode 100644 index 0000000000..79ca267660 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/9dd5d09e1538e12b091c35d252ee43684d0f07bd diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/9fd5c58979d17905e46ee7b76f542f7acb54d60f b/test/core/end2end/fuzzers/api_fuzzer_corpus/9fd5c58979d17905e46ee7b76f542f7acb54d60f Binary files differnew file mode 100644 index 0000000000..b612d8b88c --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/9fd5c58979d17905e46ee7b76f542f7acb54d60f diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a001745aa3499a11bf1cee1af077bdc85a03ef95 b/test/core/end2end/fuzzers/api_fuzzer_corpus/a001745aa3499a11bf1cee1af077bdc85a03ef95 Binary files differnew file mode 100644 index 0000000000..97fb1db450 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a001745aa3499a11bf1cee1af077bdc85a03ef95 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a151b36f390273fb440d2e35ab93acc5540bfed6 b/test/core/end2end/fuzzers/api_fuzzer_corpus/a151b36f390273fb440d2e35ab93acc5540bfed6 Binary files differnew file mode 100644 index 0000000000..502c838eca --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a151b36f390273fb440d2e35ab93acc5540bfed6 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a19cc971908189b5febf6fb5e8578c91dd666715 b/test/core/end2end/fuzzers/api_fuzzer_corpus/a19cc971908189b5febf6fb5e8578c91dd666715 Binary files differnew file mode 100644 index 0000000000..8e331bc106 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a19cc971908189b5febf6fb5e8578c91dd666715 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a1b0fdbc2160dfe8c1eed409eb60042c819a843a b/test/core/end2end/fuzzers/api_fuzzer_corpus/a1b0fdbc2160dfe8c1eed409eb60042c819a843a Binary files differnew file mode 100644 index 0000000000..028ca0e58d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a1b0fdbc2160dfe8c1eed409eb60042c819a843a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a36a34472604c8107353872e77a84873ff8a9170 b/test/core/end2end/fuzzers/api_fuzzer_corpus/a36a34472604c8107353872e77a84873ff8a9170 Binary files differnew file mode 100644 index 0000000000..5a660eb6ee --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a36a34472604c8107353872e77a84873ff8a9170 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a3fcf35a54c8c88b5cc1ef76e43124bb25b61ba3 b/test/core/end2end/fuzzers/api_fuzzer_corpus/a3fcf35a54c8c88b5cc1ef76e43124bb25b61ba3 Binary files differnew file mode 100644 index 0000000000..722b611df3 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a3fcf35a54c8c88b5cc1ef76e43124bb25b61ba3 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a44288607b76ce6df9fe7e196138a587cf4badc9 b/test/core/end2end/fuzzers/api_fuzzer_corpus/a44288607b76ce6df9fe7e196138a587cf4badc9 Binary files differnew file mode 100644 index 0000000000..095e02e090 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a44288607b76ce6df9fe7e196138a587cf4badc9 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a7ccc1f7db49512983fe4d42c16b2160357e3585 b/test/core/end2end/fuzzers/api_fuzzer_corpus/a7ccc1f7db49512983fe4d42c16b2160357e3585 Binary files differnew file mode 100644 index 0000000000..8185b0f4ba --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a7ccc1f7db49512983fe4d42c16b2160357e3585 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a7d45318db68aea203c6f661f571394b649cfd86 b/test/core/end2end/fuzzers/api_fuzzer_corpus/a7d45318db68aea203c6f661f571394b649cfd86 Binary files differnew file mode 100644 index 0000000000..1928f47400 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a7d45318db68aea203c6f661f571394b649cfd86 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/a8b5f205a578696697bc1ca381e73501c3a9b185 b/test/core/end2end/fuzzers/api_fuzzer_corpus/a8b5f205a578696697bc1ca381e73501c3a9b185 Binary files differnew file mode 100644 index 0000000000..29b2bc16c3 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/a8b5f205a578696697bc1ca381e73501c3a9b185 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/aa0c7fda7faff932bf36e10d15ab2180ab1bca27 b/test/core/end2end/fuzzers/api_fuzzer_corpus/aa0c7fda7faff932bf36e10d15ab2180ab1bca27 Binary files differnew file mode 100644 index 0000000000..dad34fea3b --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/aa0c7fda7faff932bf36e10d15ab2180ab1bca27 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/acd5d85336bff9b38196c682864dd7a4965ac904 b/test/core/end2end/fuzzers/api_fuzzer_corpus/acd5d85336bff9b38196c682864dd7a4965ac904 Binary files differnew file mode 100644 index 0000000000..87dd9ee02d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/acd5d85336bff9b38196c682864dd7a4965ac904 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b06102e16c740796a9d30e07b9e564b65f7513da b/test/core/end2end/fuzzers/api_fuzzer_corpus/b06102e16c740796a9d30e07b9e564b65f7513da Binary files differnew file mode 100644 index 0000000000..70517fdf5d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b06102e16c740796a9d30e07b9e564b65f7513da diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b1e28018e26e6baaba5a907e5e6ff9b7a7942018 b/test/core/end2end/fuzzers/api_fuzzer_corpus/b1e28018e26e6baaba5a907e5e6ff9b7a7942018 Binary files differnew file mode 100644 index 0000000000..31e40bfa13 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b1e28018e26e6baaba5a907e5e6ff9b7a7942018 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b2c5f4f8e2129a4201b2525cba8723241bbd8c79 b/test/core/end2end/fuzzers/api_fuzzer_corpus/b2c5f4f8e2129a4201b2525cba8723241bbd8c79 Binary files differnew file mode 100644 index 0000000000..61188e2bde --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b2c5f4f8e2129a4201b2525cba8723241bbd8c79 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b4b8ba878466fc6c4e1939e38c38aa64026b055b b/test/core/end2end/fuzzers/api_fuzzer_corpus/b4b8ba878466fc6c4e1939e38c38aa64026b055b Binary files differnew file mode 100644 index 0000000000..3187f6ae15 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b4b8ba878466fc6c4e1939e38c38aa64026b055b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b4f6d203097dcd1778f4a912cdc3af96ffb681de b/test/core/end2end/fuzzers/api_fuzzer_corpus/b4f6d203097dcd1778f4a912cdc3af96ffb681de Binary files differnew file mode 100644 index 0000000000..5804a7632a --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b4f6d203097dcd1778f4a912cdc3af96ffb681de diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b51db02b904ceee344fe48179d0c784c59ca2934 b/test/core/end2end/fuzzers/api_fuzzer_corpus/b51db02b904ceee344fe48179d0c784c59ca2934 Binary files differnew file mode 100644 index 0000000000..352df6c020 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b51db02b904ceee344fe48179d0c784c59ca2934 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b63da75ca24aac41285dd14de6712179a3fbc0d1 b/test/core/end2end/fuzzers/api_fuzzer_corpus/b63da75ca24aac41285dd14de6712179a3fbc0d1 Binary files differnew file mode 100644 index 0000000000..22e3abc5e4 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b63da75ca24aac41285dd14de6712179a3fbc0d1 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b6ce8604e3c14c6867cd2a78cef144ddd2fbb4c1 b/test/core/end2end/fuzzers/api_fuzzer_corpus/b6ce8604e3c14c6867cd2a78cef144ddd2fbb4c1 Binary files differnew file mode 100644 index 0000000000..55fcf2676b --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b6ce8604e3c14c6867cd2a78cef144ddd2fbb4c1 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b79553c903c06619d53395ee67896c1554def055 b/test/core/end2end/fuzzers/api_fuzzer_corpus/b79553c903c06619d53395ee67896c1554def055 Binary files differnew file mode 100644 index 0000000000..55fdc1eb8e --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b79553c903c06619d53395ee67896c1554def055 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b7c3f40ef32cd843e331fb49521c0d614dfbecc9 b/test/core/end2end/fuzzers/api_fuzzer_corpus/b7c3f40ef32cd843e331fb49521c0d614dfbecc9 Binary files differnew file mode 100644 index 0000000000..4b010f4f22 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b7c3f40ef32cd843e331fb49521c0d614dfbecc9 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b7d02f4d12cd0b5442a04675e69f98fbdabc775a b/test/core/end2end/fuzzers/api_fuzzer_corpus/b7d02f4d12cd0b5442a04675e69f98fbdabc775a Binary files differnew file mode 100644 index 0000000000..6f1edf5851 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b7d02f4d12cd0b5442a04675e69f98fbdabc775a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b8bedb9c38fd149bc494a65674a4af5e61dfb311 b/test/core/end2end/fuzzers/api_fuzzer_corpus/b8bedb9c38fd149bc494a65674a4af5e61dfb311 Binary files differnew file mode 100644 index 0000000000..a9c00734ef --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b8bedb9c38fd149bc494a65674a4af5e61dfb311 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/b9eb50c5eb99cf0b419efa2cb8d7fdf2e71f6634 b/test/core/end2end/fuzzers/api_fuzzer_corpus/b9eb50c5eb99cf0b419efa2cb8d7fdf2e71f6634 Binary files differnew file mode 100644 index 0000000000..00d6aa2a2c --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/b9eb50c5eb99cf0b419efa2cb8d7fdf2e71f6634 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ba46bf502f75c1e66fb89e18c270da8e5a62207f b/test/core/end2end/fuzzers/api_fuzzer_corpus/ba46bf502f75c1e66fb89e18c270da8e5a62207f Binary files differnew file mode 100644 index 0000000000..44f9cd9f11 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ba46bf502f75c1e66fb89e18c270da8e5a62207f diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/bb74226288b9d3a163029a25857bbebe84227222 b/test/core/end2end/fuzzers/api_fuzzer_corpus/bb74226288b9d3a163029a25857bbebe84227222 Binary files differnew file mode 100644 index 0000000000..bf7879ec7b --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/bb74226288b9d3a163029a25857bbebe84227222 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/bdfa6991c33f312c46ac27bdd8089be1670f0ac2 b/test/core/end2end/fuzzers/api_fuzzer_corpus/bdfa6991c33f312c46ac27bdd8089be1670f0ac2 Binary files differnew file mode 100644 index 0000000000..2c7c25c063 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/bdfa6991c33f312c46ac27bdd8089be1670f0ac2 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/bf5923216eb069edaf4e135ab7ee426c04d99a25 b/test/core/end2end/fuzzers/api_fuzzer_corpus/bf5923216eb069edaf4e135ab7ee426c04d99a25 Binary files differnew file mode 100644 index 0000000000..f1363ceff8 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/bf5923216eb069edaf4e135ab7ee426c04d99a25 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/c09288284e4859b8a85421b19d3c6d0109cdab08 b/test/core/end2end/fuzzers/api_fuzzer_corpus/c09288284e4859b8a85421b19d3c6d0109cdab08 Binary files differnew file mode 100644 index 0000000000..e56b7a7f15 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/c09288284e4859b8a85421b19d3c6d0109cdab08 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/c77bd1e9d9be2b6d1362cbb15f63cf749aa113ea b/test/core/end2end/fuzzers/api_fuzzer_corpus/c77bd1e9d9be2b6d1362cbb15f63cf749aa113ea Binary files differnew file mode 100644 index 0000000000..d56d793d15 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/c77bd1e9d9be2b6d1362cbb15f63cf749aa113ea diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/c845faac6d4b713a232aa3a6749afdf4e58d7f6a b/test/core/end2end/fuzzers/api_fuzzer_corpus/c845faac6d4b713a232aa3a6749afdf4e58d7f6a Binary files differnew file mode 100644 index 0000000000..9bf4b9687f --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/c845faac6d4b713a232aa3a6749afdf4e58d7f6a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/c8b5d9fdb7ade3538abb794a3231d5777a1640a4 b/test/core/end2end/fuzzers/api_fuzzer_corpus/c8b5d9fdb7ade3538abb794a3231d5777a1640a4 Binary files differnew file mode 100644 index 0000000000..51af2b71f4 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/c8b5d9fdb7ade3538abb794a3231d5777a1640a4 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ca5a1e4fccc55aa977b841d8d67e6991a4371860 b/test/core/end2end/fuzzers/api_fuzzer_corpus/ca5a1e4fccc55aa977b841d8d67e6991a4371860 Binary files differnew file mode 100644 index 0000000000..6b34269318 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ca5a1e4fccc55aa977b841d8d67e6991a4371860 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/cd4272fec464c45438dce72eb9381971ed0207de b/test/core/end2end/fuzzers/api_fuzzer_corpus/cd4272fec464c45438dce72eb9381971ed0207de Binary files differnew file mode 100644 index 0000000000..949e154e3c --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/cd4272fec464c45438dce72eb9381971ed0207de diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/cd7cf401276531cea7e4221f249f527f231a5bcb b/test/core/end2end/fuzzers/api_fuzzer_corpus/cd7cf401276531cea7e4221f249f527f231a5bcb Binary files differnew file mode 100644 index 0000000000..603c37907e --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/cd7cf401276531cea7e4221f249f527f231a5bcb diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ce6a90cb7d395fea7aa54ee9f7061cc45f5494d7 b/test/core/end2end/fuzzers/api_fuzzer_corpus/ce6a90cb7d395fea7aa54ee9f7061cc45f5494d7 Binary files differnew file mode 100644 index 0000000000..c5c9c27938 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ce6a90cb7d395fea7aa54ee9f7061cc45f5494d7 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/cea57d6a128cc7cd195cb2390bfde28047d6acf8 b/test/core/end2end/fuzzers/api_fuzzer_corpus/cea57d6a128cc7cd195cb2390bfde28047d6acf8 Binary files differnew file mode 100644 index 0000000000..97dcc4f304 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/cea57d6a128cc7cd195cb2390bfde28047d6acf8 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/crash-40e0fcf83e934a4ea2d31c009e9dfc1e68f11f3a b/test/core/end2end/fuzzers/api_fuzzer_corpus/crash-40e0fcf83e934a4ea2d31c009e9dfc1e68f11f3a Binary files differnew file mode 100644 index 0000000000..63b1a91450 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/crash-40e0fcf83e934a4ea2d31c009e9dfc1e68f11f3a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/crash-482e9bdce0e13df2a77eef75a1c07d38ee28f4ab b/test/core/end2end/fuzzers/api_fuzzer_corpus/crash-482e9bdce0e13df2a77eef75a1c07d38ee28f4ab Binary files differnew file mode 100644 index 0000000000..b83e382f18 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/crash-482e9bdce0e13df2a77eef75a1c07d38ee28f4ab diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d02fb86e7e236a2253a2eadb0599f5dc261e4048 b/test/core/end2end/fuzzers/api_fuzzer_corpus/d02fb86e7e236a2253a2eadb0599f5dc261e4048 Binary files differnew file mode 100644 index 0000000000..f73c10927a --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d02fb86e7e236a2253a2eadb0599f5dc261e4048 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d07965987a51541498871433e0fc6313884569d3 b/test/core/end2end/fuzzers/api_fuzzer_corpus/d07965987a51541498871433e0fc6313884569d3 Binary files differnew file mode 100644 index 0000000000..6106a4e696 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d07965987a51541498871433e0fc6313884569d3 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d19a252c00c74403389fe9e057cffeee39a4d2e0 b/test/core/end2end/fuzzers/api_fuzzer_corpus/d19a252c00c74403389fe9e057cffeee39a4d2e0 Binary files differnew file mode 100644 index 0000000000..964a500134 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d19a252c00c74403389fe9e057cffeee39a4d2e0 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d1d35a1d2148c62c6021479d4153e65511b33cc1 b/test/core/end2end/fuzzers/api_fuzzer_corpus/d1d35a1d2148c62c6021479d4153e65511b33cc1 Binary files differnew file mode 100644 index 0000000000..2f0696b179 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d1d35a1d2148c62c6021479d4153e65511b33cc1 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d29cf6979d8d58b4cb779a629ebee62d7e42fc9b b/test/core/end2end/fuzzers/api_fuzzer_corpus/d29cf6979d8d58b4cb779a629ebee62d7e42fc9b Binary files differnew file mode 100644 index 0000000000..b6daf7691e --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d29cf6979d8d58b4cb779a629ebee62d7e42fc9b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d425e534ec074932b5cf4dc9a6cf4fc0683fd690 b/test/core/end2end/fuzzers/api_fuzzer_corpus/d425e534ec074932b5cf4dc9a6cf4fc0683fd690 Binary files differnew file mode 100644 index 0000000000..5c8828e612 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d425e534ec074932b5cf4dc9a6cf4fc0683fd690 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d5d704fdb985efb36fb42f9ee8482ae473bb4695 b/test/core/end2end/fuzzers/api_fuzzer_corpus/d5d704fdb985efb36fb42f9ee8482ae473bb4695 Binary files differnew file mode 100644 index 0000000000..ca82ab462f --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d5d704fdb985efb36fb42f9ee8482ae473bb4695 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d6d7dc448cc24272ce216dbc7365ebe6e6b7b367 b/test/core/end2end/fuzzers/api_fuzzer_corpus/d6d7dc448cc24272ce216dbc7365ebe6e6b7b367 Binary files differnew file mode 100644 index 0000000000..e49fe7d3be --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d6d7dc448cc24272ce216dbc7365ebe6e6b7b367 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d85482b6a40d7edee97709df0ed02558dca4c079 b/test/core/end2end/fuzzers/api_fuzzer_corpus/d85482b6a40d7edee97709df0ed02558dca4c079 Binary files differnew file mode 100644 index 0000000000..58e2ed8c04 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d85482b6a40d7edee97709df0ed02558dca4c079 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/d8f08b0e061e86e94650aa16f99cae81cd696ca3 b/test/core/end2end/fuzzers/api_fuzzer_corpus/d8f08b0e061e86e94650aa16f99cae81cd696ca3 Binary files differnew file mode 100644 index 0000000000..4c34fd0833 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/d8f08b0e061e86e94650aa16f99cae81cd696ca3 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/dbcaf0a6bd4960e8d0c518494b89bd9b941cfc8e b/test/core/end2end/fuzzers/api_fuzzer_corpus/dbcaf0a6bd4960e8d0c518494b89bd9b941cfc8e Binary files differnew file mode 100644 index 0000000000..098cfa21c3 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/dbcaf0a6bd4960e8d0c518494b89bd9b941cfc8e diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ddc34d5e97ac12572e6c39a336d219d91fa992b1 b/test/core/end2end/fuzzers/api_fuzzer_corpus/ddc34d5e97ac12572e6c39a336d219d91fa992b1 Binary files differnew file mode 100644 index 0000000000..1b5ebce44d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ddc34d5e97ac12572e6c39a336d219d91fa992b1 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ddf932a29b8250746ec310af224f95d4a51cb745 b/test/core/end2end/fuzzers/api_fuzzer_corpus/ddf932a29b8250746ec310af224f95d4a51cb745 Binary files differnew file mode 100644 index 0000000000..62ba3d5ffe --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ddf932a29b8250746ec310af224f95d4a51cb745 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/e16a0f378b50b28dae4458b795c8c80cf869901a b/test/core/end2end/fuzzers/api_fuzzer_corpus/e16a0f378b50b28dae4458b795c8c80cf869901a Binary files differnew file mode 100644 index 0000000000..01296fcd54 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/e16a0f378b50b28dae4458b795c8c80cf869901a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/e18816dbe46249fb0160b8f06c2b71f6943d3d21 b/test/core/end2end/fuzzers/api_fuzzer_corpus/e18816dbe46249fb0160b8f06c2b71f6943d3d21 Binary files differnew file mode 100644 index 0000000000..d389968bc7 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/e18816dbe46249fb0160b8f06c2b71f6943d3d21 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/e7d4357e2c3ac4db7a9bfece1549f0664e4d317b b/test/core/end2end/fuzzers/api_fuzzer_corpus/e7d4357e2c3ac4db7a9bfece1549f0664e4d317b Binary files differnew file mode 100644 index 0000000000..76cac15f1b --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/e7d4357e2c3ac4db7a9bfece1549f0664e4d317b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/e8b1814f9a0942322aeb190ae0ad35105784e101 b/test/core/end2end/fuzzers/api_fuzzer_corpus/e8b1814f9a0942322aeb190ae0ad35105784e101 Binary files differnew file mode 100644 index 0000000000..bb11018c69 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/e8b1814f9a0942322aeb190ae0ad35105784e101 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/e8bc4c1b1ffb23de5af2c8fe20599c05f94567ad b/test/core/end2end/fuzzers/api_fuzzer_corpus/e8bc4c1b1ffb23de5af2c8fe20599c05f94567ad Binary files differnew file mode 100644 index 0000000000..8dcd24e6ef --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/e8bc4c1b1ffb23de5af2c8fe20599c05f94567ad diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/e94428d78182060ff6309dd626cf6b3ebeed88d6 b/test/core/end2end/fuzzers/api_fuzzer_corpus/e94428d78182060ff6309dd626cf6b3ebeed88d6 Binary files differnew file mode 100644 index 0000000000..570de0eef1 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/e94428d78182060ff6309dd626cf6b3ebeed88d6 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ea421a728134ad3a95a32f081c2bafa9d989836f b/test/core/end2end/fuzzers/api_fuzzer_corpus/ea421a728134ad3a95a32f081c2bafa9d989836f Binary files differnew file mode 100644 index 0000000000..d44736f753 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ea421a728134ad3a95a32f081c2bafa9d989836f diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/eab5589ebcdd4596996f0a6de6408a0f3e13437b b/test/core/end2end/fuzzers/api_fuzzer_corpus/eab5589ebcdd4596996f0a6de6408a0f3e13437b Binary files differnew file mode 100644 index 0000000000..733f49ca09 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/eab5589ebcdd4596996f0a6de6408a0f3e13437b diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ec56dad56975e8279b2b229288dff3bb0ceaf661 b/test/core/end2end/fuzzers/api_fuzzer_corpus/ec56dad56975e8279b2b229288dff3bb0ceaf661 Binary files differnew file mode 100644 index 0000000000..c3a9711d62 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ec56dad56975e8279b2b229288dff3bb0ceaf661 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ed913deced10ab045fe04c783f6a0e2678f1929f b/test/core/end2end/fuzzers/api_fuzzer_corpus/ed913deced10ab045fe04c783f6a0e2678f1929f Binary files differnew file mode 100644 index 0000000000..53b246bb76 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ed913deced10ab045fe04c783f6a0e2678f1929f diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ee624b408f8a50c79cdaebf4fb4195e6162b70da b/test/core/end2end/fuzzers/api_fuzzer_corpus/ee624b408f8a50c79cdaebf4fb4195e6162b70da Binary files differnew file mode 100644 index 0000000000..abaf0fbb59 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ee624b408f8a50c79cdaebf4fb4195e6162b70da diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/f060953b52fe245eb88ee13b32a3971eaa11e40a b/test/core/end2end/fuzzers/api_fuzzer_corpus/f060953b52fe245eb88ee13b32a3971eaa11e40a Binary files differnew file mode 100644 index 0000000000..b8344c2cf8 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/f060953b52fe245eb88ee13b32a3971eaa11e40a diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/f2ee773064f643871134a017d35fd5d8ae74d35c b/test/core/end2end/fuzzers/api_fuzzer_corpus/f2ee773064f643871134a017d35fd5d8ae74d35c Binary files differnew file mode 100644 index 0000000000..eea043539f --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/f2ee773064f643871134a017d35fd5d8ae74d35c diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/f38d6347f6044dbc3978ef7e5d5adfb7fc8aceb9 b/test/core/end2end/fuzzers/api_fuzzer_corpus/f38d6347f6044dbc3978ef7e5d5adfb7fc8aceb9 Binary files differnew file mode 100644 index 0000000000..28ed5bb362 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/f38d6347f6044dbc3978ef7e5d5adfb7fc8aceb9 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/f4b66d285bd0328e511625b1c696662a0b0b2e70 b/test/core/end2end/fuzzers/api_fuzzer_corpus/f4b66d285bd0328e511625b1c696662a0b0b2e70 Binary files differnew file mode 100644 index 0000000000..b3e38dfcc5 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/f4b66d285bd0328e511625b1c696662a0b0b2e70 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/f6d8d78857d868c2f477da7506a1976354f2631d b/test/core/end2end/fuzzers/api_fuzzer_corpus/f6d8d78857d868c2f477da7506a1976354f2631d Binary files differnew file mode 100644 index 0000000000..86ded50ca0 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/f6d8d78857d868c2f477da7506a1976354f2631d diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/fb263a744a6d40e183e84ec8a81ca13859c8b5ce b/test/core/end2end/fuzzers/api_fuzzer_corpus/fb263a744a6d40e183e84ec8a81ca13859c8b5ce Binary files differnew file mode 100644 index 0000000000..97aedbad18 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/fb263a744a6d40e183e84ec8a81ca13859c8b5ce diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/fb324303c6d5819d6f353f78d087e29adba51836 b/test/core/end2end/fuzzers/api_fuzzer_corpus/fb324303c6d5819d6f353f78d087e29adba51836 Binary files differnew file mode 100644 index 0000000000..0316705e5c --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/fb324303c6d5819d6f353f78d087e29adba51836 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/fbc7dd3fbb6abc462ab0493bfe3a8505f12fe4a5 b/test/core/end2end/fuzzers/api_fuzzer_corpus/fbc7dd3fbb6abc462ab0493bfe3a8505f12fe4a5 Binary files differnew file mode 100644 index 0000000000..e2bb451101 --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/fbc7dd3fbb6abc462ab0493bfe3a8505f12fe4a5 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/fcc42c56cb8847716474703b5a650f41dce98b38 b/test/core/end2end/fuzzers/api_fuzzer_corpus/fcc42c56cb8847716474703b5a650f41dce98b38 Binary files differnew file mode 100644 index 0000000000..095375a96d --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/fcc42c56cb8847716474703b5a650f41dce98b38 diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/ff7f9df969df7fe6c9c1515528404b55f9d237b6 b/test/core/end2end/fuzzers/api_fuzzer_corpus/ff7f9df969df7fe6c9c1515528404b55f9d237b6 Binary files differnew file mode 100644 index 0000000000..ca8dccd65e --- /dev/null +++ b/test/core/end2end/fuzzers/api_fuzzer_corpus/ff7f9df969df7fe6c9c1515528404b55f9d237b6 diff --git a/test/core/end2end/fuzzers/client_fuzzer.c b/test/core/end2end/fuzzers/client_fuzzer.c index afcf7638f7..79b23d7856 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.c +++ b/test/core/end2end/fuzzers/client_fuzzer.c @@ -31,6 +31,8 @@ * */ +#include <string.h> + #include <grpc/grpc.h> #include <grpc/support/alloc.h> @@ -39,7 +41,8 @@ #include "test/core/util/memory_counters.h" #include "test/core/util/mock_endpoint.h" -static const bool squelch = true; +bool squelch = true; +bool leak_check = true; static void discard_write(gpr_slice slice) {} @@ -51,7 +54,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_test_only_set_metadata_hash_seed(0); struct grpc_memory_counters counters; if (squelch) gpr_set_log_function(dont_log); - grpc_memory_counters_init(); + if (leak_check) grpc_memory_counters_init(); grpc_init(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -78,6 +81,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { size_t details_capacity = 0; grpc_op ops[6]; + memset(ops, 0, sizeof(ops)); grpc_op *op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -153,8 +157,10 @@ done: grpc_byte_buffer_destroy(response_payload_recv); } grpc_shutdown(); - counters = grpc_memory_counters_snapshot(); - grpc_memory_counters_destroy(); - GPR_ASSERT(counters.total_size_relative == 0); + if (leak_check) { + counters = grpc_memory_counters_snapshot(); + grpc_memory_counters_destroy(); + GPR_ASSERT(counters.total_size_relative == 0); + } return 0; } diff --git a/test/core/end2end/fuzzers/client_fuzzer_corpus/2c452818a10ddef09b90c89a53db14b9b56b21f3 b/test/core/end2end/fuzzers/client_fuzzer_corpus/2c452818a10ddef09b90c89a53db14b9b56b21f3 Binary files differnew file mode 100644 index 0000000000..059634fda1 --- /dev/null +++ b/test/core/end2end/fuzzers/client_fuzzer_corpus/2c452818a10ddef09b90c89a53db14b9b56b21f3 diff --git a/test/core/end2end/fuzzers/client_fuzzer_corpus/42ead79c94eccdf8a8c3d8036be73e14fa260dd5 b/test/core/end2end/fuzzers/client_fuzzer_corpus/42ead79c94eccdf8a8c3d8036be73e14fa260dd5 Binary files differnew file mode 100644 index 0000000000..b9c53b26ed --- /dev/null +++ b/test/core/end2end/fuzzers/client_fuzzer_corpus/42ead79c94eccdf8a8c3d8036be73e14fa260dd5 diff --git a/test/core/end2end/fuzzers/client_fuzzer_corpus/4e05d6cf1c3f0c04f6ee92d09a53ee0fe35c085a b/test/core/end2end/fuzzers/client_fuzzer_corpus/4e05d6cf1c3f0c04f6ee92d09a53ee0fe35c085a Binary files differnew file mode 100644 index 0000000000..8a4a279998 --- /dev/null +++ b/test/core/end2end/fuzzers/client_fuzzer_corpus/4e05d6cf1c3f0c04f6ee92d09a53ee0fe35c085a diff --git a/test/core/end2end/fuzzers/client_fuzzer_corpus/8f980dd25f1c77e3536131c2c620aa32e8c13180 b/test/core/end2end/fuzzers/client_fuzzer_corpus/8f980dd25f1c77e3536131c2c620aa32e8c13180 Binary files differnew file mode 100644 index 0000000000..fcebab7a64 --- /dev/null +++ b/test/core/end2end/fuzzers/client_fuzzer_corpus/8f980dd25f1c77e3536131c2c620aa32e8c13180 diff --git a/test/core/end2end/fuzzers/client_fuzzer_corpus/aef36c49d7dec0dcf8cdc224d9e9221fa2cb1db0 b/test/core/end2end/fuzzers/client_fuzzer_corpus/aef36c49d7dec0dcf8cdc224d9e9221fa2cb1db0 Binary files differnew file mode 100644 index 0000000000..6b015fe66e --- /dev/null +++ b/test/core/end2end/fuzzers/client_fuzzer_corpus/aef36c49d7dec0dcf8cdc224d9e9221fa2cb1db0 diff --git a/test/core/end2end/fuzzers/client_fuzzer_corpus/crash-14ed70cd9ea7987cdd0c8f6e39398ee7c60ee2ff b/test/core/end2end/fuzzers/client_fuzzer_corpus/crash-14ed70cd9ea7987cdd0c8f6e39398ee7c60ee2ff Binary files differnew file mode 100644 index 0000000000..be6366049d --- /dev/null +++ b/test/core/end2end/fuzzers/client_fuzzer_corpus/crash-14ed70cd9ea7987cdd0c8f6e39398ee7c60ee2ff diff --git a/test/core/end2end/fuzzers/client_fuzzer_corpus/dcb06a6e34cbed15515e5b3581ca666f704777bd b/test/core/end2end/fuzzers/client_fuzzer_corpus/dcb06a6e34cbed15515e5b3581ca666f704777bd Binary files differnew file mode 100644 index 0000000000..92750f94a3 --- /dev/null +++ b/test/core/end2end/fuzzers/client_fuzzer_corpus/dcb06a6e34cbed15515e5b3581ca666f704777bd diff --git a/test/core/end2end/fuzzers/client_fuzzer_corpus/ea46b684f1e67a27c231f2d536c41da631189b9c b/test/core/end2end/fuzzers/client_fuzzer_corpus/ea46b684f1e67a27c231f2d536c41da631189b9c Binary files differnew file mode 100644 index 0000000000..c891d9adc8 --- /dev/null +++ b/test/core/end2end/fuzzers/client_fuzzer_corpus/ea46b684f1e67a27c231f2d536c41da631189b9c diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index b081368ff6..097e9a8922 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -63,6 +63,7 @@ "\x13if-unmodified-since" "\x0Dlast-modified" "\x04link" +"\x0Eload-reporting" "\x08location" "\x0Cmax-forwards" "\x07:method" @@ -136,6 +137,7 @@ "\x00\x13if-unmodified-since\x00" "\x00\x0Dlast-modified\x00" "\x00\x04link\x00" +"\x00\x0Eload-reporting\x00" "\x00\x08location\x00" "\x00\x0Cmax-forwards\x00" "\x00\x07:method\x03GET" diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c index 0a7d6d92aa..80f568ac92 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.c +++ b/test/core/end2end/fuzzers/server_fuzzer.c @@ -38,7 +38,8 @@ #include "test/core/util/memory_counters.h" #include "test/core/util/mock_endpoint.h" -static const bool squelch = true; +bool squelch = true; +bool leak_check = true; static void discard_write(gpr_slice slice) {} @@ -51,7 +52,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_test_only_set_metadata_hash_seed(0); struct grpc_memory_counters counters; if (squelch) gpr_set_log_function(dont_log); - grpc_memory_counters_init(); + if (leak_check) grpc_memory_counters_init(); grpc_init(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -120,8 +121,10 @@ done: grpc_server_destroy(server); grpc_completion_queue_destroy(cq); grpc_shutdown(); - counters = grpc_memory_counters_snapshot(); - grpc_memory_counters_destroy(); - GPR_ASSERT(counters.total_size_relative == 0); + if (leak_check) { + counters = grpc_memory_counters_snapshot(); + grpc_memory_counters_destroy(); + GPR_ASSERT(counters.total_size_relative == 0); + } return 0; } diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/05551028437699c8650f5d08eb5f95ee25adf436 b/test/core/end2end/fuzzers/server_fuzzer_corpus/05551028437699c8650f5d08eb5f95ee25adf436 Binary files differnew file mode 100644 index 0000000000..c61aff87e9 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/05551028437699c8650f5d08eb5f95ee25adf436 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/06285b50669cc16463db009ac821f99cf1ec2e24 b/test/core/end2end/fuzzers/server_fuzzer_corpus/06285b50669cc16463db009ac821f99cf1ec2e24 Binary files differnew file mode 100644 index 0000000000..d480552344 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/06285b50669cc16463db009ac821f99cf1ec2e24 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/23c582f6e23c7bbc9ae7b039b3b4e2ccdea3d5d2 b/test/core/end2end/fuzzers/server_fuzzer_corpus/23c582f6e23c7bbc9ae7b039b3b4e2ccdea3d5d2 Binary files differnew file mode 100644 index 0000000000..20b4cf800c --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/23c582f6e23c7bbc9ae7b039b3b4e2ccdea3d5d2 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/23f261e44d54a2736f6e288128d98db9e5015206 b/test/core/end2end/fuzzers/server_fuzzer_corpus/23f261e44d54a2736f6e288128d98db9e5015206 Binary files differnew file mode 100644 index 0000000000..1452256ec7 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/23f261e44d54a2736f6e288128d98db9e5015206 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/395aea4fcfea081fc0d2733fff2d14405439fa72 b/test/core/end2end/fuzzers/server_fuzzer_corpus/395aea4fcfea081fc0d2733fff2d14405439fa72 Binary files differnew file mode 100644 index 0000000000..c83226294a --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/395aea4fcfea081fc0d2733fff2d14405439fa72 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/404e234751b01dd0b51f9e7610f787253b074528 b/test/core/end2end/fuzzers/server_fuzzer_corpus/404e234751b01dd0b51f9e7610f787253b074528 Binary files differnew file mode 100644 index 0000000000..56a2f93726 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/404e234751b01dd0b51f9e7610f787253b074528 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/4123bd764c04385191342ea64918408140313714 b/test/core/end2end/fuzzers/server_fuzzer_corpus/4123bd764c04385191342ea64918408140313714 Binary files differnew file mode 100644 index 0000000000..18d908f6ab --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/4123bd764c04385191342ea64918408140313714 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/4f96a5fba4d11401eb22d4b1e365fbbb2d684f24 b/test/core/end2end/fuzzers/server_fuzzer_corpus/4f96a5fba4d11401eb22d4b1e365fbbb2d684f24 Binary files differnew file mode 100644 index 0000000000..cc5d4987b9 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/4f96a5fba4d11401eb22d4b1e365fbbb2d684f24 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/552199651d942e7220141a93ec33dd8256210a18 b/test/core/end2end/fuzzers/server_fuzzer_corpus/552199651d942e7220141a93ec33dd8256210a18 Binary files differnew file mode 100644 index 0000000000..c8c54f443d --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/552199651d942e7220141a93ec33dd8256210a18 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/609706c57e848ea58d7ca14fe6cc253322f3e8ce b/test/core/end2end/fuzzers/server_fuzzer_corpus/609706c57e848ea58d7ca14fe6cc253322f3e8ce Binary files differnew file mode 100644 index 0000000000..1ac7cc9036 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/609706c57e848ea58d7ca14fe6cc253322f3e8ce diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/7a946bf3cd91b63001f2cf3f40c515c747f2ecde b/test/core/end2end/fuzzers/server_fuzzer_corpus/7a946bf3cd91b63001f2cf3f40c515c747f2ecde Binary files differnew file mode 100644 index 0000000000..8ef1b0ad7e --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/7a946bf3cd91b63001f2cf3f40c515c747f2ecde diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/7d25c28298fb4d0fe41209d0d14307e4aa67c59e b/test/core/end2end/fuzzers/server_fuzzer_corpus/7d25c28298fb4d0fe41209d0d14307e4aa67c59e Binary files differnew file mode 100644 index 0000000000..a323f7a1ab --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/7d25c28298fb4d0fe41209d0d14307e4aa67c59e diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/8138b18a9a743659befc2f2b23d23cb9c3086a09 b/test/core/end2end/fuzzers/server_fuzzer_corpus/8138b18a9a743659befc2f2b23d23cb9c3086a09 Binary files differnew file mode 100644 index 0000000000..2bcef177a3 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/8138b18a9a743659befc2f2b23d23cb9c3086a09 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/89cd90fb47bb9eb289e8126b26021ee00d572d95 b/test/core/end2end/fuzzers/server_fuzzer_corpus/89cd90fb47bb9eb289e8126b26021ee00d572d95 Binary files differnew file mode 100644 index 0000000000..17b8d7db66 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/89cd90fb47bb9eb289e8126b26021ee00d572d95 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/925011abb99fd56bb0f425ae5e0d92e6d341f804 b/test/core/end2end/fuzzers/server_fuzzer_corpus/925011abb99fd56bb0f425ae5e0d92e6d341f804 Binary files differnew file mode 100644 index 0000000000..948d5fafa3 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/925011abb99fd56bb0f425ae5e0d92e6d341f804 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/99a1acc96512c1155f91afa378e2345726d307c3 b/test/core/end2end/fuzzers/server_fuzzer_corpus/99a1acc96512c1155f91afa378e2345726d307c3 Binary files differnew file mode 100644 index 0000000000..a82790db50 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/99a1acc96512c1155f91afa378e2345726d307c3 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/crash-c1f66840627e3bfdedf2e4c225bc4de0c267ed37 b/test/core/end2end/fuzzers/server_fuzzer_corpus/crash-c1f66840627e3bfdedf2e4c225bc4de0c267ed37 Binary files differnew file mode 100644 index 0000000000..a7fa57e78e --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/crash-c1f66840627e3bfdedf2e4c225bc4de0c267ed37 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/crash-ccf36bef9318fe6d5e5e1560c5485cdc87d0a701 b/test/core/end2end/fuzzers/server_fuzzer_corpus/crash-ccf36bef9318fe6d5e5e1560c5485cdc87d0a701 Binary files differnew file mode 100644 index 0000000000..8bc2de908a --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/crash-ccf36bef9318fe6d5e5e1560c5485cdc87d0a701 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/d6bed9cc3c10338a8c5f41064ff8bec0bbc267ce b/test/core/end2end/fuzzers/server_fuzzer_corpus/d6bed9cc3c10338a8c5f41064ff8bec0bbc267ce Binary files differnew file mode 100644 index 0000000000..2b3424a332 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/d6bed9cc3c10338a8c5f41064ff8bec0bbc267ce diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/dda9643679f8c8b796e64232a7d153e447d64991 b/test/core/end2end/fuzzers/server_fuzzer_corpus/dda9643679f8c8b796e64232a7d153e447d64991 Binary files differnew file mode 100644 index 0000000000..b8ba07b16b --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/dda9643679f8c8b796e64232a7d153e447d64991 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/e7b08e36420fa107f0aee652e62158af85a4ef15 b/test/core/end2end/fuzzers/server_fuzzer_corpus/e7b08e36420fa107f0aee652e62158af85a4ef15 Binary files differnew file mode 100644 index 0000000000..523c785612 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/e7b08e36420fa107f0aee652e62158af85a4ef15 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/ec4949487fa84f0cead39521b51f837af9dc784a b/test/core/end2end/fuzzers/server_fuzzer_corpus/ec4949487fa84f0cead39521b51f837af9dc784a Binary files differnew file mode 100644 index 0000000000..e6ea5327d8 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/ec4949487fa84f0cead39521b51f837af9dc784a diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-0292270056246b7a4ccd2e7d0356665cef307ef2 b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-0292270056246b7a4ccd2e7d0356665cef307ef2 Binary files differnew file mode 100644 index 0000000000..e3eab9eab3 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-0292270056246b7a4ccd2e7d0356665cef307ef2 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-098ec93ded3a20e6043d11e9cc6066351e257f8e b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-098ec93ded3a20e6043d11e9cc6066351e257f8e Binary files differnew file mode 100644 index 0000000000..b8fa2c077e --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-098ec93ded3a20e6043d11e9cc6066351e257f8e diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-1dc659f500e7bee41a4fee4423ade8332c162cc0 b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-1dc659f500e7bee41a4fee4423ade8332c162cc0 Binary files differnew file mode 100644 index 0000000000..54411c45e4 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-1dc659f500e7bee41a4fee4423ade8332c162cc0 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-350b5da741597222c98fe86768432507850317f5 b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-350b5da741597222c98fe86768432507850317f5 Binary files differnew file mode 100644 index 0000000000..4364289907 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-350b5da741597222c98fe86768432507850317f5 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-395aea4fcfea081fc0d2733fff2d14405439fa72 b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-395aea4fcfea081fc0d2733fff2d14405439fa72 Binary files differnew file mode 100644 index 0000000000..c83226294a --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-395aea4fcfea081fc0d2733fff2d14405439fa72 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-45cf8ac5faa9c7b15baf9281e8d7e0b4e103f0e0 b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-45cf8ac5faa9c7b15baf9281e8d7e0b4e103f0e0 Binary files differnew file mode 100644 index 0000000000..70b2eecbd6 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-45cf8ac5faa9c7b15baf9281e8d7e0b4e103f0e0 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-60a9f77951c5059616764894e1963d83d478edfe b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-60a9f77951c5059616764894e1963d83d478edfe Binary files differnew file mode 100644 index 0000000000..0063c63f73 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-60a9f77951c5059616764894e1963d83d478edfe diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-97a338fa892093ed5013a76b96b35dd112df3342 b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-97a338fa892093ed5013a76b96b35dd112df3342 Binary files differnew file mode 100644 index 0000000000..3a231db3e4 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-97a338fa892093ed5013a76b96b35dd112df3342 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-a1b2cfcf0997acb13a32fc5c004f57d9e9bc4275 b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-a1b2cfcf0997acb13a32fc5c004f57d9e9bc4275 Binary files differnew file mode 100644 index 0000000000..1a213469dd --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-a1b2cfcf0997acb13a32fc5c004f57d9e9bc4275 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-a1ed26e6f82ca0e81e3f415bd8b0b8b520d3927b b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-a1ed26e6f82ca0e81e3f415bd8b0b8b520d3927b Binary files differnew file mode 100644 index 0000000000..c00d51de99 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-a1ed26e6f82ca0e81e3f415bd8b0b8b520d3927b diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-f412afea6b01aa53da919a41a65ffbf9885f2d65 b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-f412afea6b01aa53da919a41a65ffbf9885f2d65 Binary files differnew file mode 100644 index 0000000000..171446cb1e --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-f412afea6b01aa53da919a41a65ffbf9885f2d65 diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py index 3e10ad580f..6d3d8f8d3c 100755 --- a/test/core/end2end/gen_build_yaml.py +++ b/test/core/end2end/gen_build_yaml.py @@ -45,6 +45,8 @@ default_unsecure_fixture_options = FixtureOptions( socketpair_unsecure_fixture_options = default_unsecure_fixture_options._replace(fullstack=False, dns_resolver=False) default_secure_fixture_options = default_unsecure_fixture_options._replace(secure=True) uds_fixture_options = default_unsecure_fixture_options._replace(dns_resolver=False, platforms=['linux', 'mac', 'posix']) +fd_unsecure_fixture_options = default_unsecure_fixture_options._replace( + dns_resolver=False, fullstack=False, platforms=['linux', 'mac', 'posix']) # maps fixture name to whether it requires the security library @@ -52,10 +54,12 @@ END2END_FIXTURES = { 'h2_compress': default_unsecure_fixture_options, 'h2_census': default_unsecure_fixture_options, 'h2_fakesec': default_secure_fixture_options._replace(ci_mac=False), + 'h2_fd': fd_unsecure_fixture_options, 'h2_full': default_unsecure_fixture_options, 'h2_full+pipe': default_unsecure_fixture_options._replace( platforms=['linux']), 'h2_full+trace': default_unsecure_fixture_options._replace(tracing=True), + 'h2_loadreporting': default_unsecure_fixture_options, 'h2_oauth2': default_secure_fixture_options._replace(ci_mac=False), 'h2_proxy': default_unsecure_fixture_options._replace(includes_proxy=True, ci_mac=False), @@ -72,7 +76,8 @@ END2END_FIXTURES = { } TestOptions = collections.namedtuple( - 'TestOptions', 'needs_fullstack needs_dns proxyable secure traceable cpu_cost') + 'TestOptions', + 'needs_fullstack needs_dns proxyable secure traceable cpu_cost') default_test_options = TestOptions(False, False, True, False, True, 1.0) connectivity_test_options = default_test_options._replace(needs_fullstack=True) @@ -84,13 +89,14 @@ END2END_TESTS = { 'binary_metadata': default_test_options, 'call_creds': default_test_options._replace(secure=True), 'cancel_after_accept': default_test_options._replace(cpu_cost=LOWCPU), - 'cancel_after_client_done': default_test_options._replace(cpu_cost=LOWCPU), + 'cancel_after_client_done': default_test_options, 'cancel_after_invoke': default_test_options._replace(cpu_cost=LOWCPU), 'cancel_before_invoke': default_test_options._replace(cpu_cost=LOWCPU), 'cancel_in_a_vacuum': default_test_options._replace(cpu_cost=LOWCPU), 'cancel_with_status': default_test_options._replace(cpu_cost=LOWCPU), - 'compressed_payload': default_test_options._replace(proxyable=False, cpu_cost=LOWCPU), - 'connectivity': connectivity_test_options._replace(proxyable=False, cpu_cost=LOWCPU), + 'compressed_payload': default_test_options._replace(proxyable=False), + 'connectivity': connectivity_test_options._replace(proxyable=False, + cpu_cost=LOWCPU), 'default_host': default_test_options._replace(needs_fullstack=True, needs_dns=True), 'disappearing_server': connectivity_test_options, @@ -104,21 +110,23 @@ END2END_TESTS = { 'invoke_large_request': default_test_options, 'large_metadata': default_test_options, 'max_concurrent_streams': default_test_options._replace(proxyable=False), - 'max_message_length': default_test_options._replace(cpu_cost=LOWCPU), + 'max_message_length': default_test_options, 'negative_deadline': default_test_options, 'no_op': default_test_options, - 'payload': default_test_options._replace(cpu_cost=LOWCPU), + 'payload': default_test_options, 'ping_pong_streaming': default_test_options, 'ping': connectivity_test_options._replace(proxyable=False), 'registered_call': default_test_options, - 'request_with_flags': default_test_options._replace(proxyable=False), + 'request_with_flags': default_test_options._replace( + proxyable=False, cpu_cost=LOWCPU), 'request_with_payload': default_test_options, 'server_finishes_request': default_test_options, 'shutdown_finishes_calls': default_test_options, 'shutdown_finishes_tags': default_test_options, - 'simple_delayed_request': connectivity_test_options._replace(cpu_cost=LOWCPU), + 'simple_delayed_request': connectivity_test_options, 'simple_metadata': default_test_options, 'simple_request': default_test_options, + 'streaming_error_response': default_test_options, 'trailing_metadata': default_test_options, } diff --git a/test/core/end2end/goaway_server_test.c b/test/core/end2end/goaway_server_test.c index 5f8c2641e7..67cc24c74c 100644 --- a/test/core/end2end/goaway_server_test.c +++ b/test/core/end2end/goaway_server_test.c @@ -46,8 +46,9 @@ static void *tag(intptr_t i) { return (void *)i; } static gpr_mu g_mu; static int g_resolve_port = -1; -static grpc_resolved_addresses *(*iomgr_resolve_address)( - const char *name, const char *default_port); +static grpc_error *(*iomgr_resolve_address)(const char *name, + const char *default_port, + grpc_resolved_addresses **addrs); static void set_resolve_port(int port) { gpr_mu_lock(&g_mu); @@ -55,28 +56,28 @@ static void set_resolve_port(int port) { gpr_mu_unlock(&g_mu); } -static grpc_resolved_addresses *my_resolve_address(const char *name, - const char *addr) { +static grpc_error *my_resolve_address(const char *name, const char *addr, + grpc_resolved_addresses **addrs) { if (0 != strcmp(name, "test")) { - return iomgr_resolve_address(name, addr); + return iomgr_resolve_address(name, addr, addrs); } gpr_mu_lock(&g_mu); if (g_resolve_port < 0) { gpr_mu_unlock(&g_mu); - return NULL; + return GRPC_ERROR_CREATE("Forced Failure"); } else { - grpc_resolved_addresses *addrs = gpr_malloc(sizeof(*addrs)); - addrs->naddrs = 1; - addrs->addrs = gpr_malloc(sizeof(*addrs->addrs)); - memset(addrs->addrs, 0, sizeof(*addrs->addrs)); - struct sockaddr_in *sa = (struct sockaddr_in *)addrs->addrs[0].addr; + *addrs = gpr_malloc(sizeof(**addrs)); + (*addrs)->naddrs = 1; + (*addrs)->addrs = gpr_malloc(sizeof(*(*addrs)->addrs)); + memset((*addrs)->addrs, 0, sizeof(*(*addrs)->addrs)); + struct sockaddr_in *sa = (struct sockaddr_in *)(*addrs)->addrs[0].addr; sa->sin_family = AF_INET; sa->sin_addr.s_addr = htonl(0x7f000001); sa->sin_port = htons((uint16_t)g_resolve_port); - addrs->addrs[0].len = sizeof(*sa); + (*addrs)->addrs[0].len = sizeof(*sa); gpr_mu_unlock(&g_mu); - return addrs; + return GRPC_ERROR_NONE; } } @@ -132,6 +133,7 @@ int main(int argc, char **argv) { chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, "/foo", "127.0.0.1", GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20), NULL); /* send initial metadata to probe connectivity */ + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -142,6 +144,7 @@ int main(int argc, char **argv) { (size_t)(op - ops), tag(0x101), NULL)); /* and receive status to probe termination */ + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1; @@ -183,6 +186,7 @@ int main(int argc, char **argv) { tag(0x9999)); /* listen for close on the server call to probe for finishing */ + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled1; @@ -205,6 +209,7 @@ int main(int argc, char **argv) { chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, "/foo", "127.0.0.1", GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20), NULL); /* send initial metadata to probe connectivity */ + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -215,6 +220,7 @@ int main(int argc, char **argv) { (size_t)(op - ops), tag(0x201), NULL)); /* and receive status to probe termination */ + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2; @@ -249,6 +255,7 @@ int main(int argc, char **argv) { cq_verify(cqv); /* listen for close on the server call to probe for finishing */ + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled2; diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c index cf42e92a1a..3545660701 100644 --- a/test/core/end2end/invalid_call_argument_test.c +++ b/test/core/end2end/invalid_call_argument_test.c @@ -30,11 +30,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ + +#include <limits.h> +#include <string.h> + #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/host_port.h> #include <grpc/support/log.h> -#include <limits.h> + #include "test/core/end2end/cq_verifier.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" @@ -74,6 +78,7 @@ static void prepare_test(int is_client) { g_state.cqv = cq_verifier_create(g_state.cq); g_state.details = NULL; g_state.details_capacity = 0; + memset(g_state.ops, 0, sizeof(g_state.ops)); if (is_client) { /* create a call, channel to a non existant server */ diff --git a/test/core/end2end/no_server_test.c b/test/core/end2end/no_server_test.c index 7a5cd2335f..08af382197 100644 --- a/test/core/end2end/no_server_test.c +++ b/test/core/end2end/no_server_test.c @@ -31,9 +31,12 @@ * */ +#include <string.h> + #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> + #include "test/core/end2end/cq_verifier.h" #include "test/core/util/test_config.h" @@ -65,6 +68,7 @@ int main(int argc, char **argv) { call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, "/Foo", "nonexistant", deadline, NULL); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.c index 3cb9b3d4b1..c9663c2155 100644 --- a/test/core/end2end/tests/bad_hostname.c +++ b/test/core/end2end/tests/bad_hostname.c @@ -123,6 +123,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.c index 994c3bf1dd..3dd2612077 100644 --- a/test/core/end2end/tests/binary_metadata.c +++ b/test/core/end2end/tests/binary_metadata.c @@ -157,6 +157,7 @@ static void test_request_response_with_metadata_and_payload( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 2; @@ -201,6 +202,7 @@ static void test_request_response_with_metadata_and_payload( cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 2; @@ -219,6 +221,7 @@ static void test_request_response_with_metadata_and_payload( cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c index 5c6791f6f7..694a0aa9ef 100644 --- a/test/core/end2end/tests/call_creds.c +++ b/test/core/end2end/tests/call_creds.c @@ -193,6 +193,7 @@ static void request_response_with_payload_and_call_creds( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -248,6 +249,7 @@ static void request_response_with_payload_and_call_creds( /* Cannot set creds on the server call object. */ GPR_ASSERT(grpc_call_set_credentials(s, NULL) != GRPC_CALL_OK); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -265,6 +267,7 @@ static void request_response_with_payload_and_call_creds( cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; @@ -410,6 +413,7 @@ static void test_request_with_server_rejecting_client_creds( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index fc2a64a6c1..51c13da3b1 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -136,6 +136,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; @@ -174,6 +175,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, cq_expect_completion(cqv, tag(2), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message = &request_payload_recv; diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.c index 3bafa8c85f..2b5a409dee 100644 --- a/test/core/end2end/tests/cancel_after_client_done.c +++ b/test/core/end2end/tests/cancel_after_client_done.c @@ -136,6 +136,7 @@ static void test_cancel_after_accept_and_writes_closed( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; @@ -178,6 +179,7 @@ static void test_cancel_after_accept_and_writes_closed( cq_expect_completion(cqv, tag(2), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message = &request_payload_recv; diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index fc2751af8e..85fbe9de7b 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -131,6 +131,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index 33005db9e4..d99062c608 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -131,6 +131,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; diff --git a/test/core/end2end/tests/cancel_with_status.c b/test/core/end2end/tests/cancel_with_status.c index c3ee4a6a0e..673c7051ad 100644 --- a/test/core/end2end/tests/cancel_with_status.c +++ b/test/core/end2end/tests/cancel_with_status.c @@ -112,7 +112,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) { char *details = NULL; size_t details_capacity = 0; - gpr_log(GPR_DEBUG, "test with %d ops", num_ops); + gpr_log(GPR_DEBUG, "test with %" PRIuPTR " ops", num_ops); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo", "foo.test.google.fr:1234", deadline, @@ -122,6 +122,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) { grpc_metadata_array_init(&initial_metadata_recv); grpc_metadata_array_init(&trailing_metadata_recv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c index 589bc314f8..ec5c012238 100644 --- a/test/core/end2end/tests/compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.c @@ -38,13 +38,15 @@ #include <grpc/byte_buffer.h> #include <grpc/byte_buffer_reader.h> +#include <grpc/compression.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> +#include <grpc/support/string_util.h> #include <grpc/support/time.h> #include <grpc/support/useful.h> #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/channel/compress_filter.h" +#include "src/core/lib/surface/call.h" #include "src/core/lib/surface/call_test_only.h" #include "test/core/end2end/cq_verifier.h" @@ -102,12 +104,12 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void request_with_payload_template( +static void request_for_disabled_algorithm( grpc_end2end_test_config config, const char *test_name, uint32_t send_flags_bitmask, - grpc_compression_algorithm requested_compression_algorithm, - grpc_compression_algorithm expected_compression_algorithm, - grpc_metadata *client_metadata) { + grpc_compression_algorithm algorithm_to_disable, + grpc_compression_algorithm requested_client_compression_algorithm, + grpc_status_code expected_error, grpc_metadata *client_metadata) { grpc_call *c; grpc_call *s; gpr_slice request_payload_slice; @@ -137,9 +139,11 @@ static void request_with_payload_template( request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); client_args = grpc_channel_args_set_compression_algorithm( - NULL, requested_compression_algorithm); - server_args = grpc_channel_args_set_compression_algorithm( - NULL, requested_compression_algorithm); + NULL, requested_client_compression_algorithm); + server_args = + grpc_channel_args_set_compression_algorithm(NULL, GRPC_COMPRESS_NONE); + server_args = grpc_channel_args_compression_algorithm_set_state( + &server_args, algorithm_to_disable, false); f = begin_test(config, test_name, client_args, server_args); cqv = cq_verifier_create(f.cq); @@ -153,6 +157,7 @@ static void request_with_payload_template( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; if (client_metadata != NULL) { @@ -193,11 +198,174 @@ static void request_with_payload_template( grpc_server_request_call(f.server, &s, &call_details, &request_metadata_recv, f.cq, f.cq, tag(101)); GPR_ASSERT(GRPC_CALL_OK == error); - cq_expect_completion(cqv, tag(101), 1); + cq_expect_completion(cqv, tag(101), true); + cq_verify(cqv); + + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 0; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message = &request_payload_recv; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + cq_expect_completion(cqv, tag(102), false); + + op = ops; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + cq_expect_completion(cqv, tag(103), true); + cq_expect_completion(cqv, tag(1), true); cq_verify(cqv); - GPR_ASSERT( - GPR_BITCOUNT(grpc_call_test_only_get_encodings_accepted_by_peer(s)) == 3); + /* call was cancelled (closed) ... */ + GPR_ASSERT(was_cancelled != 0); + /* with a certain error */ + GPR_ASSERT(status == expected_error); + + char *algo_name = NULL; + GPR_ASSERT(grpc_compression_algorithm_name(algorithm_to_disable, &algo_name)); + char *expected_details = NULL; + gpr_asprintf(&expected_details, "Compression algorithm '%s' is disabled.", + algo_name); + /* and we expect a specific reason for it */ + GPR_ASSERT(0 == strcmp(details, expected_details)); + gpr_free(expected_details); + GPR_ASSERT(0 == strcmp(call_details.method, "/foo")); + GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr")); + + gpr_free(details); + grpc_metadata_array_destroy(&initial_metadata_recv); + grpc_metadata_array_destroy(&trailing_metadata_recv); + grpc_metadata_array_destroy(&request_metadata_recv); + grpc_call_details_destroy(&call_details); + + grpc_call_destroy(c); + grpc_call_destroy(s); + + cq_verifier_destroy(cqv); + + gpr_slice_unref(request_payload_slice); + grpc_byte_buffer_destroy(request_payload); + grpc_byte_buffer_destroy(request_payload_recv); + + grpc_channel_args_destroy(client_args); + grpc_channel_args_destroy(server_args); + + end_test(&f); + config.tear_down_data(&f); +} + +static void request_with_payload_template( + grpc_end2end_test_config config, const char *test_name, + uint32_t client_send_flags_bitmask, + grpc_compression_algorithm default_client_channel_compression_algorithm, + grpc_compression_algorithm default_server_channel_compression_algorithm, + grpc_compression_algorithm expected_algorithm_from_client, + grpc_compression_algorithm expected_algorithm_from_server, + grpc_metadata *client_init_metadata, bool set_server_level, + grpc_compression_level server_compression_level) { + grpc_call *c; + grpc_call *s; + gpr_slice request_payload_slice; + grpc_byte_buffer *request_payload; + gpr_timespec deadline = five_seconds_time(); + grpc_channel_args *client_args; + grpc_channel_args *server_args; + grpc_end2end_test_fixture f; + grpc_op ops[6]; + grpc_op *op; + grpc_metadata_array initial_metadata_recv; + grpc_metadata_array trailing_metadata_recv; + grpc_metadata_array request_metadata_recv; + grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer *response_payload; + grpc_byte_buffer *response_payload_recv; + grpc_call_details call_details; + grpc_status_code status; + grpc_call_error error; + char *details = NULL; + size_t details_capacity = 0; + int was_cancelled = 2; + cq_verifier *cqv; + char request_str[1024]; + char response_str[1024]; + + memset(request_str, 'x', 1023); + request_str[1023] = '\0'; + + memset(response_str, 'y', 1023); + response_str[1023] = '\0'; + + request_payload_slice = gpr_slice_from_copied_string(request_str); + gpr_slice response_payload_slice = gpr_slice_from_copied_string(response_str); + + client_args = grpc_channel_args_set_compression_algorithm( + NULL, default_client_channel_compression_algorithm); + server_args = grpc_channel_args_set_compression_algorithm( + NULL, default_server_channel_compression_algorithm); + + f = begin_test(config, test_name, client_args, server_args); + cqv = cq_verifier_create(f.cq); + + c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, + "/foo", "foo.test.google.fr", deadline, NULL); + GPR_ASSERT(c); + + grpc_metadata_array_init(&initial_metadata_recv); + grpc_metadata_array_init(&trailing_metadata_recv); + grpc_metadata_array_init(&request_metadata_recv); + grpc_call_details_init(&call_details); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + if (client_init_metadata != NULL) { + op->data.send_initial_metadata.count = 1; + op->data.send_initial_metadata.metadata = client_init_metadata; + } else { + op->data.send_initial_metadata.count = 0; + } + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_INITIAL_METADATA; + op->data.recv_initial_metadata = &initial_metadata_recv; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; + op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; + op->data.recv_status_on_client.status = &status; + op->data.recv_status_on_client.status_details = &details; + op->data.recv_status_on_client.status_details_capacity = &details_capacity; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + error = + grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, tag(100)); + GPR_ASSERT(GRPC_CALL_OK == error); + cq_expect_completion(cqv, tag(100), true); + cq_verify(cqv); + + GPR_ASSERT(GPR_BITCOUNT(grpc_call_test_only_get_encodings_accepted_by_peer( + s)) == GRPC_COMPRESS_ALGORITHMS_COUNT); GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), GRPC_COMPRESS_NONE) != 0); GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), @@ -205,29 +373,107 @@ static void request_with_payload_template( GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s), GRPC_COMPRESS_GZIP) != 0); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; + if (set_server_level) { + op->data.send_initial_metadata.maybe_compression_level.is_set = true; + op->data.send_initial_metadata.maybe_compression_level.level = + server_compression_level; + } op->flags = 0; op->reserved = NULL; op++; - op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op->reserved = NULL; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL); + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL); GPR_ASSERT(GRPC_CALL_OK == error); - cq_expect_completion(cqv, tag(102), 1); - cq_verify(cqv); + for (int i = 0; i < 2; i++) { + request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); + response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_MESSAGE; + op->data.send_message = request_payload; + op->flags = client_send_flags_bitmask; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message = &response_payload_recv; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message = &request_payload_recv; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + cq_expect_completion(cqv, tag(102), 1); + cq_verify(cqv); + + GPR_ASSERT(request_payload_recv->type == GRPC_BB_RAW); + GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, request_str)); + GPR_ASSERT(request_payload_recv->data.raw.compression == + expected_algorithm_from_client); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_MESSAGE; + op->data.send_message = response_payload; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + cq_expect_completion(cqv, tag(103), 1); + cq_expect_completion(cqv, tag(2), 1); + cq_verify(cqv); + + GPR_ASSERT(response_payload_recv->type == GRPC_BB_RAW); + GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, response_str)); + if (server_compression_level > GRPC_COMPRESS_LEVEL_NONE) { + const grpc_compression_algorithm algo_for_server_level = + grpc_call_compression_for_level(s, server_compression_level); + GPR_ASSERT(response_payload_recv->data.raw.compression == + algo_for_server_level); + } else { + GPR_ASSERT(response_payload_recv->data.raw.compression == + expected_algorithm_from_server); + } + + grpc_byte_buffer_destroy(request_payload); + grpc_byte_buffer_destroy(response_payload); + grpc_byte_buffer_destroy(request_payload_recv); + grpc_byte_buffer_destroy(response_payload_recv); + } + + gpr_slice_unref(request_payload_slice); + gpr_slice_unref(response_payload_slice); + memset(ops, 0, sizeof(ops)); op = ops; - op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; - op->data.recv_close_on_server.cancelled = &was_cancelled; + op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op->flags = 0; op->reserved = NULL; op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + memset(ops, 0, sizeof(ops)); + op = ops; op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; op->data.send_status_from_server.trailing_metadata_count = 0; op->data.send_status_from_server.status = GRPC_STATUS_OK; @@ -235,11 +481,13 @@ static void request_with_payload_template( op->flags = 0; op->reserved = NULL; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL); GPR_ASSERT(GRPC_CALL_OK == error); - cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); + cq_expect_completion(cqv, tag(3), 1); + cq_expect_completion(cqv, tag(101), 1); + cq_expect_completion(cqv, tag(104), 1); cq_verify(cqv); GPR_ASSERT(status == GRPC_STATUS_OK); @@ -248,12 +496,6 @@ static void request_with_payload_template( GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr")); GPR_ASSERT(was_cancelled == 0); - GPR_ASSERT(request_payload_recv->type == GRPC_BB_RAW); - GPR_ASSERT(request_payload_recv->data.raw.compression == - expected_compression_algorithm); - - GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, str)); - gpr_free(details); grpc_metadata_array_destroy(&initial_metadata_recv); grpc_metadata_array_destroy(&trailing_metadata_recv); @@ -265,10 +507,6 @@ static void request_with_payload_template( cq_verifier_destroy(cqv); - gpr_slice_unref(request_payload_slice); - grpc_byte_buffer_destroy(request_payload); - grpc_byte_buffer_destroy(request_payload_recv); - grpc_channel_args_destroy(client_args); grpc_channel_args_destroy(server_args); @@ -280,61 +518,90 @@ static void test_invoke_request_with_exceptionally_uncompressed_payload( grpc_end2end_test_config config) { request_with_payload_template( config, "test_invoke_request_with_exceptionally_uncompressed_payload", - GRPC_WRITE_NO_COMPRESS, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_NONE, NULL); + GRPC_WRITE_NO_COMPRESS, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, + GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, NULL, false, + /* ignored */ GRPC_COMPRESS_LEVEL_NONE); } static void test_invoke_request_with_uncompressed_payload( grpc_end2end_test_config config) { request_with_payload_template( config, "test_invoke_request_with_uncompressed_payload", 0, - GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, NULL); + GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, + GRPC_COMPRESS_NONE, NULL, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE); } static void test_invoke_request_with_compressed_payload( grpc_end2end_test_config config) { request_with_payload_template( config, "test_invoke_request_with_compressed_payload", 0, - GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, NULL); + GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, + GRPC_COMPRESS_GZIP, NULL, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE); +} + +static void test_invoke_request_with_server_level( + grpc_end2end_test_config config) { + request_with_payload_template( + config, "test_invoke_request_with_server_level", 0, GRPC_COMPRESS_NONE, + GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE /* ignored */, + NULL, true, GRPC_COMPRESS_LEVEL_HIGH); } static void test_invoke_request_with_compressed_payload_md_override( grpc_end2end_test_config config) { grpc_metadata gzip_compression_override; - grpc_metadata none_compression_override; + grpc_metadata identity_compression_override; - gzip_compression_override.key = GRPC_COMPRESS_REQUEST_ALGORITHM_KEY; + gzip_compression_override.key = GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY; gzip_compression_override.value = "gzip"; - gzip_compression_override.value_length = 4; + gzip_compression_override.value_length = + strlen(gzip_compression_override.value); memset(&gzip_compression_override.internal_data, 0, sizeof(gzip_compression_override.internal_data)); - none_compression_override.key = GRPC_COMPRESS_REQUEST_ALGORITHM_KEY; - none_compression_override.value = "identity"; - none_compression_override.value_length = 4; - memset(&none_compression_override.internal_data, 0, - sizeof(none_compression_override.internal_data)); + identity_compression_override.key = GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY; + identity_compression_override.value = "identity"; + identity_compression_override.value_length = + strlen(identity_compression_override.value); + memset(&identity_compression_override.internal_data, 0, + sizeof(identity_compression_override.internal_data)); /* Channel default NONE (aka IDENTITY), call override to GZIP */ request_with_payload_template( config, "test_invoke_request_with_compressed_payload_md_override_1", 0, - GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, &gzip_compression_override); + GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, + GRPC_COMPRESS_NONE, &gzip_compression_override, false, + /*ignored*/ GRPC_COMPRESS_LEVEL_NONE); /* Channel default DEFLATE, call override to GZIP */ request_with_payload_template( config, "test_invoke_request_with_compressed_payload_md_override_2", 0, - GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_GZIP, &gzip_compression_override); + GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, + GRPC_COMPRESS_NONE, &gzip_compression_override, false, + /*ignored*/ GRPC_COMPRESS_LEVEL_NONE); /* Channel default DEFLATE, call override to NONE (aka IDENTITY) */ request_with_payload_template( config, "test_invoke_request_with_compressed_payload_md_override_3", 0, - GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, &none_compression_override); + GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, + GRPC_COMPRESS_NONE, &identity_compression_override, false, + /*ignored*/ GRPC_COMPRESS_LEVEL_NONE); +} + +static void test_invoke_request_with_disabled_algorithm( + grpc_end2end_test_config config) { + request_for_disabled_algorithm( + config, "test_invoke_request_with_disabled_algorithm", 0, + GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_STATUS_UNIMPLEMENTED, NULL); } void compressed_payload(grpc_end2end_test_config config) { test_invoke_request_with_exceptionally_uncompressed_payload(config); test_invoke_request_with_uncompressed_payload(config); test_invoke_request_with_compressed_payload(config); + test_invoke_request_with_server_level(config); test_invoke_request_with_compressed_payload_md_override(config); + test_invoke_request_with_disabled_algorithm(config); } void compressed_payload_pre_init(void) {} diff --git a/test/core/end2end/tests/default_host.c b/test/core/end2end/tests/default_host.c index 44384a783e..728ee597b5 100644 --- a/test/core/end2end/tests/default_host.c +++ b/test/core/end2end/tests/default_host.c @@ -131,6 +131,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -173,6 +174,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { gpr_log(GPR_DEBUG, "client_peer=%s", peer); gpr_free(peer); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c index 03d1ded04c..536fbd0d8a 100644 --- a/test/core/end2end/tests/disappearing_server.c +++ b/test/core/end2end/tests/disappearing_server.c @@ -108,6 +108,7 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f, grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -145,6 +146,7 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f, - and still complete the request */ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index 99049aa6bd..526c05ca3e 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -134,6 +134,7 @@ static void test_request(grpc_end2end_test_config config) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -175,7 +176,7 @@ static void test_request(grpc_end2end_test_config config) { cq_verify(cqv); GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED); - GPR_ASSERT(0 == strcmp(details, "Random failure that's not preventable.")); + GPR_ASSERT(0 == strcmp(details, "Failure that's not preventable.")); gpr_free(details); grpc_metadata_array_destroy(&initial_metadata_recv); @@ -202,20 +203,23 @@ typedef struct { grpc_closure *recv_im_ready; } call_data; typedef struct { uint8_t unused; } channel_data; -static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { grpc_call_element *elem = arg; call_data *calld = elem->call_data; - if (success) { + if (error == GRPC_ERROR_NONE) { // close the stream with an error. gpr_slice message = - gpr_slice_from_copied_string("Random failure that's not preventable."); + gpr_slice_from_copied_string("Failure that's not preventable."); grpc_transport_stream_op op; memset(&op, 0, sizeof(op)); grpc_transport_stream_op_add_close(&op, GRPC_STATUS_PERMISSION_DENIED, &message); grpc_call_next_op(exec_ctx, elem, &op); } - calld->recv_im_ready->cb(exec_ctx, calld->recv_im_ready->cb_arg, false); + grpc_exec_ctx_sched( + exec_ctx, calld->recv_im_ready, + GRPC_ERROR_CREATE_REFERENCING("Forced call to close", &error, 1), NULL); } static void start_transport_stream_op(grpc_exec_ctx *exec_ctx, @@ -233,6 +237,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_call_element_args *args) {} static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, + const grpc_call_stats *stats, void *and_free_memory) {} static void init_channel_elem(grpc_exec_ctx *exec_ctx, @@ -247,7 +252,7 @@ static const grpc_channel_filter test_filter = { grpc_channel_next_op, sizeof(call_data), init_call_elem, - grpc_call_stack_ignore_set_pollset, + grpc_call_stack_ignore_set_pollset_or_pollset_set, destroy_call_elem, sizeof(channel_data), init_channel_elem, diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c index 26198f3bdf..f527b8617d 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.c @@ -122,6 +122,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -160,6 +161,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead)); cq_verify_empty(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/high_initial_seqno.c b/test/core/end2end/tests/high_initial_seqno.c index 374606dcb7..50e3c9cb89 100644 --- a/test/core/end2end/tests/high_initial_seqno.c +++ b/test/core/end2end/tests/high_initial_seqno.c @@ -128,6 +128,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -161,6 +162,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/hpack_size.c b/test/core/end2end/tests/hpack_size.c index 07d5d387b4..7ff0461f5f 100644 --- a/test/core/end2end/tests/hpack_size.c +++ b/test/core/end2end/tests/hpack_size.c @@ -49,187 +49,142 @@ static void *tag(intptr_t t) { return (void *)t; } -const char *hobbits[][2] = {{"Adaldrida", "Brandybuck"}, - {"Adamanta", "Took"}, - {"Adalgrim", "Took"}, - {"Adelard", "Took"}, - {"Amaranth", "Brandybuck"}, - {"Andwise", "Roper"}, - {"Angelica", "Baggins"}, - {"Asphodel", "Burrows"}, - {"Balbo", "Baggins"}, - {"Bandobras", "Took"}, - {"Belba", "Bolger"}, - {"Bell", "Gamgee"}, - {"Belladonna", "Baggins"}, - {"Berylla", "Baggins"}, - {"Bilbo", "Baggins"}, - {"Bilbo", "Gardner"}, - {"Bill", "Butcher"}, - {"Bingo", "Baggins"}, - {"Bodo", "Proudfoot"}, - {"Bowman", "Cotton"}, - {"Bungo", "Baggins"}, - {"Camellia", "Sackville"}, - {"Carl", "Cotton"}, - {"Celandine", "Brandybuck"}, - {"Chica", "Baggins"}, - {"Daddy", "Twofoot"}, - {"Daisy", "Boffin"}, - {"Diamond", "Took"}, - {"Dinodas", "Brandybuck"}, - {"Doderic", "Brandybuck"}, - {"Dodinas", "Brandybuck"}, - {"Donnamira", "Boffin"}, - {"Dora", "Baggins"}, - {"Drogo", "Baggins"}, - {"Dudo", "Baggins"}, - {"Eglantine", "Took"}, - {"Elanor", "Fairbairn"}, - {"Elfstan", "Fairbairn"}, - {"Esmeralda", "Brandybuck"}, - {"Estella", "Brandybuck"}, - {"Everard", "Took"}, - {"Falco", "Chubb-Baggins"}, - {"Faramir", "Took"}, - {"Farmer", "Maggot"}, - {"Fastolph", "Bolger"}, - {"Ferdibrand", "Took"}, - {"Ferdinand", "Took"}, - {"Ferumbras", "Took"}, - {"Ferumbras", "Took"}, - {"Filibert", "Bolger"}, - {"Firiel", "Fairbairn"}, - {"Flambard", "Took"}, - {"Folco", "Boffin"}, - {"Fortinbras", "Took"}, - {"Fortinbras", "Took"}, - {"Fosco", "Baggins"}, - {"Fredegar", "Bolger"}, - {"Frodo", "Baggins"}, - {"Frodo", "Gardner"}, - {"Gerontius", "Took"}, - {"Gilly", "Baggins"}, - {"Goldilocks", "Took"}, - {"Gorbadoc", "Brandybuck"}, - {"Gorbulas", "Brandybuck"}, - {"Gorhendad", "Brandybuck"}, - {"Gormadoc", "Brandybuck"}, - {"Griffo", "Boffin"}, - {"Halfast", "Gamgee"}, - {"Halfred", "Gamgee"}, - {"Halfred", "Greenhand"}, - {"Hanna", "Brandybuck"}, - {"Hamfast", "Gamgee"}, - {"Hamfast", "Gardner"}, - {"Hamson", "Gamgee"}, - {"Harding", "Gardner"}, - {"Hilda", "Brandybuck"}, - {"Hildibrand", "Took"}, - {"Hildifons", "Took"}, - {"Hildigard", "Took"}, - {"Hildigrim", "Took"}, - {"Hob", "Gammidge"}, - {"Hob", "Hayward"}, - {"Hobson", "Gamgee"}, - {"Holfast", "Gardner"}, - {"Holman", "Cotton"}, - {"Holman", "Greenhand"}, - {"Hugo", "Boffin"}, - {"Hugo", "Bracegirdle"}, - {"Ilberic", "Brandybuck"}, - {"Isembard", "Took"}, - {"Isembold", "Took"}, - {"Isengar", "Took"}, - {"Isengrim", "Took"}, - {"Isengrim", "Took"}, - {"Isumbras", "Took"}, - {"Isumbras", "Took"}, - {"Jolly", "Cotton"}, - {"Lalia", "Took"}, - {"Largo", "Baggins"}, - {"Laura", "Baggins"}, - {"Lily", "Goodbody"}, - {"Lily", "Cotton"}, - {"Linda", "Proudfoot"}, - {"Lobelia", "Sackville-Baggins"}, - {"Longo", "Baggins"}, - {"Lotho", "Sackville-Baggins"}, - {"Madoc", "Brandybuck"}, - {"Malva", "Brandybuck"}, - {"Marigold", "Cotton"}, - {"Marmadas", "Brandybuck"}, - {"Marmadoc", "Brandybuck"}, - {"Marroc", "Brandybuck"}, - {"May", "Gamgee"}, - {"Melilot", "Brandybuck"}, - {"Menegilda", "Brandybuck"}, - {"Mentha", "Brandybuck"}, - {"Meriadoc", "Brandybuck"}, - {"Merimac", "Brandybuck"}, - {"Merimas", "Brandybuck"}, - {"Merry", "Gardner"}, - {"Milo", "Burrows"}, - {"Mimosa", "Baggins"}, - {"Minto", "Burrows"}, - {"Mirabella", "Brandybuck"}, - {"Moro", "Burrows"}, - {"Mosco", "Burrows"}, - {"Mungo", "Baggins"}, - {"Myrtle", "Burrows"}, - {"Odo", "Proudfoot"}, - {"Odovacar", "Bolger"}, - {"Olo", "Proudfoot"}, - {"Orgulas", "Brandybuck"}, - {"Otho", "Sackville-Baggins"}, - {"Paladin", "Took"}, - {"Pansy", "Bolger"}, - {"Pearl", "Took"}, - {"Peony", "Burrows"}, - {"Peregrin", "Took"}, - {"Pervinca", "Took"}, - {"Pimpernel", "Took"}, - {"Pippin", "Gardner"}, - {"Polo", "Baggins"}, - {"Ponto", "Baggins"}, - {"Porto", "Baggins"}, - {"Posco", "Baggins"}, - {"Poppy", "Bolger"}, - {"Primrose", "Gardner"}, - {"Primula", "Baggins"}, - {"Prisca", "Bolger"}, - {"Reginard", "Took"}, - {"Robin", "Smallburrow"}, - {"Robin", "Gardner"}, - {"Rorimac", "Brandybuck"}, - {"Rosa", "Took"}, - {"Rosamunda", "Bolger"}, - {"Rose", "Gardner"}, - {"Ruby", "Baggins"}, - {"Ruby", "Gardner"}, - {"Rudigar", "Bolger"}, - {"Rufus", "Burrows"}, - {"Sadoc", "Brandybuck"}, - {"Salvia", "Bolger"}, - {"Samwise", "Gamgee"}, - {"Sancho", "Proudfoot"}, - {"Saradas", "Brandybuck"}, - {"Saradoc", "Brandybuck"}, - {"Seredic", "Brandybuck"}, - {"Sigismond", "Took"}, - {"Smeagol", "Gollum"}, - {"Tanta", "Baggins"}, - {"Ted", "Sandyman"}, - {"Tobold", "Hornblower"}, - {"Togo", "Goodbody"}, - {"Tolman", "Cotton"}, - {"Tolman", "Gardner"}, - {"Widow", "Rumble"}, - {"Wilcome", "Cotton"}, - {"Wilcome", "Cotton"}, - {"Wilibald", "Bolger"}, - {"Will", "Whitfoot"}, - {"Wiseman", "Gamwich"}}; +const char *hobbits[][2] = { + {"Adaldrida", "Brandybuck"}, {"Adamanta", "Took"}, + {"Adalgrim", "Took"}, {"Adelard", "Took"}, + {"Amaranth", "Brandybuck"}, {"Andwise", "Roper"}, + {"Angelica", "Baggins"}, {"Asphodel", "Burrows"}, + {"Balbo", "Baggins"}, {"Bandobras", "Took"}, + {"Belba", "Bolger"}, {"Bell", "Gamgee"}, + {"Belladonna", "Baggins"}, {"Berylla", "Baggins"}, + {"Bilbo", "Baggins"}, {"Bilbo", "Gardner"}, + {"Bill", "Butcher"}, {"Bingo", "Baggins"}, + {"Bodo", "Proudfoot"}, {"Bowman", "Cotton"}, + {"Bungo", "Baggins"}, {"Camellia", "Sackville"}, + {"Carl", "Cotton"}, {"Celandine", "Brandybuck"}, + {"Chica", "Baggins"}, {"Daddy", "Twofoot"}, + {"Daisy", "Boffin"}, {"Diamond", "Took"}, + {"Dinodas", "Brandybuck"}, {"Doderic", "Brandybuck"}, + {"Dodinas", "Brandybuck"}, {"Donnamira", "Boffin"}, + {"Dora", "Baggins"}, {"Drogo", "Baggins"}, + {"Dudo", "Baggins"}, {"Eglantine", "Took"}, + {"Elanor", "Fairbairn"}, {"Elfstan", "Fairbairn"}, + {"Esmeralda", "Brandybuck"}, {"Estella", "Brandybuck"}, + {"Everard", "Took"}, {"Falco", "Chubb-Baggins"}, + {"Faramir", "Took"}, {"Farmer", "Maggot"}, + {"Fastolph", "Bolger"}, {"Ferdibrand", "Took"}, + {"Ferdinand", "Took"}, {"Ferumbras", "Took"}, + {"Ferumbras", "Took"}, {"Filibert", "Bolger"}, + {"Firiel", "Fairbairn"}, {"Flambard", "Took"}, + {"Folco", "Boffin"}, {"Fortinbras", "Took"}, + {"Fortinbras", "Took"}, {"Fosco", "Baggins"}, + {"Fredegar", "Bolger"}, {"Frodo", "Baggins"}, + {"Frodo", "Gardner"}, {"Gerontius", "Took"}, + {"Gilly", "Baggins"}, {"Goldilocks", "Took"}, + {"Gorbadoc", "Brandybuck"}, {"Gorbulas", "Brandybuck"}, + {"Gorhendad", "Brandybuck"}, {"Gormadoc", "Brandybuck"}, + {"Griffo", "Boffin"}, {"Halfast", "Gamgee"}, + {"Halfred", "Gamgee"}, {"Halfred", "Greenhand"}, + {"Hanna", "Brandybuck"}, {"Hamfast", "Gamgee"}, + {"Hamfast", "Gardner"}, {"Hamson", "Gamgee"}, + {"Harding", "Gardner"}, {"Hilda", "Brandybuck"}, + {"Hildibrand", "Took"}, {"Hildifons", "Took"}, + {"Hildigard", "Took"}, {"Hildigrim", "Took"}, + {"Hob", "Gammidge"}, {"Hob", "Hayward"}, + {"Hobson", "Gamgee"}, {"Holfast", "Gardner"}, + {"Holman", "Cotton"}, {"Holman", "Greenhand"}, + {"Hugo", "Boffin"}, {"Hugo", "Bracegirdle"}, + {"Ilberic", "Brandybuck"}, {"Isembard", "Took"}, + {"Isembold", "Took"}, {"Isengar", "Took"}, + {"Isengrim", "Took"}, {"Isengrim", "Took"}, + {"Isumbras", "Took"}, {"Isumbras", "Took"}, + {"Jolly", "Cotton"}, + /* + {"Lalia", "Took"}, + {"Largo", "Baggins"}, + {"Laura", "Baggins"}, + {"Lily", "Goodbody"}, + {"Lily", "Cotton"}, + {"Linda", "Proudfoot"}, + {"Lobelia", "Sackville-Baggins"}, + {"Longo", "Baggins"}, + {"Lotho", "Sackville-Baggins"}, + {"Madoc", "Brandybuck"}, + {"Malva", "Brandybuck"}, + {"Marigold", "Cotton"}, + {"Marmadas", "Brandybuck"}, + {"Marmadoc", "Brandybuck"}, + {"Marroc", "Brandybuck"}, + {"May", "Gamgee"}, + {"Melilot", "Brandybuck"}, + {"Menegilda", "Brandybuck"}, + {"Mentha", "Brandybuck"}, + {"Meriadoc", "Brandybuck"}, + {"Merimac", "Brandybuck"}, + {"Merimas", "Brandybuck"}, + {"Merry", "Gardner"}, + {"Milo", "Burrows"}, + {"Mimosa", "Baggins"}, + {"Minto", "Burrows"}, + {"Mirabella", "Brandybuck"}, + {"Moro", "Burrows"}, + {"Mosco", "Burrows"}, + {"Mungo", "Baggins"}, + {"Myrtle", "Burrows"}, + {"Odo", "Proudfoot"}, + {"Odovacar", "Bolger"}, + {"Olo", "Proudfoot"}, + {"Orgulas", "Brandybuck"}, + {"Otho", "Sackville-Baggins"}, + {"Paladin", "Took"}, + {"Pansy", "Bolger"}, + {"Pearl", "Took"}, + {"Peony", "Burrows"}, + {"Peregrin", "Took"}, + {"Pervinca", "Took"}, + {"Pimpernel", "Took"}, + {"Pippin", "Gardner"}, + {"Polo", "Baggins"}, + {"Ponto", "Baggins"}, + {"Porto", "Baggins"}, + {"Posco", "Baggins"}, + {"Poppy", "Bolger"}, + {"Primrose", "Gardner"}, + {"Primula", "Baggins"}, + {"Prisca", "Bolger"}, + {"Reginard", "Took"}, + {"Robin", "Smallburrow"}, + {"Robin", "Gardner"}, + {"Rorimac", "Brandybuck"}, + {"Rosa", "Took"}, + {"Rosamunda", "Bolger"}, + {"Rose", "Gardner"}, + {"Ruby", "Baggins"}, + {"Ruby", "Gardner"}, + {"Rudigar", "Bolger"}, + {"Rufus", "Burrows"}, + {"Sadoc", "Brandybuck"}, + {"Salvia", "Bolger"}, + {"Samwise", "Gamgee"}, + {"Sancho", "Proudfoot"}, + {"Saradas", "Brandybuck"}, + {"Saradoc", "Brandybuck"}, + {"Seredic", "Brandybuck"}, + {"Sigismond", "Took"}, + {"Smeagol", "Gollum"}, + {"Tanta", "Baggins"}, + {"Ted", "Sandyman"}, + {"Tobold", "Hornblower"}, + {"Togo", "Goodbody"}, + {"Tolman", "Cotton"}, + {"Tolman", "Gardner"}, + {"Widow", "Rumble"}, + {"Wilcome", "Cotton"}, + {"Wilcome", "Cotton"}, + {"Wilibald", "Bolger"}, + {"Will", "Whitfoot"}, + {"Wiseman", "Gamwich"}*/ +}; const char *dragons[] = {"Ancalagon", "Glaurung", "Scatha", "Smaug the Magnificent"}; @@ -323,6 +278,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t index) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = GPR_ARRAY_SIZE(extra_metadata); @@ -357,6 +313,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t index) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/idempotent_request.c b/test/core/end2end/tests/idempotent_request.c index e53f3b2aaa..dfedcfebee 100644 --- a/test/core/end2end/tests/idempotent_request.c +++ b/test/core/end2end/tests/idempotent_request.c @@ -132,6 +132,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -174,6 +175,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { gpr_log(GPR_DEBUG, "client_peer=%s", peer); gpr_free(peer); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c index 6410305451..9c9ca95129 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.c @@ -138,6 +138,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -181,6 +182,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -198,6 +200,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config) { cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index ae1f68a2b4..1f27896019 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -142,6 +142,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); // Client: send request. op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; @@ -183,6 +184,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); // Server: send initial metadata and receive request. op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; @@ -201,6 +203,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); // Server: receive close and send status. This should trigger // completion of request on client. op = ops; diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index 1bb53073cb..41de74ff87 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -124,6 +124,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -157,6 +158,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -270,6 +272,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { f.server, &s1, &call_details, &request_metadata_recv, f.cq, f.cq, tag(101))); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -283,6 +286,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), NULL); GPR_ASSERT(GRPC_CALL_OK == error); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1; @@ -300,6 +304,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), NULL); GPR_ASSERT(GRPC_CALL_OK == error); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -313,6 +318,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), NULL); GPR_ASSERT(GRPC_CALL_OK == error); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2; @@ -354,6 +360,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { } GPR_ASSERT(live_call == 300 || live_call == 400); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -388,6 +395,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { cq_expect_completion(cqv, tag(201), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index 4f572789d9..08d326ab4d 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -143,6 +143,7 @@ static void test_max_message_length(grpc_end2end_test_config config) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -181,6 +182,7 @@ static void test_max_message_length(grpc_end2end_test_config config) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; diff --git a/test/core/end2end/tests/negative_deadline.c b/test/core/end2end/tests/negative_deadline.c index 03e57a90f6..dff7992f63 100644 --- a/test/core/end2end/tests/negative_deadline.c +++ b/test/core/end2end/tests/negative_deadline.c @@ -112,7 +112,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) { char *details = NULL; size_t details_capacity = 0; - gpr_log(GPR_DEBUG, "test with %d ops", num_ops); + gpr_log(GPR_DEBUG, "test with %" PRIuPTR " ops", num_ops); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo", "foo.test.google.fr:1234", deadline, @@ -122,6 +122,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) { grpc_metadata_array_init(&initial_metadata_recv); grpc_metadata_array_init(&trailing_metadata_recv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c index bdfb135406..443d85eecc 100644 --- a/test/core/end2end/tests/payload.c +++ b/test/core/end2end/tests/payload.c @@ -131,6 +131,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -174,6 +175,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -191,6 +193,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index 15e1c6e338..1d2f7943c1 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -135,6 +135,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -164,6 +165,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, cq_expect_completion(cqv, tag(100), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -182,6 +184,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; op->data.send_message = request_payload; @@ -196,6 +199,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL); GPR_ASSERT(GRPC_CALL_OK == error); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message = &request_payload_recv; @@ -207,6 +211,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; op->data.send_message = response_payload; @@ -228,6 +233,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, gpr_slice_unref(request_payload_slice); gpr_slice_unref(response_payload_slice); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op->flags = 0; @@ -236,6 +242,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL); GPR_ASSERT(GRPC_CALL_OK == error); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; op->data.send_status_from_server.trailing_metadata_count = 0; diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c index 3c4edbae7d..ece6250ea1 100644 --- a/test/core/end2end/tests/registered_call.c +++ b/test/core/end2end/tests/registered_call.c @@ -125,6 +125,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -158,6 +159,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c index f5a8d4d60c..b5d398bba9 100644 --- a/test/core/end2end/tests/request_with_flags.c +++ b/test/core/end2end/tests/request_with_flags.c @@ -131,6 +131,7 @@ static void test_invoke_request_with_flags( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index 7706404090..d94267e09c 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -130,6 +130,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -167,6 +168,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -184,6 +186,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c index a4f5319e5b..a723c6fd2c 100644 --- a/test/core/end2end/tests/server_finishes_request.c +++ b/test/core/end2end/tests/server_finishes_request.c @@ -126,6 +126,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -155,6 +156,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/shutdown_finishes_calls.c b/test/core/end2end/tests/shutdown_finishes_calls.c index 80287cd507..abb6b26a87 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.c +++ b/test/core/end2end/tests/shutdown_finishes_calls.c @@ -115,6 +115,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -149,6 +150,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c index 400b3a0027..e1fcc035bb 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.c @@ -117,6 +117,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -152,6 +153,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c index 707b3c9512..c9b1a03da5 100644 --- a/test/core/end2end/tests/simple_metadata.c +++ b/test/core/end2end/tests/simple_metadata.c @@ -141,6 +141,7 @@ static void test_request_response_with_metadata_and_payload( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 2; @@ -185,6 +186,7 @@ static void test_request_response_with_metadata_and_payload( cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 2; @@ -203,6 +205,7 @@ static void test_request_response_with_metadata_and_payload( cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c index 42108425e6..a8014e6894 100644 --- a/test/core/end2end/tests/simple_request.c +++ b/test/core/end2end/tests/simple_request.c @@ -132,6 +132,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -174,6 +175,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { gpr_log(GPR_DEBUG, "client_peer=%s", peer); gpr_free(peer); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; diff --git a/test/core/end2end/tests/streaming_error_response.c b/test/core/end2end/tests/streaming_error_response.c new file mode 100644 index 0000000000..e15c132d63 --- /dev/null +++ b/test/core/end2end/tests/streaming_error_response.c @@ -0,0 +1,278 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/core/end2end/end2end_tests.h" + +#include <stdio.h> +#include <string.h> + +#include <grpc/byte_buffer.h> +#include <grpc/support/alloc.h> +#include <grpc/support/log.h> +#include <grpc/support/time.h> +#include <grpc/support/useful.h> +#include "test/core/end2end/cq_verifier.h" + +enum { TIMEOUT = 200000 }; + +static void *tag(intptr_t t) { return (void *)t; } + +static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, + const char *test_name, + grpc_channel_args *client_args, + grpc_channel_args *server_args, + bool request_status_early) { + grpc_end2end_test_fixture f; + gpr_log(GPR_INFO, "%s/%s/request_status_early=%s", test_name, config.name, + request_status_early ? "true" : "false"); + f = config.create_fixture(client_args, server_args); + config.init_server(&f, server_args); + config.init_client(&f, client_args); + return f; +} + +static gpr_timespec n_seconds_time(int n) { + return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); +} + +static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } + +static void drain_cq(grpc_completion_queue *cq) { + grpc_event ev; + do { + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); + } while (ev.type != GRPC_QUEUE_SHUTDOWN); +} + +static void shutdown_server(grpc_end2end_test_fixture *f) { + if (!f->server) return; + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + .type == GRPC_OP_COMPLETE); + grpc_server_destroy(f->server); + f->server = NULL; +} + +static void shutdown_client(grpc_end2end_test_fixture *f) { + if (!f->client) return; + grpc_channel_destroy(f->client); + f->client = NULL; +} + +static void end_test(grpc_end2end_test_fixture *f) { + shutdown_server(f); + shutdown_client(f); + + grpc_completion_queue_shutdown(f->cq); + drain_cq(f->cq); + grpc_completion_queue_destroy(f->cq); +} + +/* Client sends a request with payload, server reads then returns status. */ +static void test(grpc_end2end_test_config config, bool request_status_early) { + grpc_call *c; + grpc_call *s; + gpr_slice response_payload1_slice = gpr_slice_from_copied_string("hello"); + grpc_byte_buffer *response_payload1 = + grpc_raw_byte_buffer_create(&response_payload1_slice, 1); + gpr_slice response_payload2_slice = gpr_slice_from_copied_string("world"); + grpc_byte_buffer *response_payload2 = + grpc_raw_byte_buffer_create(&response_payload2_slice, 1); + gpr_timespec deadline = five_seconds_time(); + grpc_end2end_test_fixture f = begin_test(config, "streaming_error_response", + NULL, NULL, request_status_early); + cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_op ops[6]; + grpc_op *op; + grpc_metadata_array initial_metadata_recv; + grpc_metadata_array trailing_metadata_recv; + grpc_metadata_array request_metadata_recv; + grpc_byte_buffer *response_payload1_recv = NULL; + grpc_byte_buffer *response_payload2_recv = NULL; + grpc_call_details call_details; + grpc_status_code status; + grpc_call_error error; + char *details = NULL; + 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", deadline, NULL); + GPR_ASSERT(c); + + grpc_metadata_array_init(&initial_metadata_recv); + grpc_metadata_array_init(&trailing_metadata_recv); + grpc_metadata_array_init(&request_metadata_recv); + grpc_call_details_init(&call_details); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 0; + op++; + op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; + op++; + op->op = GRPC_OP_RECV_INITIAL_METADATA; + op->data.recv_initial_metadata = &initial_metadata_recv; + op++; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message = &response_payload1_recv; + op++; + if (request_status_early) { + op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; + op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; + op->data.recv_status_on_client.status = &status; + op->data.recv_status_on_client.status_details = &details; + op->data.recv_status_on_client.status_details_capacity = &details_capacity; + op++; + } + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( + f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, tag(101))); + cq_expect_completion(cqv, tag(101), 1); + cq_verify(cqv); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 0; + op++; + op->op = GRPC_OP_SEND_MESSAGE; + op->data.send_message = response_payload1; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + cq_expect_completion(cqv, tag(102), 1); + cq_verify(cqv); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_MESSAGE; + op->data.send_message = response_payload2; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + cq_expect_completion(cqv, tag(103), 1); + if (!request_status_early) { + cq_expect_completion(cqv, tag(1), 1); + } + cq_verify(cqv); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op++; + op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; + op->data.send_status_from_server.trailing_metadata_count = 0; + op->data.send_status_from_server.status = GRPC_STATUS_FAILED_PRECONDITION; + op->data.send_status_from_server.status_details = "xyz"; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + if (!request_status_early) { + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message = &response_payload2_recv; + op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + } + + cq_expect_completion(cqv, tag(104), 1); + if (request_status_early) { + cq_expect_completion(cqv, tag(1), 1); + } else { + cq_expect_completion(cqv, tag(2), 1); + } + cq_verify(cqv); + + if (!request_status_early) { + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; + op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; + op->data.recv_status_on_client.status = &status; + op->data.recv_status_on_client.status_details = &details; + op->data.recv_status_on_client.status_details_capacity = &details_capacity; + op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + cq_expect_completion(cqv, tag(3), 1); + cq_verify(cqv); + + GPR_ASSERT(response_payload1_recv != NULL); + GPR_ASSERT(response_payload2_recv != NULL); + } + + GPR_ASSERT(status == GRPC_STATUS_FAILED_PRECONDITION); + 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")); + GPR_ASSERT(was_cancelled == 1); + + gpr_free(details); + grpc_metadata_array_destroy(&initial_metadata_recv); + grpc_metadata_array_destroy(&trailing_metadata_recv); + grpc_metadata_array_destroy(&request_metadata_recv); + grpc_call_details_destroy(&call_details); + + grpc_call_destroy(c); + grpc_call_destroy(s); + + cq_verifier_destroy(cqv); + + grpc_byte_buffer_destroy(response_payload1); + grpc_byte_buffer_destroy(response_payload2); + grpc_byte_buffer_destroy(response_payload1_recv); + grpc_byte_buffer_destroy(response_payload2_recv); + + end_test(&f); + config.tear_down_data(&f); +} + +void streaming_error_response(grpc_end2end_test_config config) { + test(config, false); + test(config, true); +} + +void streaming_error_response_pre_init(void) {} diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.c index 4dd8c12cba..41e0f00911 100644 --- a/test/core/end2end/tests/trailing_metadata.c +++ b/test/core/end2end/tests/trailing_metadata.c @@ -144,6 +144,7 @@ static void test_request_response_with_metadata_and_payload( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 2; @@ -188,6 +189,7 @@ static void test_request_response_with_metadata_and_payload( cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 2; @@ -206,6 +208,7 @@ static void test_request_response_with_metadata_and_payload( cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; diff --git a/test/core/fling/client.c b/test/core/fling/client.c index 81562277ec..bcc195a92f 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.c @@ -65,6 +65,7 @@ static void init_ping_pong_request(void) { grpc_metadata_array_init(&initial_metadata_recv); grpc_metadata_array_init(&trailing_metadata_recv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; @@ -176,12 +177,17 @@ int main(int argc, char **argv) { fake_argv[0] = argv[0]; grpc_test_init(1, fake_argv); + int warmup_seconds = 1; + int benchmark_seconds = 5; + cl = gpr_cmdline_create("fling client"); gpr_cmdline_add_int(cl, "payload_size", "Size of the payload to send", &payload_size); gpr_cmdline_add_string(cl, "target", "Target host:port", &target); gpr_cmdline_add_flag(cl, "secure", "Run with security?", &secure); gpr_cmdline_add_string(cl, "scenario", "Scenario", &scenario_name); + gpr_cmdline_add_int(cl, "warmup", "Warmup seconds", &warmup_seconds); + gpr_cmdline_add_int(cl, "benchmark", "Benchmark seconds", &benchmark_seconds); gpr_cmdline_parse(cl, argc, argv); gpr_cmdline_destroy(cl); @@ -205,8 +211,9 @@ int main(int argc, char **argv) { sc.init(); - gpr_timespec end_warmup = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3); - gpr_timespec end_profiling = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(30); + gpr_timespec end_warmup = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(warmup_seconds); + gpr_timespec end_profiling = + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(warmup_seconds + benchmark_seconds); while (gpr_time_cmp(gpr_now(end_warmup.clock_type), end_warmup) < 0) { sc.do_one_step(); diff --git a/test/core/http/httpcli_test.c b/test/core/http/httpcli_test.c index d3a68d0eb8..38b32a3867 100644 --- a/test/core/http/httpcli_test.c +++ b/test/core/http/httpcli_test.c @@ -48,25 +48,26 @@ static int g_done = 0; static grpc_httpcli_context g_context; static gpr_mu *g_mu; -static grpc_pollset *g_pollset; +static grpc_polling_entity g_pops; static gpr_timespec n_seconds_time(int seconds) { return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds); } -static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, - const grpc_httpcli_response *response) { +static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { const char *expect = "<html><head><title>Hello world!</title></head>" "<body><p>This is a test</p></body></html>"; - GPR_ASSERT(arg == (void *)42); + grpc_http_response *response = arg; GPR_ASSERT(response); GPR_ASSERT(response->status == 200); GPR_ASSERT(response->body_length == strlen(expect)); GPR_ASSERT(0 == memcmp(expect, response->body, response->body_length)); gpr_mu_lock(g_mu); g_done = 1; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", + grpc_pollset_kick(grpc_polling_entity_pollset(&g_pops), NULL))); gpr_mu_unlock(g_mu); } @@ -86,19 +87,25 @@ static void test_get(int port) { req.http.path = "/get"; req.handshaker = &grpc_httpcli_plaintext; - grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15), - on_finish, (void *)42); + grpc_http_response response; + memset(&response, 0, sizeof(response)); + grpc_httpcli_get(&exec_ctx, &g_context, &g_pops, &req, n_seconds_time(15), + grpc_closure_create(on_finish, &response), &response); gpr_mu_lock(g_mu); while (!g_done) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), n_seconds_time(20)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops), + &worker, gpr_now(GPR_CLOCK_MONOTONIC), + n_seconds_time(20)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); } gpr_mu_unlock(g_mu); gpr_free(host); + grpc_http_response_destroy(&response); } static void test_post(int port) { @@ -117,23 +124,30 @@ static void test_post(int port) { req.http.path = "/post"; req.handshaker = &grpc_httpcli_plaintext; - grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5, - n_seconds_time(15), on_finish, (void *)42); + grpc_http_response response; + memset(&response, 0, sizeof(response)); + grpc_httpcli_post(&exec_ctx, &g_context, &g_pops, &req, "hello", 5, + n_seconds_time(15), + grpc_closure_create(on_finish, &response), &response); gpr_mu_lock(g_mu); while (!g_done) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), n_seconds_time(20)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops), + &worker, gpr_now(GPR_CLOCK_MONOTONIC), + n_seconds_time(20)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); } gpr_mu_unlock(g_mu); gpr_free(host); + grpc_http_response_destroy(&response); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { - grpc_pollset_destroy(p); +static void destroy_pops(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { + grpc_pollset_destroy(grpc_polling_entity_pollset(p)); } int main(int argc, char **argv) { @@ -180,19 +194,21 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); grpc_httpcli_context_init(&g_context); - g_pollset = gpr_malloc(grpc_pollset_size()); - grpc_pollset_init(g_pollset, &g_mu); + grpc_pollset *pollset = gpr_malloc(grpc_pollset_size()); + grpc_pollset_init(pollset, &g_mu); + g_pops = grpc_polling_entity_create_from_pollset(pollset); test_get(port); test_post(port); grpc_httpcli_context_destroy(&g_context); - grpc_closure_init(&destroyed, destroy_pollset, g_pollset); - grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed); + grpc_closure_init(&destroyed, destroy_pops, &g_pops); + grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&g_pops), + &destroyed); grpc_exec_ctx_finish(&exec_ctx); grpc_shutdown(); - gpr_free(g_pollset); + gpr_free(grpc_polling_entity_pollset(&g_pops)); gpr_subprocess_destroy(server); diff --git a/test/core/http/httpscli_test.c b/test/core/http/httpscli_test.c index d807336904..359e557689 100644 --- a/test/core/http/httpscli_test.c +++ b/test/core/http/httpscli_test.c @@ -48,25 +48,26 @@ static int g_done = 0; static grpc_httpcli_context g_context; static gpr_mu *g_mu; -static grpc_pollset *g_pollset; +static grpc_polling_entity g_pops; static gpr_timespec n_seconds_time(int seconds) { return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds); } -static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, - const grpc_httpcli_response *response) { +static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { const char *expect = "<html><head><title>Hello world!</title></head>" "<body><p>This is a test</p></body></html>"; - GPR_ASSERT(arg == (void *)42); + grpc_http_response *response = arg; GPR_ASSERT(response); GPR_ASSERT(response->status == 200); GPR_ASSERT(response->body_length == strlen(expect)); GPR_ASSERT(0 == memcmp(expect, response->body, response->body_length)); gpr_mu_lock(g_mu); g_done = 1; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", + grpc_pollset_kick(grpc_polling_entity_pollset(&g_pops), NULL))); gpr_mu_unlock(g_mu); } @@ -87,19 +88,25 @@ static void test_get(int port) { req.http.path = "/get"; req.handshaker = &grpc_httpcli_ssl; - grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15), - on_finish, (void *)42); + grpc_http_response response; + memset(&response, 0, sizeof(response)); + grpc_httpcli_get(&exec_ctx, &g_context, &g_pops, &req, n_seconds_time(15), + grpc_closure_create(on_finish, &response), &response); gpr_mu_lock(g_mu); while (!g_done) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), n_seconds_time(20)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops), + &worker, gpr_now(GPR_CLOCK_MONOTONIC), + n_seconds_time(20)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); } gpr_mu_unlock(g_mu); gpr_free(host); + grpc_http_response_destroy(&response); } static void test_post(int port) { @@ -119,23 +126,30 @@ static void test_post(int port) { req.http.path = "/post"; req.handshaker = &grpc_httpcli_ssl; - grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5, - n_seconds_time(15), on_finish, (void *)42); + grpc_http_response response; + memset(&response, 0, sizeof(response)); + grpc_httpcli_post(&exec_ctx, &g_context, &g_pops, &req, "hello", 5, + n_seconds_time(15), + grpc_closure_create(on_finish, &response), &response); gpr_mu_lock(g_mu); while (!g_done) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), n_seconds_time(20)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops), + &worker, gpr_now(GPR_CLOCK_MONOTONIC), + n_seconds_time(20)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); } gpr_mu_unlock(g_mu); gpr_free(host); + grpc_http_response_destroy(&response); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { - grpc_pollset_destroy(p); +static void destroy_pops(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { + grpc_pollset_destroy(grpc_polling_entity_pollset(p)); } int main(int argc, char **argv) { @@ -183,19 +197,21 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); grpc_httpcli_context_init(&g_context); - g_pollset = gpr_malloc(grpc_pollset_size()); - grpc_pollset_init(g_pollset, &g_mu); + grpc_pollset *pollset = gpr_malloc(grpc_pollset_size()); + grpc_pollset_init(pollset, &g_mu); + g_pops = grpc_polling_entity_create_from_pollset(pollset); test_get(port); test_post(port); grpc_httpcli_context_destroy(&g_context); - grpc_closure_init(&destroyed, destroy_pollset, g_pollset); - grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed); + grpc_closure_init(&destroyed, destroy_pops, &g_pops); + grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&g_pops), + &destroyed); grpc_exec_ctx_finish(&exec_ctx); grpc_shutdown(); - gpr_free(g_pollset); + gpr_free(grpc_polling_entity_pollset(&g_pops)); gpr_subprocess_destroy(server); diff --git a/test/core/http/parser_test.c b/test/core/http/parser_test.c index 7fdf60cc2b..d645d2879c 100644 --- a/test/core/http/parser_test.c +++ b/test/core/http/parser_test.c @@ -44,38 +44,39 @@ #include "test/core/util/test_config.h" static void test_request_succeeds(grpc_slice_split_mode split_mode, - char *request, char *expect_method, + char *request_text, char *expect_method, grpc_http_version expect_version, char *expect_path, char *expect_body, ...) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(request); + gpr_slice input_slice = gpr_slice_from_copied_string(request_text); size_t num_slices; size_t i; gpr_slice *slices; va_list args; + grpc_http_request request; + memset(&request, 0, sizeof(request)); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); gpr_slice_unref(input_slice); - grpc_http_parser_init(&parser); + grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request); for (i = 0; i < num_slices; i++) { - GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i])); + GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i]) == GRPC_ERROR_NONE); gpr_slice_unref(slices[i]); } - GPR_ASSERT(grpc_http_parser_eof(&parser)); + GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE); GPR_ASSERT(GRPC_HTTP_REQUEST == parser.type); - GPR_ASSERT(0 == strcmp(expect_method, parser.http.request.method)); - GPR_ASSERT(0 == strcmp(expect_path, parser.http.request.path)); - GPR_ASSERT(expect_version == parser.http.request.version); + GPR_ASSERT(0 == strcmp(expect_method, request.method)); + GPR_ASSERT(0 == strcmp(expect_path, request.path)); + GPR_ASSERT(expect_version == request.version); if (expect_body != NULL) { - GPR_ASSERT(strlen(expect_body) == parser.http.request.body_length); - GPR_ASSERT(0 == memcmp(expect_body, parser.http.request.body, - parser.http.request.body_length)); + GPR_ASSERT(strlen(expect_body) == request.body_length); + GPR_ASSERT(0 == memcmp(expect_body, request.body, request.body_length)); } else { - GPR_ASSERT(parser.http.request.body_length == 0); + GPR_ASSERT(request.body_length == 0); } va_start(args, expect_body); @@ -85,48 +86,50 @@ static void test_request_succeeds(grpc_slice_split_mode split_mode, char *expect_value; expect_key = va_arg(args, char *); if (!expect_key) break; - GPR_ASSERT(i < parser.http.request.hdr_count); + GPR_ASSERT(i < request.hdr_count); expect_value = va_arg(args, char *); GPR_ASSERT(expect_value); - GPR_ASSERT(0 == strcmp(expect_key, parser.http.request.hdrs[i].key)); - GPR_ASSERT(0 == strcmp(expect_value, parser.http.request.hdrs[i].value)); + GPR_ASSERT(0 == strcmp(expect_key, request.hdrs[i].key)); + GPR_ASSERT(0 == strcmp(expect_value, request.hdrs[i].value)); i++; } va_end(args); - GPR_ASSERT(i == parser.http.request.hdr_count); + GPR_ASSERT(i == request.hdr_count); + grpc_http_request_destroy(&request); grpc_http_parser_destroy(&parser); gpr_free(slices); } -static void test_succeeds(grpc_slice_split_mode split_mode, char *response, +static void test_succeeds(grpc_slice_split_mode split_mode, char *response_text, int expect_status, char *expect_body, ...) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(response); + gpr_slice input_slice = gpr_slice_from_copied_string(response_text); size_t num_slices; size_t i; gpr_slice *slices; va_list args; + grpc_http_response response; + memset(&response, 0, sizeof(response)); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); gpr_slice_unref(input_slice); - grpc_http_parser_init(&parser); + grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response); for (i = 0; i < num_slices; i++) { - GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i])); + GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i]) == GRPC_ERROR_NONE); gpr_slice_unref(slices[i]); } - GPR_ASSERT(grpc_http_parser_eof(&parser)); + GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE); GPR_ASSERT(GRPC_HTTP_RESPONSE == parser.type); - GPR_ASSERT(expect_status == parser.http.response.status); + GPR_ASSERT(expect_status == response.status); if (expect_body != NULL) { - GPR_ASSERT(strlen(expect_body) == parser.http.response.body_length); - GPR_ASSERT(0 == memcmp(expect_body, parser.http.response.body, - parser.http.response.body_length)); + GPR_ASSERT(strlen(expect_body) == response.body_length); + GPR_ASSERT(0 == memcmp(expect_body, response.body, response.body_length)); } else { - GPR_ASSERT(parser.http.response.body_length == 0); + GPR_ASSERT(response.body_length == 0); } va_start(args, expect_body); @@ -136,77 +139,84 @@ static void test_succeeds(grpc_slice_split_mode split_mode, char *response, char *expect_value; expect_key = va_arg(args, char *); if (!expect_key) break; - GPR_ASSERT(i < parser.http.response.hdr_count); + GPR_ASSERT(i < response.hdr_count); expect_value = va_arg(args, char *); GPR_ASSERT(expect_value); - GPR_ASSERT(0 == strcmp(expect_key, parser.http.response.hdrs[i].key)); - GPR_ASSERT(0 == strcmp(expect_value, parser.http.response.hdrs[i].value)); + GPR_ASSERT(0 == strcmp(expect_key, response.hdrs[i].key)); + GPR_ASSERT(0 == strcmp(expect_value, response.hdrs[i].value)); i++; } va_end(args); - GPR_ASSERT(i == parser.http.response.hdr_count); + GPR_ASSERT(i == response.hdr_count); + grpc_http_response_destroy(&response); grpc_http_parser_destroy(&parser); gpr_free(slices); } -static void test_fails(grpc_slice_split_mode split_mode, char *response) { +static void test_fails(grpc_slice_split_mode split_mode, char *response_text) { grpc_http_parser parser; - gpr_slice input_slice = gpr_slice_from_copied_string(response); + gpr_slice input_slice = gpr_slice_from_copied_string(response_text); size_t num_slices; size_t i; gpr_slice *slices; - int done = 0; + grpc_error *error = GRPC_ERROR_NONE; + grpc_http_response response; + memset(&response, 0, sizeof(response)); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); gpr_slice_unref(input_slice); - grpc_http_parser_init(&parser); + grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response); for (i = 0; i < num_slices; i++) { - if (!done && !grpc_http_parser_parse(&parser, slices[i])) { - done = 1; + if (GRPC_ERROR_NONE == error) { + error = grpc_http_parser_parse(&parser, slices[i]); } gpr_slice_unref(slices[i]); } - if (!done && !grpc_http_parser_eof(&parser)) { - done = 1; + if (GRPC_ERROR_NONE == error) { + error = grpc_http_parser_eof(&parser); } - GPR_ASSERT(done); + GPR_ASSERT(error != GRPC_ERROR_NONE); + GRPC_ERROR_UNREF(error); + grpc_http_response_destroy(&response); grpc_http_parser_destroy(&parser); gpr_free(slices); } -static const uint8_t failed_test1[] = { - 0x9e, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x4a, - 0x48, 0x54, 0x54, 0x30, 0x32, 0x16, 0xa, 0x2f, 0x48, 0x20, - 0x31, 0x2e, 0x31, 0x20, 0x32, 0x30, 0x31, 0x54, 0x54, 0xb9, - 0x32, 0x31, 0x2e, 0x20, 0x32, 0x30, 0x20, -}; - -typedef struct { - const char *name; - const uint8_t *data; - size_t length; -} failed_test; - -#define FAILED_TEST(name) \ - { #name, name, sizeof(name) } - -failed_test failed_tests[] = { - FAILED_TEST(failed_test1), -}; - -static void test_doesnt_crash(failed_test t) { - gpr_log(GPR_DEBUG, "Run previously failed test: %s", t.name); - grpc_http_parser p; - grpc_http_parser_init(&p); - gpr_slice slice = - gpr_slice_from_copied_buffer((const char *)t.data, t.length); - grpc_http_parser_parse(&p, slice); - gpr_slice_unref(slice); - grpc_http_parser_destroy(&p); +static void test_request_fails(grpc_slice_split_mode split_mode, + char *request_text) { + grpc_http_parser parser; + gpr_slice input_slice = gpr_slice_from_copied_string(request_text); + size_t num_slices; + size_t i; + gpr_slice *slices; + grpc_error *error = GRPC_ERROR_NONE; + grpc_http_request request; + memset(&request, 0, sizeof(request)); + + grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); + gpr_slice_unref(input_slice); + + grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request); + + for (i = 0; i < num_slices; i++) { + if (error == GRPC_ERROR_NONE) { + error = grpc_http_parser_parse(&parser, slices[i]); + } + gpr_slice_unref(slices[i]); + } + if (error == GRPC_ERROR_NONE) { + error = grpc_http_parser_eof(&parser); + } + GPR_ASSERT(error != GRPC_ERROR_NONE); + GRPC_ERROR_UNREF(error); + + grpc_http_request_destroy(&request); + grpc_http_parser_destroy(&parser); + gpr_free(slices); } int main(int argc, char **argv) { @@ -217,10 +227,6 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); - for (i = 0; i < GPR_ARRAY_SIZE(failed_tests); i++) { - test_doesnt_crash(failed_tests[i]); - } - for (i = 0; i < GPR_ARRAY_SIZE(split_modes); i++) { test_succeeds(split_modes[i], "HTTP/1.0 200 OK\r\n" @@ -286,12 +292,12 @@ int main(int argc, char **argv) { " def\r\n" "\r\n" "hello world!"); - test_fails(split_modes[i], "GET\r\n"); - test_fails(split_modes[i], "GET /\r\n"); - test_fails(split_modes[i], "GET / HTTP/0.0\r\n"); - test_fails(split_modes[i], "GET / ____/1.0\r\n"); - test_fails(split_modes[i], "GET / HTTP/1.2\r\n"); - test_fails(split_modes[i], "GET / HTTP/1.0\n"); + test_request_fails(split_modes[i], "GET\r\n"); + test_request_fails(split_modes[i], "GET /\r\n"); + test_request_fails(split_modes[i], "GET / HTTP/0.0\r\n"); + test_request_fails(split_modes[i], "GET / ____/1.0\r\n"); + test_request_fails(split_modes[i], "GET / HTTP/1.2\r\n"); + test_request_fails(split_modes[i], "GET / HTTP/1.0\n"); tmp1 = gpr_malloc(2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH); memset(tmp1, 'a', 2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1); diff --git a/test/core/http/corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 b/test/core/http/request_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 index 3d6face56a..3d6face56a 100644 --- a/test/core/http/corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 +++ b/test/core/http/request_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 diff --git a/test/core/http/corpus/05e613853d64a9669ea3cf41b0de777dc24931ba b/test/core/http/request_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba index 5cbaf2e460..5cbaf2e460 100644 --- a/test/core/http/corpus/05e613853d64a9669ea3cf41b0de777dc24931ba +++ b/test/core/http/request_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba diff --git a/test/core/http/corpus/069352518a1d1baa05f317c677d275cefda2ac97 b/test/core/http/request_corpus/069352518a1d1baa05f317c677d275cefda2ac97 index 8831f0786b..8831f0786b 100644 --- a/test/core/http/corpus/069352518a1d1baa05f317c677d275cefda2ac97 +++ b/test/core/http/request_corpus/069352518a1d1baa05f317c677d275cefda2ac97 diff --git a/test/core/http/corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 b/test/core/http/request_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 index 10967d975c..10967d975c 100644 --- a/test/core/http/corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 +++ b/test/core/http/request_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 diff --git a/test/core/http/corpus/0c5b7c2569410b526605e308309a7f36574e530d b/test/core/http/request_corpus/0c5b7c2569410b526605e308309a7f36574e530d index c79e456904..c79e456904 100644 --- a/test/core/http/corpus/0c5b7c2569410b526605e308309a7f36574e530d +++ b/test/core/http/request_corpus/0c5b7c2569410b526605e308309a7f36574e530d diff --git a/test/core/http/corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf b/test/core/http/request_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf index 7b979b5e10..7b979b5e10 100644 --- a/test/core/http/corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf +++ b/test/core/http/request_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf diff --git a/test/core/http/corpus/1e1273f90187fdf5df3625764245610f86af6aa4 b/test/core/http/request_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 index 67382b4f3a..67382b4f3a 100644 --- a/test/core/http/corpus/1e1273f90187fdf5df3625764245610f86af6aa4 +++ b/test/core/http/request_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 diff --git a/test/core/http/corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 b/test/core/http/request_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 index deb8265a30..deb8265a30 100644 --- a/test/core/http/corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 +++ b/test/core/http/request_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 diff --git a/test/core/http/corpus/24756c396bc72894fd720092bb6f9c03e66b469f b/test/core/http/request_corpus/24756c396bc72894fd720092bb6f9c03e66b469f index 9f2e0e4a25..9f2e0e4a25 100644 --- a/test/core/http/corpus/24756c396bc72894fd720092bb6f9c03e66b469f +++ b/test/core/http/request_corpus/24756c396bc72894fd720092bb6f9c03e66b469f diff --git a/test/core/http/corpus/276def41311933421ae7a9ee42e906c85b6a4d3f b/test/core/http/request_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f index 4db04b260a..4db04b260a 100644 --- a/test/core/http/corpus/276def41311933421ae7a9ee42e906c85b6a4d3f +++ b/test/core/http/request_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f diff --git a/test/core/http/corpus/29daa75432381937fd005cb25e314e328de6e9f9 b/test/core/http/request_corpus/29daa75432381937fd005cb25e314e328de6e9f9 index cee70bfe71..cee70bfe71 100644 --- a/test/core/http/corpus/29daa75432381937fd005cb25e314e328de6e9f9 +++ b/test/core/http/request_corpus/29daa75432381937fd005cb25e314e328de6e9f9 diff --git a/test/core/http/corpus/2a75204bc492084ad853682f8de3fb137d5907bc b/test/core/http/request_corpus/2a75204bc492084ad853682f8de3fb137d5907bc index e76b00e34c..e76b00e34c 100644 --- a/test/core/http/corpus/2a75204bc492084ad853682f8de3fb137d5907bc +++ b/test/core/http/request_corpus/2a75204bc492084ad853682f8de3fb137d5907bc diff --git a/test/core/http/corpus/2d34ba249b755a880525cf53c665633a5e359305 b/test/core/http/request_corpus/2d34ba249b755a880525cf53c665633a5e359305 index 7435f52ea5..7435f52ea5 100644 --- a/test/core/http/corpus/2d34ba249b755a880525cf53c665633a5e359305 +++ b/test/core/http/request_corpus/2d34ba249b755a880525cf53c665633a5e359305 diff --git a/test/core/http/corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 b/test/core/http/request_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 index cce8ded71a..cce8ded71a 100644 --- a/test/core/http/corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 +++ b/test/core/http/request_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 diff --git a/test/core/http/corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b b/test/core/http/request_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b index 57efa3cabc..57efa3cabc 100644 --- a/test/core/http/corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b +++ b/test/core/http/request_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b diff --git a/test/core/http/corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece b/test/core/http/request_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece index 8df43e4dce..8df43e4dce 100644 --- a/test/core/http/corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece +++ b/test/core/http/request_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece diff --git a/test/core/http/corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf b/test/core/http/request_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf index 4efa386f3b..4efa386f3b 100644 --- a/test/core/http/corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf +++ b/test/core/http/request_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf diff --git a/test/core/http/corpus/3953688866ccb3b4f371f1a858570d6afdb6452d b/test/core/http/request_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d index f85f1df035..f85f1df035 100644 --- a/test/core/http/corpus/3953688866ccb3b4f371f1a858570d6afdb6452d +++ b/test/core/http/request_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d diff --git a/test/core/http/corpus/39b19c41ba537f37511eff7727733715db432e76 b/test/core/http/request_corpus/39b19c41ba537f37511eff7727733715db432e76 index fefa4512a8..fefa4512a8 100644 --- a/test/core/http/corpus/39b19c41ba537f37511eff7727733715db432e76 +++ b/test/core/http/request_corpus/39b19c41ba537f37511eff7727733715db432e76 diff --git a/test/core/http/corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac b/test/core/http/request_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac index b967b57614..b967b57614 100644 --- a/test/core/http/corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac +++ b/test/core/http/request_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac diff --git a/test/core/http/corpus/3f03265921120c6ffa61b944e213e062a5538d4b b/test/core/http/request_corpus/3f03265921120c6ffa61b944e213e062a5538d4b index 8af90071c3..8af90071c3 100644 --- a/test/core/http/corpus/3f03265921120c6ffa61b944e213e062a5538d4b +++ b/test/core/http/request_corpus/3f03265921120c6ffa61b944e213e062a5538d4b diff --git a/test/core/http/corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 b/test/core/http/request_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 index 7d20266703..7d20266703 100644 --- a/test/core/http/corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 +++ b/test/core/http/request_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 diff --git a/test/core/http/corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 b/test/core/http/request_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 index 5996b9a75c..5996b9a75c 100644 --- a/test/core/http/corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 +++ b/test/core/http/request_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 diff --git a/test/core/http/corpus/487725eb38511c79a9340bf4560a1411061fa6fa b/test/core/http/request_corpus/487725eb38511c79a9340bf4560a1411061fa6fa index c59c4d2246..c59c4d2246 100644 --- a/test/core/http/corpus/487725eb38511c79a9340bf4560a1411061fa6fa +++ b/test/core/http/request_corpus/487725eb38511c79a9340bf4560a1411061fa6fa diff --git a/test/core/http/corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 b/test/core/http/request_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 index 8ac7ceb2d5..8ac7ceb2d5 100644 --- a/test/core/http/corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 +++ b/test/core/http/request_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 diff --git a/test/core/http/corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 b/test/core/http/request_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 index 49d1c8f1d2..49d1c8f1d2 100644 --- a/test/core/http/corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 +++ b/test/core/http/request_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 diff --git a/test/core/http/corpus/5028c56a5116a186b7343ff59567b47347a0796d b/test/core/http/request_corpus/5028c56a5116a186b7343ff59567b47347a0796d index 5f2c4dfef0..5f2c4dfef0 100644 --- a/test/core/http/corpus/5028c56a5116a186b7343ff59567b47347a0796d +++ b/test/core/http/request_corpus/5028c56a5116a186b7343ff59567b47347a0796d diff --git a/test/core/http/corpus/533f62b3f495ce704babf3ee8d840f196a714dff b/test/core/http/request_corpus/533f62b3f495ce704babf3ee8d840f196a714dff index 6313cd967a..6313cd967a 100644 --- a/test/core/http/corpus/533f62b3f495ce704babf3ee8d840f196a714dff +++ b/test/core/http/request_corpus/533f62b3f495ce704babf3ee8d840f196a714dff diff --git a/test/core/http/corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 b/test/core/http/request_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 index fee5512152..fee5512152 100644 --- a/test/core/http/corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 +++ b/test/core/http/request_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 diff --git a/test/core/http/corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee b/test/core/http/request_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee index bd7e239537..bd7e239537 100644 --- a/test/core/http/corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee +++ b/test/core/http/request_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee diff --git a/test/core/http/corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 b/test/core/http/request_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 index 9a15ab025f..9a15ab025f 100644 --- a/test/core/http/corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 +++ b/test/core/http/request_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 diff --git a/test/core/http/corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 b/test/core/http/request_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 index 480708e033..480708e033 100644 --- a/test/core/http/corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 +++ b/test/core/http/request_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 diff --git a/test/core/http/corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e b/test/core/http/request_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e index 0ed0dfadec..0ed0dfadec 100644 --- a/test/core/http/corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e +++ b/test/core/http/request_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e diff --git a/test/core/http/corpus/657368df512ca6294b9df16adf935a3f374a8be2 b/test/core/http/request_corpus/657368df512ca6294b9df16adf935a3f374a8be2 index 1f14f69103..1f14f69103 100644 --- a/test/core/http/corpus/657368df512ca6294b9df16adf935a3f374a8be2 +++ b/test/core/http/request_corpus/657368df512ca6294b9df16adf935a3f374a8be2 diff --git a/test/core/http/corpus/7fc4520094902ce2c760d70eaad5b674d2817337 b/test/core/http/request_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 index 8fc481d92b..8fc481d92b 100644 --- a/test/core/http/corpus/7fc4520094902ce2c760d70eaad5b674d2817337 +++ b/test/core/http/request_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 diff --git a/test/core/http/corpus/81f59a12b458ec3604035cb962165c604d1355e6 b/test/core/http/request_corpus/81f59a12b458ec3604035cb962165c604d1355e6 index d4223ccf81..d4223ccf81 100644 --- a/test/core/http/corpus/81f59a12b458ec3604035cb962165c604d1355e6 +++ b/test/core/http/request_corpus/81f59a12b458ec3604035cb962165c604d1355e6 diff --git a/test/core/http/corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 b/test/core/http/request_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 index 99e2c48bbd..99e2c48bbd 100644 --- a/test/core/http/corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 +++ b/test/core/http/request_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 diff --git a/test/core/http/corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c b/test/core/http/request_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c index 776253d750..776253d750 100644 --- a/test/core/http/corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c +++ b/test/core/http/request_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c diff --git a/test/core/http/corpus/97e4499d450c95660de86747f527e670f2012548 b/test/core/http/request_corpus/97e4499d450c95660de86747f527e670f2012548 index b1927fbf63..b1927fbf63 100644 --- a/test/core/http/corpus/97e4499d450c95660de86747f527e670f2012548 +++ b/test/core/http/request_corpus/97e4499d450c95660de86747f527e670f2012548 diff --git a/test/core/http/corpus/9a996857196e0998a1278994a9bab3d35526e7f1 b/test/core/http/request_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 index 0eb2c0da3a..0eb2c0da3a 100644 --- a/test/core/http/corpus/9a996857196e0998a1278994a9bab3d35526e7f1 +++ b/test/core/http/request_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 diff --git a/test/core/http/corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 b/test/core/http/request_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 index f93b9a08e3..f93b9a08e3 100644 --- a/test/core/http/corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 +++ b/test/core/http/request_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 diff --git a/test/core/http/corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 b/test/core/http/request_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 index 4ea07dc137..4ea07dc137 100644 --- a/test/core/http/corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 +++ b/test/core/http/request_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 diff --git a/test/core/http/corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 b/test/core/http/request_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 index 2e95bac35c..2e95bac35c 100644 --- a/test/core/http/corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 +++ b/test/core/http/request_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 diff --git a/test/core/http/corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 b/test/core/http/request_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 index 837449dda3..837449dda3 100644 --- a/test/core/http/corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 +++ b/test/core/http/request_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 diff --git a/test/core/http/corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 b/test/core/http/request_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 index 6075d0a5d7..6075d0a5d7 100644 --- a/test/core/http/corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 +++ b/test/core/http/request_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 diff --git a/test/core/http/corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 b/test/core/http/request_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 index 10905bed39..10905bed39 100644 --- a/test/core/http/corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 +++ b/test/core/http/request_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 diff --git a/test/core/http/corpus/c4acff8aa2ff886f35439f72625d05002990c940 b/test/core/http/request_corpus/c4acff8aa2ff886f35439f72625d05002990c940 index 4539d9f012..4539d9f012 100644 --- a/test/core/http/corpus/c4acff8aa2ff886f35439f72625d05002990c940 +++ b/test/core/http/request_corpus/c4acff8aa2ff886f35439f72625d05002990c940 diff --git a/test/core/http/corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 b/test/core/http/request_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 index 2704e4fb39..2704e4fb39 100644 --- a/test/core/http/corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 +++ b/test/core/http/request_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 diff --git a/test/core/http/corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 b/test/core/http/request_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 index f5cbbc69e7..f5cbbc69e7 100644 --- a/test/core/http/corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 +++ b/test/core/http/request_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 diff --git a/test/core/http/corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 b/test/core/http/request_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 index f6ea09c41b..f6ea09c41b 100644 --- a/test/core/http/corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 +++ b/test/core/http/request_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 diff --git a/test/core/http/corpus/d39c8ee11a697634a09b309460c0bbd967e7effa b/test/core/http/request_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa index e241a0c01c..e241a0c01c 100644 --- a/test/core/http/corpus/d39c8ee11a697634a09b309460c0bbd967e7effa +++ b/test/core/http/request_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa diff --git a/test/core/http/corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 b/test/core/http/request_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 index be33d81102..be33d81102 100644 --- a/test/core/http/corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 +++ b/test/core/http/request_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 diff --git a/test/core/http/corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 b/test/core/http/request_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 index e81a59f30b..e81a59f30b 100644 --- a/test/core/http/corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 +++ b/test/core/http/request_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 diff --git a/test/core/http/corpus/d936dad71c129cf659097dc3db64550c4dd467f4 b/test/core/http/request_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 index ccf918751d..ccf918751d 100644 --- a/test/core/http/corpus/d936dad71c129cf659097dc3db64550c4dd467f4 +++ b/test/core/http/request_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 diff --git a/test/core/http/corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b b/test/core/http/request_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b index b6fc095920..b6fc095920 100644 --- a/test/core/http/corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b +++ b/test/core/http/request_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b diff --git a/test/core/http/corpus/e5c364b205855a2991ce07482aebb2a3a6147089 b/test/core/http/request_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 index 98b5f62b2a..98b5f62b2a 100644 --- a/test/core/http/corpus/e5c364b205855a2991ce07482aebb2a3a6147089 +++ b/test/core/http/request_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 diff --git a/test/core/http/corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb b/test/core/http/request_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb index 78b36c913b..78b36c913b 100644 --- a/test/core/http/corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb +++ b/test/core/http/request_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb diff --git a/test/core/http/corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 b/test/core/http/request_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 index 06f1a3b800..06f1a3b800 100644 --- a/test/core/http/corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 +++ b/test/core/http/request_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 diff --git a/test/core/http/corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b b/test/core/http/request_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b index eb63d31fa5..eb63d31fa5 100644 --- a/test/core/http/corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b +++ b/test/core/http/request_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b diff --git a/test/core/http/corpus/request1.txt b/test/core/http/request_corpus/request1.txt index 16a750fbf9..16a750fbf9 100644 --- a/test/core/http/corpus/request1.txt +++ b/test/core/http/request_corpus/request1.txt diff --git a/test/core/http/corpus/request2.txt b/test/core/http/request_corpus/request2.txt index 897a28406c..897a28406c 100644 --- a/test/core/http/corpus/request2.txt +++ b/test/core/http/request_corpus/request2.txt diff --git a/test/core/http/corpus/request3.txt b/test/core/http/request_corpus/request3.txt index aaa75bbb52..aaa75bbb52 100644 --- a/test/core/http/corpus/request3.txt +++ b/test/core/http/request_corpus/request3.txt diff --git a/test/core/http/corpus/request4.txt b/test/core/http/request_corpus/request4.txt index 593f6fa7b6..593f6fa7b6 100644 --- a/test/core/http/corpus/request4.txt +++ b/test/core/http/request_corpus/request4.txt diff --git a/test/core/http/corpus/request5.txt b/test/core/http/request_corpus/request5.txt index 19fb244355..19fb244355 100644 --- a/test/core/http/corpus/request5.txt +++ b/test/core/http/request_corpus/request5.txt diff --git a/test/core/http/corpus/response1.txt b/test/core/http/request_corpus/response1.txt index a17139982e..a17139982e 100644 --- a/test/core/http/corpus/response1.txt +++ b/test/core/http/request_corpus/response1.txt diff --git a/test/core/http/corpus/response2.txt b/test/core/http/request_corpus/response2.txt index 1b86449bb6..1b86449bb6 100644 --- a/test/core/http/corpus/response2.txt +++ b/test/core/http/request_corpus/response2.txt diff --git a/test/core/http/corpus/response3.txt b/test/core/http/request_corpus/response3.txt index 9e5b046c59..9e5b046c59 100644 --- a/test/core/http/corpus/response3.txt +++ b/test/core/http/request_corpus/response3.txt diff --git a/test/core/http/corpus/response4.txt b/test/core/http/request_corpus/response4.txt index b237b01fe0..b237b01fe0 100644 --- a/test/core/http/corpus/response4.txt +++ b/test/core/http/request_corpus/response4.txt diff --git a/test/core/http/corpus/response5.txt b/test/core/http/request_corpus/response5.txt index 2630595713..2630595713 100644 --- a/test/core/http/corpus/response5.txt +++ b/test/core/http/request_corpus/response5.txt diff --git a/test/core/http/corpus/response6.txt b/test/core/http/request_corpus/response6.txt index 797b6ee773..797b6ee773 100644 --- a/test/core/http/corpus/response6.txt +++ b/test/core/http/request_corpus/response6.txt diff --git a/test/core/http/corpus/toolong.txt b/test/core/http/request_corpus/toolong.txt index 9a9d5e2fc3..9a9d5e2fc3 100644 --- a/test/core/http/corpus/toolong.txt +++ b/test/core/http/request_corpus/toolong.txt diff --git a/test/core/http/request_fuzzer.c b/test/core/http/request_fuzzer.c new file mode 100644 index 0000000000..5941401867 --- /dev/null +++ b/test/core/http/request_fuzzer.c @@ -0,0 +1,57 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include <stdbool.h> +#include <stdint.h> +#include <string.h> + +#include <grpc/support/alloc.h> + +#include "src/core/lib/http/parser.h" + +bool squelch = true; +bool leak_check = true; + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + grpc_http_parser parser; + grpc_http_request request; + memset(&request, 0, sizeof(request)); + grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request); + gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size); + GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice)); + GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser)); + gpr_slice_unref(slice); + grpc_http_parser_destroy(&parser); + grpc_http_request_destroy(&request); + return 0; +} diff --git a/test/core/http/response_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 b/test/core/http/response_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 new file mode 100644 index 0000000000..3d6face56a --- /dev/null +++ b/test/core/http/response_corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 @@ -0,0 +1,2 @@ +HTTP/1.1 …200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba b/test/core/http/response_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba new file mode 100644 index 0000000000..5cbaf2e460 --- /dev/null +++ b/test/core/http/response_corpus/05e613853d64a9669ea3cf41b0de777dc24931ba @@ -0,0 +1,2 @@ +HTTP/1.1 8) pMKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/069352518a1d1baa05f317c677d275cefda2ac97 b/test/core/http/response_corpus/069352518a1d1baa05f317c677d275cefda2ac97 new file mode 100644 index 0000000000..8831f0786b --- /dev/null +++ b/test/core/http/response_corpus/069352518a1d1baa05f317c677d275cefda2ac97 @@ -0,0 +1,2 @@ +HTTP/1.1 80) OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 b/test/core/http/response_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 new file mode 100644 index 0000000000..10967d975c --- /dev/null +++ b/test/core/http/response_corpus/0925527c9358b1e10ec0f0387cd99f35204d9a34 @@ -0,0 +1,2 @@ +„HTT/21. 200 HT!TP/1OKH.1HTTP 200 OKH
+tHT//1T0P.1y 2001.
\ No newline at end of file diff --git a/test/core/http/response_corpus/0c5b7c2569410b526605e308309a7f36574e530d b/test/core/http/response_corpus/0c5b7c2569410b526605e308309a7f36574e530d new file mode 100644 index 0000000000..c79e456904 --- /dev/null +++ b/test/core/http/response_corpus/0c5b7c2569410b526605e308309a7f36574e530d @@ -0,0 +1,4 @@ +H
TTP/16.1 200 OK +test: h!ello + +abcd diff --git a/test/core/http/response_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf b/test/core/http/response_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf new file mode 100644 index 0000000000..7b979b5e10 --- /dev/null +++ b/test/core/http/response_corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH
+tHTTP/01.021 Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 b/test/core/http/response_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 new file mode 100644 index 0000000000..67382b4f3a --- /dev/null +++ b/test/core/http/response_corpus/1e1273f90187fdf5df3625764245610f86af6aa4 @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKHHTTP‰/1.200 OKH
+
+tHTHTTP/0 20T:tes/01.
\ No newline at end of file diff --git a/test/core/http/response_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 b/test/core/http/response_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 new file mode 100644 index 0000000000..deb8265a30 --- /dev/null +++ b/test/core/http/response_corpus/1fbc57d118f3733287e9a9d808bb8947b3260e55 @@ -0,0 +1,3 @@ +JHTT/21. 2è0 HTTP/1.1 200 OKHHTTP‰/1.200 OKH
+
+tHTHTHTJHTTPT
\ No newline at end of file diff --git a/test/core/http/response_corpus/24756c396bc72894fd720092bb6f9c03e66b469f b/test/core/http/response_corpus/24756c396bc72894fd720092bb6f9c03e66b469f new file mode 100644 index 0000000000..9f2e0e4a25 --- /dev/null +++ b/test/core/http/response_corpus/24756c396bc72894fd720092bb6f9c03e66b469f @@ -0,0 +1,2 @@ +JHTT/21. 200œHTT/0OKH.1 HTTP/200 OKH
+tH1.T
\ No newline at end of file diff --git a/test/core/http/response_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f b/test/core/http/response_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f new file mode 100644 index 0000000000..4db04b260a --- /dev/null +++ b/test/core/http/response_corpus/276def41311933421ae7a9ee42e906c85b6a4d3f @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/11 2*0 OKH
+ HTDP/01.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/29daa75432381937fd005cb25e314e328de6e9f9 b/test/core/http/response_corpus/29daa75432381937fd005cb25e314e328de6e9f9 new file mode 100644 index 0000000000..cee70bfe71 --- /dev/null +++ b/test/core/http/response_corpus/29daa75432381937fd005cb25e314e328de6e9f9 @@ -0,0 +1,2 @@ +JHTT¹21. 200HTT/0OKH1 HTTP/100 OKH
+tH1.T
\ No newline at end of file diff --git a/test/core/http/response_corpus/2a75204bc492084ad853682f8de3fb137d5907bc b/test/core/http/response_corpus/2a75204bc492084ad853682f8de3fb137d5907bc new file mode 100644 index 0000000000..e76b00e34c --- /dev/null +++ b/test/core/http/response_corpus/2a75204bc492084ad853682f8de3fb137d5907bc @@ -0,0 +1,2 @@ +GET / HTTHTTP/1.1 200 OKH
+t10H
\ No newline at end of file diff --git a/test/core/http/response_corpus/2d34ba249b755a880525cf53c665633a5e359305 b/test/core/http/response_corpus/2d34ba249b755a880525cf53c665633a5e359305 new file mode 100644 index 0000000000..7435f52ea5 --- /dev/null +++ b/test/core/http/response_corpus/2d34ba249b755a880525cf53c665633a5e359305 @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/22 2*0 OKH
+ HTDP/01.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 b/test/core/http/response_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 new file mode 100644 index 0000000000..cce8ded71a --- /dev/null +++ b/test/core/http/response_corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 @@ -0,0 +1,2 @@ +HTTP/1*9y 200 OKm
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b b/test/core/http/response_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b new file mode 100644 index 0000000000..57efa3cabc --- /dev/null +++ b/test/core/http/response_corpus/35554617ea6418bd43161fe9a2c337ed82d7ec5b @@ -0,0 +1,4 @@ +JHTT/21. 200 HTTP/0OKH.1 200 OKH
+tHTTP/01.021 Oes,H
+t
+t
\ No newline at end of file diff --git a/test/core/http/response_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece b/test/core/http/response_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece new file mode 100644 index 0000000000..8df43e4dce --- /dev/null +++ b/test/core/http/response_corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece @@ -0,0 +1,2 @@ +HTTP/1.9y 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf b/test/core/http/response_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf new file mode 100644 index 0000000000..4efa386f3b --- /dev/null +++ b/test/core/http/response_corpus/3787bcc22ef645e665cc5f722b8a633af86de9cf @@ -0,0 +1,9 @@ +HTTP/1.1 200 OKH
TTP/16.1 200 OK +tesH
+tHTTP/00.021 :Oe¶,H
+test: h!eHTTP/1.1 200 OKH
+llo + +abcdtH +TTP/01.021 : Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d b/test/core/http/response_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d new file mode 100644 index 0000000000..f85f1df035 --- /dev/null +++ b/test/core/http/response_corpus/3953688866ccb3b4f371f1a858570d6afdb6452d @@ -0,0 +1,3 @@ +žHTTP/1.1 200 HH +OK
TDP/01.021 : Oe:,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/39b19c41ba537f37511eff7727733715db432e76 b/test/core/http/response_corpus/39b19c41ba537f37511eff7727733715db432e76 new file mode 100644 index 0000000000..fefa4512a8 --- /dev/null +++ b/test/core/http/response_corpus/39b19c41ba537f37511eff7727733715db432e76 @@ -0,0 +1,2 @@ +HTTP/1.1 000 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac b/test/core/http/response_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac new file mode 100644 index 0000000000..b967b57614 --- /dev/null +++ b/test/core/http/response_corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH
+tHTTP/01.021 : Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/3f03265921120c6ffa61b944e213e062a5538d4b b/test/core/http/response_corpus/3f03265921120c6ffa61b944e213e062a5538d4b new file mode 100644 index 0000000000..8af90071c3 --- /dev/null +++ b/test/core/http/response_corpus/3f03265921120c6ffa61b944e213e062a5538d4b @@ -0,0 +1,2 @@ +@TTP/1.1y 002ÿOKH
+ves
\ No newline at end of file diff --git a/test/core/http/response_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 b/test/core/http/response_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 new file mode 100644 index 0000000000..7d20266703 --- /dev/null +++ b/test/core/http/response_corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 @@ -0,0 +1,2 @@ +HTTP/1.1y 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 b/test/core/http/response_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 new file mode 100644 index 0000000000..5996b9a75c --- /dev/null +++ b/test/core/http/response_corpus/466059ed07a0d55d6ad5e522c7d367cbf278eaf9 @@ -0,0 +1,4 @@ +JHTTP/1.1 +00 HTTP/1.1 200 OKHHTTPOKH
‰/1. +200 OKtH
+
+tHTH
\ No newline at end of file diff --git a/test/core/http/response_corpus/487725eb38511c79a9340bf4560a1411061fa6fa b/test/core/http/response_corpus/487725eb38511c79a9340bf4560a1411061fa6fa new file mode 100644 index 0000000000..c59c4d2246 --- /dev/null +++ b/test/core/http/response_corpus/487725eb38511c79a9340bf4560a1411061fa6fa @@ -0,0 +1,2 @@ +HTTP/01.021 O,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 b/test/core/http/response_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 new file mode 100644 index 0000000000..8ac7ceb2d5 --- /dev/null +++ b/test/core/http/response_corpus/48b9b205cae8ac21512a3f26f49fd53e21ee13c5 @@ -0,0 +1,2 @@ +ITTP/11 …20O HK
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 b/test/core/http/response_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 new file mode 100644 index 0000000000..49d1c8f1d2 --- /dev/null +++ b/test/core/http/response_corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 @@ -0,0 +1,2 @@ +HTTP/1.1 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/5028c56a5116a186b7343ff59567b47347a0796d b/test/core/http/response_corpus/5028c56a5116a186b7343ff59567b47347a0796d new file mode 100644 index 0000000000..5f2c4dfef0 --- /dev/null +++ b/test/core/http/response_corpus/5028c56a5116a186b7343ff59567b47347a0796d @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH
+ HTDP/01.021 : Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/533f62b3f495ce704babf3ee8d840f196a714dff b/test/core/http/response_corpus/533f62b3f495ce704babf3ee8d840f196a714dff new file mode 100644 index 0000000000..6313cd967a --- /dev/null +++ b/test/core/http/response_corpus/533f62b3f495ce704babf3ee8d840f196a714dff @@ -0,0 +1,4 @@ +JHTT/21. 200 HTTP/1OKH.1 200 OKH
+tHTTP/01.021 Oes,H
+t
+t
\ No newline at end of file diff --git a/test/core/http/response_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 b/test/core/http/response_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 new file mode 100644 index 0000000000..fee5512152 --- /dev/null +++ b/test/core/http/response_corpus/5892cbb284771fc9761caae37b19cd6e27dbc104 @@ -0,0 +1,2 @@ +JÏHTTP‰/1.200:OKHHTã/21. 2è0 HTTP/
+1.1 200 OKHHTtTP‰
\ No newline at end of file diff --git a/test/core/http/response_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee b/test/core/http/response_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee new file mode 100644 index 0000000000..bd7e239537 --- /dev/null +++ b/test/core/http/response_corpus/5aeab6e4f7c2a1c09d4ac0dbdb3beac4893607ee @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/11 2*0 OKH
+ HTDP/01.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 b/test/core/http/response_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 new file mode 100644 index 0000000000..9a15ab025f --- /dev/null +++ b/test/core/http/response_corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 @@ -0,0 +1,2 @@ +HTTP/1. 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 b/test/core/http/response_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 new file mode 100644 index 0000000000..480708e033 --- /dev/null +++ b/test/core/http/response_corpus/5c1659b77678b41faa4fa13df7772dae3238d1c0 @@ -0,0 +1,2 @@ +@TTP/1.1y 00'JHTTP/1.1 +00ÿOïH HTTP/
+ve1.1 200s
\ No newline at end of file diff --git a/test/core/http/response_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e b/test/core/http/response_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e new file mode 100644 index 0000000000..0ed0dfadec --- /dev/null +++ b/test/core/http/response_corpus/5c81f61621e29ec9c6a64ac3af9b3b216141618e @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/1.1 200 OKH
+ HTDP/01.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/657368df512ca6294b9df16adf935a3f374a8be2 b/test/core/http/response_corpus/657368df512ca6294b9df16adf935a3f374a8be2 new file mode 100644 index 0000000000..1f14f69103 --- /dev/null +++ b/test/core/http/response_corpus/657368df512ca6294b9df16adf935a3f374a8be2 @@ -0,0 +1,3 @@ +HTT +/1.1 201 OKH
+des
\ No newline at end of file diff --git a/test/core/http/response_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 b/test/core/http/response_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 new file mode 100644 index 0000000000..8fc481d92b --- /dev/null +++ b/test/core/http/response_corpus/7fc4520094902ce2c760d70eaad5b674d2817337 @@ -0,0 +1,5 @@ +JHTTP/1.GET / HTTP/1.0 +1 200 OKH
+ + +t
\ No newline at end of file diff --git a/test/core/http/response_corpus/81f59a12b458ec3604035cb962165c604d1355e6 b/test/core/http/response_corpus/81f59a12b458ec3604035cb962165c604d1355e6 new file mode 100644 index 0000000000..d4223ccf81 --- /dev/null +++ b/test/core/http/response_corpus/81f59a12b458ec3604035cb962165c604d1355e6 @@ -0,0 +1,2 @@ +HTTP/1.1 8p) )MKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 b/test/core/http/response_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 new file mode 100644 index 0000000000..99e2c48bbd --- /dev/null +++ b/test/core/http/response_corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 @@ -0,0 +1,4 @@ +HTTP/1.1 200 OKH
+tHTHTTP/1. 20TP/01.020(: Oes,H0 OKH
+
+tteses
\ No newline at end of file diff --git a/test/core/http/response_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c b/test/core/http/response_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c new file mode 100644 index 0000000000..776253d750 --- /dev/null +++ b/test/core/http/response_corpus/97c16de7fe3c390a2e6c09ff5c28f17d5c67542c @@ -0,0 +1,2 @@ +ITTp/11 …20O HTTP/*1.1 200 OKH
+ HTDP/02.021 : OesHK
,H
diff --git a/test/core/http/response_corpus/97e4499d450c95660de86747f527e670f2012548 b/test/core/http/response_corpus/97e4499d450c95660de86747f527e670f2012548 new file mode 100644 index 0000000000..b1927fbf63 --- /dev/null +++ b/test/core/http/response_corpus/97e4499d450c95660de86747f527e670f2012548 @@ -0,0 +1,3 @@ +HTHHTT`TT +/1.1 201 P*/OKH
+des1.1 2T
\ No newline at end of file diff --git a/test/core/http/response_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 b/test/core/http/response_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 new file mode 100644 index 0000000000..0eb2c0da3a --- /dev/null +++ b/test/core/http/response_corpus/9a996857196e0998a1278994a9bab3d35526e7f1 @@ -0,0 +1,2 @@ +@TTP/1.1y 002ÿOKH
+ves
\ No newline at end of file diff --git a/test/core/http/response_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 b/test/core/http/response_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 new file mode 100644 index 0000000000..f93b9a08e3 --- /dev/null +++ b/test/core/http/response_corpus/9b7e00049ec356ecd84b1747e4e1941140139ae8 @@ -0,0 +1,3 @@ +„HTT/21. 200 HTTP/1.1 HT!TP/1OKH.1HTTP 200 OKH
+tHT/:/80 OKH
+1
\ No newline at end of file diff --git a/test/core/http/response_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 b/test/core/http/response_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 new file mode 100644 index 0000000000..4ea07dc137 --- /dev/null +++ b/test/core/http/response_corpus/9f0c38ec455cc363369b3674a2d32bc21c206de1 @@ -0,0 +1,5 @@ +JHTTP/1>GET / HTTP/2.0 +1 200 OKH
+ + +t
\ No newline at end of file diff --git a/test/core/http/response_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 b/test/core/http/response_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 new file mode 100644 index 0000000000..2e95bac35c --- /dev/null +++ b/test/core/http/response_corpus/a1dc7bc235e46eb21d91084d7b52d5ff9f45df85 @@ -0,0 +1,3 @@ +„HTT/21. 200 HTTP/1.1 HT!TP/1OKH.1HTTP 200 OKH
+tHT//80) OKH
+1
\ No newline at end of file diff --git a/test/core/http/response_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 b/test/core/http/response_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 new file mode 100644 index 0000000000..837449dda3 --- /dev/null +++ b/test/core/http/response_corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 @@ -0,0 +1,2 @@ +HTTP/1.1 80î OH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 b/test/core/http/response_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 new file mode 100644 index 0000000000..6075d0a5d7 --- /dev/null +++ b/test/core/http/response_corpus/ae8ba95d7dbe99926a8f5bfd80347fd6a4b616a0 @@ -0,0 +1,17 @@ +HTTP/1.1 200 OKH
TTP/16.1 200 OK +tesH
+tHHTTP/1.1 20TTP/00.021 :Oe¶,H
+test: h!eHTTP/1.1 200 OKH
+llo + +abcdtH +TTP/01.021 : Oes,0 OKH
TTP/16.1 200 OK +tesH
+tHTTP/00.021 :Oe¶,H
+test: h!eHTTP/1.1 200 OKH
+llo + +abcdtH +TTP/01.021 : Oes,H
+Ht
+teses
\ No newline at end of file diff --git a/test/core/http/response_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 b/test/core/http/response_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 new file mode 100644 index 0000000000..10905bed39 --- /dev/null +++ b/test/core/http/response_corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 @@ -0,0 +1,2 @@ +JHTTP/1.1 200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/c4acff8aa2ff886f35439f72625d05002990c940 b/test/core/http/response_corpus/c4acff8aa2ff886f35439f72625d05002990c940 new file mode 100644 index 0000000000..4539d9f012 --- /dev/null +++ b/test/core/http/response_corpus/c4acff8aa2ff886f35439f72625d05002990c940 @@ -0,0 +1,4 @@ +JHTT/21. 200 HTTP/2OKH.1 200 OKH
+tHTTP/01.021 Oes,H
+t
+t
\ No newline at end of file diff --git a/test/core/http/response_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 b/test/core/http/response_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 new file mode 100644 index 0000000000..2704e4fb39 --- /dev/null +++ b/test/core/http/response_corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 @@ -0,0 +1,2 @@ +HTTP/1.1 767) OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 b/test/core/http/response_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 new file mode 100644 index 0000000000..f5cbbc69e7 --- /dev/null +++ b/test/core/http/response_corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 @@ -0,0 +1,3 @@ +HJHTHHTT`TT +/1.1 201 P*HHTT/T1/OKH
+des1.1 2.1T 20T1
\ No newline at end of file diff --git a/test/core/http/response_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 b/test/core/http/response_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 new file mode 100644 index 0000000000..f6ea09c41b --- /dev/null +++ b/test/core/http/response_corpus/cce734f1b263de6994f7950e0df7bf0c81449f70 @@ -0,0 +1,3 @@ +JHTT/21. 200 HTTPHTTP/1.1 80î OH/1OKH.0 200 OKH
+tHTTP/0
+te
\ No newline at end of file diff --git a/test/core/http/response_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa b/test/core/http/response_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa new file mode 100644 index 0000000000..e241a0c01c --- /dev/null +++ b/test/core/http/response_corpus/d39c8ee11a697634a09b309460c0bbd967e7effa @@ -0,0 +1,17 @@ +HTTP/1.1 200 OKH
TTP/16.1 200 OK +tesHTTP/1.1 200 OKH
TTP/16.1 200 OK +tesH
+tHTTP/00.021 :Oe¶,H
+test: h!eHTTP/1.1 200H
+tHTTP/00.010 :Oe¶,H
+test: h!eHTTP/1.… 200 OKH
+llo + +abcdtH +TTP/01.02 : Oes,H OKH
+llo + +abcdtH +TTP/01.021 : Oes
, +H
+tteess
\ No newline at end of file diff --git a/test/core/http/response_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 b/test/core/http/response_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 new file mode 100644 index 0000000000..be33d81102 --- /dev/null +++ b/test/core/http/response_corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH
+ HTTP/01.021 : Oes,H
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 b/test/core/http/response_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 new file mode 100644 index 0000000000..e81a59f30b --- /dev/null +++ b/test/core/http/response_corpus/d51f7fcc089f269c7afecaaca51966bab5fde629 @@ -0,0 +1,2 @@ +ÏHTTP‰/1.200:OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 b/test/core/http/response_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 new file mode 100644 index 0000000000..ccf918751d --- /dev/null +++ b/test/core/http/response_corpus/d936dad71c129cf659097dc3db64550c4dd467f4 @@ -0,0 +1,2 @@ +HTTP‰/1.200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b b/test/core/http/response_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b new file mode 100644 index 0000000000..b6fc095920 --- /dev/null +++ b/test/core/http/response_corpus/e275b0466a8fb8d9e0e15856e343ddc7112ae66b @@ -0,0 +1,3 @@ +JHTT/21. 200 HTTRHTTP/1.1 0î OL/1OKH.0 200 OKH
+tHTTP/0
+te
\ No newline at end of file diff --git a/test/core/http/response_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 b/test/core/http/response_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 new file mode 100644 index 0000000000..98b5f62b2a --- /dev/null +++ b/test/core/http/response_corpus/e5c364b205855a2991ce07482aebb2a3a6147089 @@ -0,0 +1,2 @@ +TTHP‰/1.200 OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb b/test/core/http/response_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb new file mode 100644 index 0000000000..78b36c913b --- /dev/null +++ b/test/core/http/response_corpus/ee2077e08c3cfccd9bd82adb574ac4fc7d429afb @@ -0,0 +1,2 @@ +ITHTTTPHT/12 …2S HTKP/1.1 767) OKH
+tes
\ No newline at end of file diff --git a/test/core/http/response_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 b/test/core/http/response_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 new file mode 100644 index 0000000000..06f1a3b800 --- /dev/null +++ b/test/core/http/response_corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 @@ -0,0 +1 @@ +HH
\ No newline at end of file diff --git a/test/core/http/response_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b b/test/core/http/response_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b new file mode 100644 index 0000000000..eb63d31fa5 --- /dev/null +++ b/test/core/http/response_corpus/fdeb2c7daa9e7704f67e141106384e6dd0042c0b @@ -0,0 +1,2 @@ +ITTP/11 …20O HTTP/1.1 200 OKH
+HT DP/01021 : OesHK
,H
diff --git a/test/core/http/response_corpus/request1.txt b/test/core/http/response_corpus/request1.txt new file mode 100644 index 0000000000..16a750fbf9 --- /dev/null +++ b/test/core/http/response_corpus/request1.txt @@ -0,0 +1,3 @@ +GET / HTTP/1.0 + + diff --git a/test/core/http/response_corpus/request2.txt b/test/core/http/response_corpus/request2.txt new file mode 100644 index 0000000000..897a28406c --- /dev/null +++ b/test/core/http/response_corpus/request2.txt @@ -0,0 +1,3 @@ +GET / HTTP/1.0 +Content-Length: 128 + diff --git a/test/core/http/response_corpus/request3.txt b/test/core/http/response_corpus/request3.txt new file mode 100644 index 0000000000..aaa75bbb52 --- /dev/null +++ b/test/core/http/response_corpus/request3.txt @@ -0,0 +1,3 @@ +GET / HTTP/1.1 +Content-Length: 128 + diff --git a/test/core/http/response_corpus/request4.txt b/test/core/http/response_corpus/request4.txt new file mode 100644 index 0000000000..593f6fa7b6 --- /dev/null +++ b/test/core/http/response_corpus/request4.txt @@ -0,0 +1,3 @@ +GET /foo.bar HTTP/1.1 +Content-Length: 128 + diff --git a/test/core/http/response_corpus/request5.txt b/test/core/http/response_corpus/request5.txt new file mode 100644 index 0000000000..19fb244355 --- /dev/null +++ b/test/core/http/response_corpus/request5.txt @@ -0,0 +1,3 @@ +POST / HTTP/1.0 + +asdlfkjadsfl;akdjsfasdf diff --git a/test/core/http/response_corpus/response1.txt b/test/core/http/response_corpus/response1.txt new file mode 100644 index 0000000000..a17139982e --- /dev/null +++ b/test/core/http/response_corpus/response1.txt @@ -0,0 +1,4 @@ +HTTP/1.1 200 OK +test: hello + +abcd diff --git a/test/core/http/response_corpus/response2.txt b/test/core/http/response_corpus/response2.txt new file mode 100644 index 0000000000..1b86449bb6 --- /dev/null +++ b/test/core/http/response_corpus/response2.txt @@ -0,0 +1,4 @@ +HTTP/0.9 200 OK +test: hello + +abcd diff --git a/test/core/http/response_corpus/response3.txt b/test/core/http/response_corpus/response3.txt new file mode 100644 index 0000000000..9e5b046c59 --- /dev/null +++ b/test/core/http/response_corpus/response3.txt @@ -0,0 +1,5 @@ +HTTP/0.9 200 OK +test: hello +content-length: 102384398 + +abcd diff --git a/test/core/http/response_corpus/response4.txt b/test/core/http/response_corpus/response4.txt new file mode 100644 index 0000000000..b237b01fe0 --- /dev/null +++ b/test/core/http/response_corpus/response4.txt @@ -0,0 +1,2 @@ +HTTP/1.1 404 Not Found + diff --git a/test/core/http/response_corpus/response5.txt b/test/core/http/response_corpus/response5.txt new file mode 100644 index 0000000000..2630595713 --- /dev/null +++ b/test/core/http/response_corpus/response5.txt @@ -0,0 +1,5 @@ +HTTP/0.9 200 OK +test: hello +content-length: 4 + +abcd diff --git a/test/core/http/response_corpus/response6.txt b/test/core/http/response_corpus/response6.txt new file mode 100644 index 0000000000..797b6ee773 --- /dev/null +++ b/test/core/http/response_corpus/response6.txt @@ -0,0 +1,5 @@ +HTTP/0.9 200 OK +test: hello +content-length: 6 + +abcd diff --git a/test/core/http/response_corpus/toolong.txt b/test/core/http/response_corpus/toolong.txt new file mode 100644 index 0000000000..9a9d5e2fc3 --- /dev/null +++ b/test/core/http/response_corpus/toolong.txt @@ -0,0 +1,2 @@ +GET / HTTP/1.1 +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb diff --git a/test/core/http/fuzzer.c b/test/core/http/response_fuzzer.c index 7e4f4eb993..acde7c80a4 100644 --- a/test/core/http/fuzzer.c +++ b/test/core/http/response_fuzzer.c @@ -38,13 +38,19 @@ #include "src/core/lib/http/parser.h" +bool squelch = true; +bool leak_check = true; + int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_http_parser parser; - grpc_http_parser_init(&parser); + grpc_http_response response; + memset(&response, 0, sizeof(response)); + grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response); gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size); - grpc_http_parser_parse(&parser, slice); - grpc_http_parser_eof(&parser); + GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice)); + GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser)); gpr_slice_unref(slice); grpc_http_parser_destroy(&parser); + grpc_http_response_destroy(&response); return 0; } diff --git a/test/core/internal_api_canaries/iomgr.c b/test/core/internal_api_canaries/iomgr.c index f87a80cd90..5e86c42309 100644 --- a/test/core/internal_api_canaries/iomgr.c +++ b/test/core/internal_api_canaries/iomgr.c @@ -54,7 +54,7 @@ static void test_code(void) { grpc_closure closure; closure.cb = NULL; closure.cb_arg = NULL; - closure.final_data = 0; + closure.next_data.scratch = 0; grpc_closure_list closure_list = GRPC_CLOSURE_LIST_INIT; closure_list.head = NULL; @@ -65,15 +65,14 @@ static void test_code(void) { grpc_closure_create(NULL, NULL); grpc_closure_list_move(NULL, NULL); - grpc_closure_list_add(NULL, NULL, true); - bool x = grpc_closure_list_empty(closure_list); - grpc_closure_next(&closure); + grpc_closure_list_append(NULL, NULL, GRPC_ERROR_CREATE("Foo")); + grpc_closure_list_empty(closure_list); /* exec_ctx.h */ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx_flush(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx); - grpc_exec_ctx_enqueue(&exec_ctx, &closure, x, NULL); + grpc_exec_ctx_sched(&exec_ctx, &closure, GRPC_ERROR_CREATE("Foo"), NULL); grpc_exec_ctx_enqueue_list(&exec_ctx, &closure_list, NULL); /* endpoint.h */ @@ -95,7 +94,7 @@ static void test_code(void) { /* executor.h */ grpc_executor_init(); - grpc_executor_enqueue(&closure, x); + grpc_executor_push(&closure, GRPC_ERROR_CREATE("Phi")); grpc_executor_shutdown(); /* pollset.h */ @@ -104,9 +103,10 @@ static void test_code(void) { grpc_pollset_shutdown(NULL, NULL, NULL); grpc_pollset_reset(NULL); grpc_pollset_destroy(NULL); - grpc_pollset_work(NULL, NULL, NULL, gpr_now(GPR_CLOCK_REALTIME), - gpr_now(GPR_CLOCK_MONOTONIC)); - grpc_pollset_kick(NULL, NULL); + GRPC_ERROR_UNREF(grpc_pollset_work(NULL, NULL, NULL, + gpr_now(GPR_CLOCK_REALTIME), + gpr_now(GPR_CLOCK_MONOTONIC))); + GRPC_ERROR_UNREF(grpc_pollset_kick(NULL, NULL)); } int main(void) { diff --git a/test/core/internal_api_canaries/support.c b/test/core/internal_api_canaries/support.c index c51cbf2522..e992d2a66a 100644 --- a/test/core/internal_api_canaries/support.c +++ b/test/core/internal_api_canaries/support.c @@ -39,15 +39,15 @@ * This test is NOT expected to be run directly. ******************************************************************************/ +#include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/support/env.h" -#include "src/core/lib/support/load_file.h" #include "src/core/lib/support/tmpfile.h" static void test_code(void) { /* env.h */ gpr_set_env("abc", gpr_getenv("xyz")); /* load_file.h */ - gpr_load_file("abc", 1, NULL); + grpc_load_file("abc", 1, NULL); /* tmpfile.h */ fclose(gpr_tmpfile("foo", NULL)); } diff --git a/test/core/iomgr/endpoint_pair_test.c b/test/core/iomgr/endpoint_pair_test.c index 0df94a878f..99b86b6213 100644 --- a/test/core/iomgr/endpoint_pair_test.c +++ b/test/core/iomgr/endpoint_pair_test.c @@ -64,7 +64,8 @@ static grpc_endpoint_test_config configs[] = { {"tcp/tcp_socketpair", create_fixture_endpoint_pair, clean_up}, }; -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index 52082c3c6b..b79c22e42a 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -33,6 +33,7 @@ #include "test/core/iomgr/endpoint_tests.h" +#include <stdbool.h> #include <sys/types.h> #include <grpc/support/alloc.h> @@ -128,30 +129,30 @@ struct read_and_write_test_state { }; static void read_and_write_test_read_handler(grpc_exec_ctx *exec_ctx, - void *data, bool success) { + void *data, grpc_error *error) { struct read_and_write_test_state *state = data; state->bytes_read += count_slices( state->incoming.slices, state->incoming.count, &state->current_read_data); - if (state->bytes_read == state->target_bytes || !success) { + if (state->bytes_read == state->target_bytes || error != GRPC_ERROR_NONE) { gpr_log(GPR_INFO, "Read handler done"); gpr_mu_lock(g_mu); - state->read_done = 1 + success; - grpc_pollset_kick(g_pollset, NULL); + state->read_done = 1 + (error == GRPC_ERROR_NONE); + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL)); gpr_mu_unlock(g_mu); - } else if (success) { + } else if (error == GRPC_ERROR_NONE) { grpc_endpoint_read(exec_ctx, state->read_ep, &state->incoming, &state->done_read); } } static void read_and_write_test_write_handler(grpc_exec_ctx *exec_ctx, - void *data, bool success) { + void *data, grpc_error *error) { struct read_and_write_test_state *state = data; gpr_slice *slices = NULL; size_t nslices; - if (success) { + if (error == GRPC_ERROR_NONE) { state->bytes_written += state->current_write_size; if (state->target_bytes - state->bytes_written < state->current_write_size) { @@ -171,8 +172,8 @@ static void read_and_write_test_write_handler(grpc_exec_ctx *exec_ctx, gpr_log(GPR_INFO, "Write handler done"); gpr_mu_lock(g_mu); - state->write_done = 1 + success; - grpc_pollset_kick(g_pollset, NULL); + state->write_done = 1 + (error == GRPC_ERROR_NONE); + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL)); gpr_mu_unlock(g_mu); } @@ -182,19 +183,21 @@ static void read_and_write_test_write_handler(grpc_exec_ctx *exec_ctx, */ static void read_and_write_test(grpc_endpoint_test_config config, size_t num_bytes, size_t write_size, - size_t slice_size, int shutdown) { + size_t slice_size, bool shutdown) { struct read_and_write_test_state state; gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); grpc_endpoint_test_fixture f = begin_test(config, "read_and_write_test", slice_size); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - gpr_log(GPR_DEBUG, "num_bytes=%d write_size=%d slice_size=%d shutdown=%d", + gpr_log(GPR_DEBUG, "num_bytes=%" PRIuPTR " write_size=%" PRIuPTR + " slice_size=%" PRIuPTR " shutdown=%d", num_bytes, write_size, slice_size, shutdown); if (shutdown) { gpr_log(GPR_INFO, "Start read and write shutdown test"); } else { - gpr_log(GPR_INFO, "Start read and write test with %d bytes, slice size %d", + gpr_log(GPR_INFO, "Start read and write test with %" PRIuPTR + " bytes, slice size %" PRIuPTR, num_bytes, slice_size); } @@ -219,8 +222,8 @@ static void read_and_write_test(grpc_endpoint_test_config config, for the first iteration as for later iterations. It does the right thing even when bytes_written is unsigned. */ state.bytes_written -= state.current_write_size; - read_and_write_test_write_handler(&exec_ctx, &state, 1); - grpc_exec_ctx_finish(&exec_ctx); + read_and_write_test_write_handler(&exec_ctx, &state, GRPC_ERROR_NONE); + grpc_exec_ctx_flush(&exec_ctx); grpc_endpoint_read(&exec_ctx, state.read_ep, &state.incoming, &state.done_read); @@ -231,17 +234,19 @@ static void read_and_write_test(grpc_endpoint_test_config config, gpr_log(GPR_DEBUG, "shutdown write"); grpc_endpoint_shutdown(&exec_ctx, state.write_ep); } - grpc_exec_ctx_finish(&exec_ctx); + grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(g_mu); while (!state.read_done || !state.write_done) { grpc_pollset_worker *worker = NULL; GPR_ASSERT(gpr_time_cmp(gpr_now(GPR_CLOCK_MONOTONIC), deadline) < 0); - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), deadline))); } gpr_mu_unlock(g_mu); - grpc_exec_ctx_finish(&exec_ctx); + grpc_exec_ctx_flush(&exec_ctx); end_test(config); gpr_slice_buffer_destroy(&state.outgoing); @@ -251,16 +256,73 @@ static void read_and_write_test(grpc_endpoint_test_config config, grpc_exec_ctx_finish(&exec_ctx); } +static void inc_on_failure(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { + *(int *)arg += (error != GRPC_ERROR_NONE); +} + +static void wait_for_fail_count(grpc_exec_ctx *exec_ctx, int *fail_count, + int want_fail_count) { + grpc_exec_ctx_flush(exec_ctx); + for (int i = 0; i < 5 && *fail_count < want_fail_count; i++) { + grpc_pollset_worker *worker = NULL; + gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME); + gpr_timespec deadline = + gpr_time_add(now, gpr_time_from_seconds(1, GPR_TIMESPAN)); + gpr_mu_lock(g_mu); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(exec_ctx, g_pollset, &worker, now, deadline))); + gpr_mu_unlock(g_mu); + grpc_exec_ctx_flush(exec_ctx); + } + GPR_ASSERT(*fail_count == want_fail_count); +} + +static void multiple_shutdown_test(grpc_endpoint_test_config config) { + grpc_endpoint_test_fixture f = + begin_test(config, "multiple_shutdown_test", 128); + int fail_count = 0; + + gpr_slice_buffer slice_buffer; + gpr_slice_buffer_init(&slice_buffer); + + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset); + grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer, + grpc_closure_create(inc_on_failure, &fail_count)); + wait_for_fail_count(&exec_ctx, &fail_count, 0); + grpc_endpoint_shutdown(&exec_ctx, f.client_ep); + wait_for_fail_count(&exec_ctx, &fail_count, 1); + grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer, + grpc_closure_create(inc_on_failure, &fail_count)); + wait_for_fail_count(&exec_ctx, &fail_count, 2); + gpr_slice_buffer_add(&slice_buffer, gpr_slice_from_copied_string("a")); + grpc_endpoint_write(&exec_ctx, f.client_ep, &slice_buffer, + grpc_closure_create(inc_on_failure, &fail_count)); + wait_for_fail_count(&exec_ctx, &fail_count, 3); + grpc_endpoint_shutdown(&exec_ctx, f.client_ep); + wait_for_fail_count(&exec_ctx, &fail_count, 3); + + gpr_slice_buffer_destroy(&slice_buffer); + + grpc_endpoint_destroy(&exec_ctx, f.client_ep); + grpc_endpoint_destroy(&exec_ctx, f.server_ep); + grpc_exec_ctx_finish(&exec_ctx); +} + void grpc_endpoint_tests(grpc_endpoint_test_config config, grpc_pollset *pollset, gpr_mu *mu) { size_t i; g_pollset = pollset; g_mu = mu; - read_and_write_test(config, 10000000, 100000, 8192, 0); - read_and_write_test(config, 1000000, 100000, 1, 0); - read_and_write_test(config, 100000000, 100000, 1, 1); + multiple_shutdown_test(config); + read_and_write_test(config, 10000000, 100000, 8192, false); + read_and_write_test(config, 1000000, 100000, 1, false); + read_and_write_test(config, 100000000, 100000, 1, true); for (i = 1; i < 1000; i = GPR_MAX(i + 1, i * 5 / 4)) { - read_and_write_test(config, 40320, i, i, 0); + read_and_write_test(config, 40320, i, i, false); } g_pollset = NULL; + g_mu = NULL; } diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c index f97f33712e..62dc24d85a 100644 --- a/test/core/iomgr/fd_posix_test.c +++ b/test/core/iomgr/fd_posix_test.c @@ -52,6 +52,7 @@ #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/iomgr.h" +#include "src/core/lib/iomgr/socket_utils_posix.h" #include "test/core/util/test_config.h" static gpr_mu *g_mu; @@ -68,17 +69,15 @@ static void create_test_socket(int port, int *socket_fd, struct sockaddr_in *sin) { int fd; int one = 1; - int buf_size = BUF_SIZE; + int buffer_size_bytes = BUF_SIZE; int flags; fd = socket(AF_INET, SOCK_STREAM, 0); setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); /* Reset the size of socket send buffer to the minimal value to facilitate buffer filling up and triggering notify_on_write */ - GPR_ASSERT( - setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &buf_size, sizeof(buf_size)) != -1); - GPR_ASSERT( - setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &buf_size, sizeof(buf_size)) != -1); + GPR_ASSERT(grpc_set_socket_sndbuf(fd, buffer_size_bytes) == GRPC_ERROR_NONE); + GPR_ASSERT(grpc_set_socket_rcvbuf(fd, buffer_size_bytes) == GRPC_ERROR_NONE); /* Make fd non-blocking */ flags = fcntl(fd, F_GETFL, 0); GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0); @@ -133,14 +132,14 @@ static void session_shutdown_cb(grpc_exec_ctx *exec_ctx, void *arg, /*session */ /* Called when data become readable in a session. */ static void session_read_cb(grpc_exec_ctx *exec_ctx, void *arg, /*session */ - bool success) { + grpc_error *error) { session *se = arg; int fd = grpc_fd_wrapped_fd(se->em_fd); ssize_t read_once = 0; ssize_t read_total = 0; - if (!success) { + if (error != GRPC_ERROR_NONE) { session_shutdown_cb(exec_ctx, arg, 1); return; } @@ -185,13 +184,14 @@ static void listen_shutdown_cb(grpc_exec_ctx *exec_ctx, void *arg /*server */, gpr_mu_lock(g_mu); sv->done = 1; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT( + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); gpr_mu_unlock(g_mu); } /* Called when a new TCP connection request arrives in the listening port. */ static void listen_cb(grpc_exec_ctx *exec_ctx, void *arg, /*=sv_arg*/ - bool success) { + grpc_error *error) { server *sv = arg; int fd; int flags; @@ -200,7 +200,7 @@ static void listen_cb(grpc_exec_ctx *exec_ctx, void *arg, /*=sv_arg*/ socklen_t slen = sizeof(ss); grpc_fd *listen_em_fd = sv->em_fd; - if (!success) { + if (error != GRPC_ERROR_NONE) { listen_shutdown_cb(exec_ctx, arg, 1); return; } @@ -257,9 +257,11 @@ static void server_wait_and_shutdown(server *sv) { while (!sv->done) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - gpr_inf_future(GPR_CLOCK_MONOTONIC)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), + gpr_inf_future(GPR_CLOCK_MONOTONIC)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); @@ -300,17 +302,18 @@ static void client_session_shutdown_cb(grpc_exec_ctx *exec_ctx, client *cl = arg; grpc_fd_orphan(exec_ctx, cl->em_fd, NULL, NULL, "c"); cl->done = 1; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT( + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); } /* Write as much as possible, then register notify_on_write. */ static void client_session_write(grpc_exec_ctx *exec_ctx, void *arg, /*client */ - bool success) { + grpc_error *error) { client *cl = arg; int fd = grpc_fd_wrapped_fd(cl->em_fd); ssize_t write_once = 0; - if (!success) { + if (error != GRPC_ERROR_NONE) { gpr_mu_lock(g_mu); client_session_shutdown_cb(exec_ctx, arg, 1); gpr_mu_unlock(g_mu); @@ -363,7 +366,7 @@ static void client_start(grpc_exec_ctx *exec_ctx, client *cl, int port) { cl->em_fd = grpc_fd_create(fd, "client"); grpc_pollset_add_fd(exec_ctx, g_pollset, cl->em_fd); - client_session_write(exec_ctx, cl, 1); + client_session_write(exec_ctx, cl, GRPC_ERROR_NONE); } /* Wait for the signal to shutdown a client. */ @@ -372,9 +375,11 @@ static void client_wait_and_shutdown(client *cl) { while (!cl->done) { grpc_pollset_worker *worker = NULL; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - gpr_inf_future(GPR_CLOCK_MONOTONIC)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), + gpr_inf_future(GPR_CLOCK_MONOTONIC)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); @@ -399,7 +404,7 @@ static void test_grpc_fd(void) { client_wait_and_shutdown(&cl); server_wait_and_shutdown(&sv); GPR_ASSERT(sv.read_bytes_total == cl.write_bytes_total); - gpr_log(GPR_INFO, "Total read bytes %d", sv.read_bytes_total); + gpr_log(GPR_INFO, "Total read bytes %" PRIdPTR, sv.read_bytes_total); } typedef struct fd_change_data { @@ -411,22 +416,26 @@ void init_change_data(fd_change_data *fdc) { fdc->cb_that_ran = NULL; } void destroy_change_data(fd_change_data *fdc) {} static void first_read_callback(grpc_exec_ctx *exec_ctx, - void *arg /* fd_change_data */, bool success) { + void *arg /* fd_change_data */, + grpc_error *error) { fd_change_data *fdc = arg; gpr_mu_lock(g_mu); fdc->cb_that_ran = first_read_callback; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT( + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); gpr_mu_unlock(g_mu); } static void second_read_callback(grpc_exec_ctx *exec_ctx, - void *arg /* fd_change_data */, bool success) { + void *arg /* fd_change_data */, + grpc_error *error) { fd_change_data *fdc = arg; gpr_mu_lock(g_mu); fdc->cb_that_ran = second_read_callback; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT( + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); gpr_mu_unlock(g_mu); } @@ -472,9 +481,11 @@ static void test_grpc_fd_change(void) { gpr_mu_lock(g_mu); while (a.cb_that_ran == NULL) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - gpr_inf_future(GPR_CLOCK_MONOTONIC)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), + gpr_inf_future(GPR_CLOCK_MONOTONIC)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); @@ -496,9 +507,11 @@ static void test_grpc_fd_change(void) { gpr_mu_lock(g_mu); while (b.cb_that_ran == NULL) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - gpr_inf_future(GPR_CLOCK_MONOTONIC)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), + gpr_inf_future(GPR_CLOCK_MONOTONIC)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); @@ -514,7 +527,8 @@ static void test_grpc_fd_change(void) { close(sv[1]); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/support/load_file_test.c b/test/core/iomgr/load_file_test.c index 0125fd94fd..f70295a81c 100644 --- a/test/core/support/load_file_test.c +++ b/test/core/iomgr/load_file_test.c @@ -38,7 +38,7 @@ #include <grpc/support/log.h> #include <grpc/support/slice.h> -#include "src/core/lib/support/load_file.h" +#include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/support/string.h" #include "src/core/lib/support/tmpfile.h" #include "test/core/util/test_config.h" @@ -51,7 +51,7 @@ static void test_load_empty_file(void) { FILE *tmp = NULL; gpr_slice slice; gpr_slice slice_with_null_term; - int success; + grpc_error *error; char *tmp_name; LOG_TEST_NAME("test_load_empty_file"); @@ -61,12 +61,12 @@ static void test_load_empty_file(void) { GPR_ASSERT(tmp != NULL); fclose(tmp); - slice = gpr_load_file(tmp_name, 0, &success); - GPR_ASSERT(success == 1); + error = grpc_load_file(tmp_name, 0, &slice); + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 0); - slice_with_null_term = gpr_load_file(tmp_name, 1, &success); - GPR_ASSERT(success == 1); + error = grpc_load_file(tmp_name, 1, &slice_with_null_term); + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(GPR_SLICE_LENGTH(slice_with_null_term) == 1); GPR_ASSERT(GPR_SLICE_START_PTR(slice_with_null_term)[0] == 0); @@ -79,7 +79,7 @@ static void test_load_empty_file(void) { static void test_load_failure(void) { FILE *tmp = NULL; gpr_slice slice; - int success; + grpc_error *error; char *tmp_name; LOG_TEST_NAME("test_load_failure"); @@ -90,8 +90,9 @@ static void test_load_failure(void) { fclose(tmp); remove(tmp_name); - slice = gpr_load_file(tmp_name, 0, &success); - GPR_ASSERT(success == 0); + error = grpc_load_file(tmp_name, 0, &slice); + GPR_ASSERT(error != GRPC_ERROR_NONE); + GRPC_ERROR_UNREF(error); GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 0); gpr_free(tmp_name); gpr_slice_unref(slice); @@ -101,7 +102,7 @@ static void test_load_small_file(void) { FILE *tmp = NULL; gpr_slice slice; gpr_slice slice_with_null_term; - int success; + grpc_error *error; char *tmp_name; const char *blah = "blah"; @@ -113,13 +114,13 @@ static void test_load_small_file(void) { GPR_ASSERT(fwrite(blah, 1, strlen(blah), tmp) == strlen(blah)); fclose(tmp); - slice = gpr_load_file(tmp_name, 0, &success); - GPR_ASSERT(success == 1); + error = grpc_load_file(tmp_name, 0, &slice); + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(GPR_SLICE_LENGTH(slice) == strlen(blah)); GPR_ASSERT(!memcmp(GPR_SLICE_START_PTR(slice), blah, strlen(blah))); - slice_with_null_term = gpr_load_file(tmp_name, 1, &success); - GPR_ASSERT(success == 1); + error = grpc_load_file(tmp_name, 1, &slice_with_null_term); + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(GPR_SLICE_LENGTH(slice_with_null_term) == (strlen(blah) + 1)); GPR_ASSERT(strcmp((const char *)GPR_SLICE_START_PTR(slice_with_null_term), blah) == 0); @@ -133,7 +134,7 @@ static void test_load_small_file(void) { static void test_load_big_file(void) { FILE *tmp = NULL; gpr_slice slice; - int success; + grpc_error *error; char *tmp_name; static const size_t buffer_size = 124631; unsigned char *buffer = gpr_malloc(buffer_size); @@ -150,8 +151,8 @@ static void test_load_big_file(void) { GPR_ASSERT(fwrite(buffer, 1, buffer_size, tmp) == buffer_size); fclose(tmp); - slice = gpr_load_file(tmp_name, 0, &success); - GPR_ASSERT(success == 1); + error = grpc_load_file(tmp_name, 0, &slice); + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(GPR_SLICE_LENGTH(slice) == buffer_size); current = GPR_SLICE_START_PTR(slice); for (i = 0; i < buffer_size; i++) { diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c index c3ede1801d..4417d96043 100644 --- a/test/core/iomgr/resolve_address_test.c +++ b/test/core/iomgr/resolve_address_test.c @@ -42,54 +42,74 @@ static gpr_timespec test_deadline(void) { return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100); } -static void must_succeed(grpc_exec_ctx *exec_ctx, void *evp, - grpc_resolved_addresses *p) { - GPR_ASSERT(p); - GPR_ASSERT(p->naddrs >= 1); - grpc_resolved_addresses_destroy(p); - gpr_event_set(evp, (void *)1); +typedef struct args_struct { + gpr_event ev; + grpc_resolved_addresses *addrs; +} args_struct; + +void args_init(args_struct *args) { + gpr_event_init(&args->ev); + args->addrs = NULL; +} + +void args_finish(args_struct *args) { + GPR_ASSERT(gpr_event_wait(&args->ev, test_deadline())); + grpc_resolved_addresses_destroy(args->addrs); +} + +static void must_succeed(grpc_exec_ctx *exec_ctx, void *argsp, + grpc_error *err) { + args_struct *args = argsp; + GPR_ASSERT(err == GRPC_ERROR_NONE); + GPR_ASSERT(args->addrs != NULL); + GPR_ASSERT(args->addrs->naddrs > 0); + gpr_event_set(&args->ev, (void *)1); } -static void must_fail(grpc_exec_ctx *exec_ctx, void *evp, - grpc_resolved_addresses *p) { - GPR_ASSERT(!p); - gpr_event_set(evp, (void *)1); +static void must_fail(grpc_exec_ctx *exec_ctx, void *argsp, grpc_error *err) { + args_struct *args = argsp; + GPR_ASSERT(err != GRPC_ERROR_NONE); + gpr_event_set(&args->ev, (void *)1); } static void test_localhost(void) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, "localhost:1", NULL, must_succeed, &ev); + grpc_resolve_address(&exec_ctx, "localhost:1", NULL, + grpc_closure_create(must_succeed, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } static void test_default_port(void) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, "localhost", "1", must_succeed, &ev); + grpc_resolve_address(&exec_ctx, "localhost", "1", + grpc_closure_create(must_succeed, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } static void test_missing_default_port(void) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, "localhost", NULL, must_fail, &ev); + grpc_resolve_address(&exec_ctx, "localhost", NULL, + grpc_closure_create(must_fail, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } static void test_ipv6_with_port(void) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, "[2001:db8::1]:1", NULL, must_succeed, &ev); + grpc_resolve_address(&exec_ctx, "[2001:db8::1]:1", NULL, + grpc_closure_create(must_succeed, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } static void test_ipv6_without_port(void) { @@ -98,12 +118,13 @@ static void test_ipv6_without_port(void) { }; unsigned i; for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, kCases[i], "80", must_succeed, &ev); + grpc_resolve_address(&exec_ctx, kCases[i], "80", + grpc_closure_create(must_succeed, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } } @@ -113,12 +134,13 @@ static void test_invalid_ip_addresses(void) { }; unsigned i; for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, kCases[i], NULL, must_fail, &ev); + grpc_resolve_address(&exec_ctx, kCases[i], NULL, + grpc_closure_create(must_fail, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } } @@ -128,12 +150,13 @@ static void test_unparseable_hostports(void) { }; unsigned i; for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) { - gpr_event ev; - gpr_event_init(&ev); + args_struct args; + args_init(&args); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_resolve_address(&exec_ctx, kCases[i], "1", must_fail, &ev); + grpc_resolve_address(&exec_ctx, kCases[i], "1", + grpc_closure_create(must_fail, &args), &args.addrs); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); + args_finish(&args); } } diff --git a/test/core/iomgr/socket_utils_test.c b/test/core/iomgr/socket_utils_test.c index 85c027a978..297531c44d 100644 --- a/test/core/iomgr/socket_utils_test.c +++ b/test/core/iomgr/socket_utils_test.c @@ -47,14 +47,22 @@ int main(int argc, char **argv) { sock = socket(PF_INET, SOCK_STREAM, 0); GPR_ASSERT(sock > 0); - GPR_ASSERT(grpc_set_socket_nonblocking(sock, 1)); - GPR_ASSERT(grpc_set_socket_nonblocking(sock, 0)); - GPR_ASSERT(grpc_set_socket_cloexec(sock, 1)); - GPR_ASSERT(grpc_set_socket_cloexec(sock, 0)); - GPR_ASSERT(grpc_set_socket_reuse_addr(sock, 1)); - GPR_ASSERT(grpc_set_socket_reuse_addr(sock, 0)); - GPR_ASSERT(grpc_set_socket_low_latency(sock, 1)); - GPR_ASSERT(grpc_set_socket_low_latency(sock, 0)); + GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_nonblocking", + grpc_set_socket_nonblocking(sock, 1))); + GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_nonblocking", + grpc_set_socket_nonblocking(sock, 0))); + GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_cloexec", + grpc_set_socket_cloexec(sock, 1))); + GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_cloexec", + grpc_set_socket_cloexec(sock, 0))); + GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_reuse_addr", + grpc_set_socket_reuse_addr(sock, 1))); + GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_reuse_addr", + grpc_set_socket_reuse_addr(sock, 0))); + GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_low_latency", + grpc_set_socket_low_latency(sock, 1))); + GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_low_latency", + grpc_set_socket_low_latency(sock, 0))); close(sock); diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c index 22dc9366c3..d0c1047423 100644 --- a/test/core/iomgr/tcp_client_posix_test.c +++ b/test/core/iomgr/tcp_client_posix_test.c @@ -63,22 +63,24 @@ static gpr_timespec test_deadline(void) { static void finish_connection() { gpr_mu_lock(g_mu); g_connections_complete++; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT( + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); gpr_mu_unlock(g_mu); } -static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { GPR_ASSERT(g_connecting != NULL); - GPR_ASSERT(success); + GPR_ASSERT(error == GRPC_ERROR_NONE); grpc_endpoint_shutdown(exec_ctx, g_connecting); grpc_endpoint_destroy(exec_ctx, g_connecting); g_connecting = NULL; finish_connection(); } -static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { GPR_ASSERT(g_connecting == NULL); - GPR_ASSERT(!success); + GPR_ASSERT(error != GRPC_ERROR_NONE); finish_connection(); } @@ -125,9 +127,11 @@ void test_succeeds(void) { while (g_connections_complete == connections_complete_before) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(g_mu); @@ -168,7 +172,9 @@ void test_fails(void) { gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); gpr_timespec polling_deadline = test_deadline(); if (!grpc_timer_check(&exec_ctx, now, &polling_deadline)) { - grpc_pollset_work(&exec_ctx, g_pollset, &worker, now, polling_deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker, now, + polling_deadline))); } gpr_mu_unlock(g_mu); grpc_exec_ctx_flush(&exec_ctx); @@ -179,7 +185,8 @@ void test_fails(void) { grpc_exec_ctx_finish(&exec_ctx); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index 7a98fa0e50..42614567ca 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -139,19 +139,20 @@ static size_t count_slices(gpr_slice *slices, size_t nslices, return num_bytes; } -static void read_cb(grpc_exec_ctx *exec_ctx, void *user_data, bool success) { +static void read_cb(grpc_exec_ctx *exec_ctx, void *user_data, + grpc_error *error) { struct read_socket_state *state = (struct read_socket_state *)user_data; size_t read_bytes; int current_data; - GPR_ASSERT(success); + GPR_ASSERT(error == GRPC_ERROR_NONE); gpr_mu_lock(g_mu); current_data = state->read_bytes % 256; read_bytes = count_slices(state->incoming.slices, state->incoming.count, ¤t_data); state->read_bytes += read_bytes; - gpr_log(GPR_INFO, "Read %d bytes of %d", read_bytes, + gpr_log(GPR_INFO, "Read %" PRIuPTR " bytes of %" PRIuPTR, read_bytes, state->target_read_bytes); if (state->read_bytes >= state->target_read_bytes) { gpr_mu_unlock(g_mu); @@ -170,8 +171,8 @@ static void read_test(size_t num_bytes, size_t slice_size) { gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - gpr_log(GPR_INFO, "Read test of size %d, slice size %d", num_bytes, - slice_size); + gpr_log(GPR_INFO, "Read test of size %" PRIuPTR ", slice size %" PRIuPTR, + num_bytes, slice_size); create_sockets(sv); @@ -179,7 +180,7 @@ static void read_test(size_t num_bytes, size_t slice_size) { grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); written_bytes = fill_socket_partial(sv[0], num_bytes); - gpr_log(GPR_INFO, "Wrote %d bytes", written_bytes); + gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes); state.ep = ep; state.read_bytes = 0; @@ -192,8 +193,10 @@ static void read_test(size_t num_bytes, size_t slice_size) { gpr_mu_lock(g_mu); while (state.read_bytes < state.target_read_bytes) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), deadline))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); @@ -216,7 +219,7 @@ static void large_read_test(size_t slice_size) { gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - gpr_log(GPR_INFO, "Start large read test, slice size %d", slice_size); + gpr_log(GPR_INFO, "Start large read test, slice size %" PRIuPTR, slice_size); create_sockets(sv); @@ -225,7 +228,7 @@ static void large_read_test(size_t slice_size) { grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); written_bytes = fill_socket(sv[0]); - gpr_log(GPR_INFO, "Wrote %d bytes", written_bytes); + gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes); state.ep = ep; state.read_bytes = 0; @@ -238,8 +241,10 @@ static void large_read_test(size_t slice_size) { gpr_mu_lock(g_mu); while (state.read_bytes < state.target_read_bytes) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), deadline))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); @@ -281,13 +286,15 @@ static gpr_slice *allocate_blocks(size_t num_bytes, size_t slice_size, } static void write_done(grpc_exec_ctx *exec_ctx, - void *user_data /* write_socket_state */, bool success) { + void *user_data /* write_socket_state */, + grpc_error *error) { struct write_socket_state *state = (struct write_socket_state *)user_data; gpr_log(GPR_INFO, "Write done callback called"); gpr_mu_lock(g_mu); gpr_log(GPR_INFO, "Signalling write done"); state->write_done = 1; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT( + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); gpr_mu_unlock(g_mu); } @@ -306,9 +313,11 @@ void drain_socket_blocking(int fd, size_t num_bytes, size_t read_size) { for (;;) { grpc_pollset_worker *worker = NULL; gpr_mu_lock(g_mu); - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10)); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), + GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); do { @@ -344,8 +353,9 @@ static void write_test(size_t num_bytes, size_t slice_size) { gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - gpr_log(GPR_INFO, "Start write test with %d bytes, slice size %d", num_bytes, - slice_size); + gpr_log(GPR_INFO, + "Start write test with %" PRIuPTR " bytes, slice size %" PRIuPTR, + num_bytes, slice_size); create_sockets(sv); @@ -370,8 +380,10 @@ static void write_test(size_t num_bytes, size_t slice_size) { if (state.write_done) { break; } - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), deadline))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); @@ -384,10 +396,11 @@ static void write_test(size_t num_bytes, size_t slice_size) { grpc_exec_ctx_finish(&exec_ctx); } -void on_fd_released(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +void on_fd_released(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *errors) { int *done = arg; *done = 1; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT( + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); } /* Do a read_test, then release fd and try to read/write again. Verify that @@ -404,8 +417,9 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { int fd_released_done = 0; grpc_closure_init(&fd_released_cb, &on_fd_released, &fd_released_done); - gpr_log(GPR_INFO, "Release fd read_test of size %d, slice size %d", num_bytes, - slice_size); + gpr_log(GPR_INFO, + "Release fd read_test of size %" PRIuPTR ", slice size %" PRIuPTR, + num_bytes, slice_size); create_sockets(sv); @@ -414,7 +428,7 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); written_bytes = fill_socket_partial(sv[0], num_bytes); - gpr_log(GPR_INFO, "Wrote %d bytes", written_bytes); + gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes); state.ep = ep; state.read_bytes = 0; @@ -427,8 +441,10 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { gpr_mu_lock(g_mu); while (state.read_bytes < state.target_read_bytes) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), deadline))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(g_mu); @@ -441,8 +457,10 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { gpr_mu_lock(g_mu); while (!fd_released_done) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), deadline))); } gpr_mu_unlock(g_mu); GPR_ASSERT(fd_released_done == 1); @@ -504,7 +522,8 @@ static grpc_endpoint_test_config configs[] = { {"tcp/tcp_socketpair", create_fixture_tcp_socketpair, clean_up}, }; -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } @@ -515,8 +534,8 @@ int main(int argc, char **argv) { grpc_init(); g_pollset = gpr_malloc(grpc_pollset_size()); grpc_pollset_init(g_pollset, &g_mu); - run_tests(); grpc_endpoint_tests(configs[0], g_pollset, g_mu); + run_tests(); grpc_closure_init(&destroyed, destroy_pollset, g_pollset); grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed); grpc_exec_ctx_finish(&exec_ctx); diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index 222ae774fc..eda774fca5 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -90,7 +90,7 @@ static void on_connect_result_set(on_connect_result *result, } static void server_weak_ref_shutdown(grpc_exec_ctx *exec_ctx, void *arg, - bool success) { + grpc_error *error) { server_weak_ref *weak_ref = arg; weak_ref->server = NULL; } @@ -121,20 +121,23 @@ static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp, gpr_mu_lock(g_mu); on_connect_result_set(&g_result, acceptor); g_nconnects++; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT( + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); gpr_mu_unlock(g_mu); } static void test_no_op(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); grpc_tcp_server_unref(&exec_ctx, s); grpc_exec_ctx_finish(&exec_ctx); } static void test_no_op_with_start(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); LOG_TEST("test_no_op_with_start"); grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL); grpc_tcp_server_unref(&exec_ctx, s); @@ -144,13 +147,16 @@ static void test_no_op_with_start(void) { static void test_no_op_with_port(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; struct sockaddr_in addr; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); LOG_TEST("test_no_op_with_port"); memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; - GPR_ASSERT( - grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, sizeof(addr)) > 0); + int port; + GPR_ASSERT(grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, sizeof(addr), + &port) == GRPC_ERROR_NONE && + port > 0); grpc_tcp_server_unref(&exec_ctx, s); grpc_exec_ctx_finish(&exec_ctx); @@ -159,13 +165,16 @@ static void test_no_op_with_port(void) { static void test_no_op_with_port_and_start(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; struct sockaddr_in addr; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); LOG_TEST("test_no_op_with_port_and_start"); + int port; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; - GPR_ASSERT( - grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, sizeof(addr)) > 0); + GPR_ASSERT(grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, sizeof(addr), + &port) == GRPC_ERROR_NONE && + port > 0); grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL); @@ -189,8 +198,10 @@ static void tcp_connect(grpc_exec_ctx *exec_ctx, const struct sockaddr *remote, while (g_nconnects == nconnects_before && gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) > 0) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(exec_ctx, g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(exec_ctx, g_pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), deadline))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(exec_ctx); gpr_mu_lock(g_mu); @@ -214,7 +225,8 @@ static void test_connect(unsigned n) { int svr_port; unsigned svr1_fd_count; int svr1_port; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + GPR_ASSERT(GRPC_ERROR_NONE == grpc_tcp_server_create(NULL, &s)); unsigned i; server_weak_ref weak_ref; server_weak_ref_init(&weak_ref); @@ -223,14 +235,17 @@ static void test_connect(unsigned n) { memset(&addr, 0, sizeof(addr)); memset(&addr1, 0, sizeof(addr1)); addr.ss_family = addr1.ss_family = AF_INET; - svr_port = grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, addr_len); + GPR_ASSERT(GRPC_ERROR_NONE == + grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, addr_len, + &svr_port)); GPR_ASSERT(svr_port > 0); /* Cannot use wildcard (port==0), because add_port() will try to reuse the same port as a previous add_port(). */ svr1_port = grpc_pick_unused_port_or_die(); grpc_sockaddr_set_port((struct sockaddr *)&addr1, svr1_port); - GPR_ASSERT(grpc_tcp_server_add_port(s, (struct sockaddr *)&addr1, addr_len) == - svr1_port); + GPR_ASSERT(grpc_tcp_server_add_port(s, (struct sockaddr *)&addr1, addr_len, + &svr_port) == GRPC_ERROR_NONE && + svr_port == svr1_port); /* Bad port_index. */ GPR_ASSERT(grpc_tcp_server_port_fd_count(s, 2) == 0); @@ -306,7 +321,8 @@ static void test_connect(unsigned n) { grpc_exec_ctx_finish(&exec_ctx); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/iomgr/timer_list_test.c b/test/core/iomgr/timer_list_test.c index 2e0f5c8701..be8988ab75 100644 --- a/test/core/iomgr/timer_list_test.c +++ b/test/core/iomgr/timer_list_test.c @@ -42,8 +42,8 @@ static int cb_called[MAX_CB][2]; -static void cb(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - cb_called[(intptr_t)arg][success]++; +static void cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { + cb_called[(intptr_t)arg][error == GRPC_ERROR_NONE]++; } static void add_test(void) { diff --git a/test/core/iomgr/workqueue_test.c b/test/core/iomgr/workqueue_test.c index 953cc35ee6..76ecfae74b 100644 --- a/test/core/iomgr/workqueue_test.c +++ b/test/core/iomgr/workqueue_test.c @@ -42,17 +42,20 @@ static gpr_mu *g_mu; static grpc_pollset *g_pollset; -static void must_succeed(grpc_exec_ctx *exec_ctx, void *p, bool success) { - GPR_ASSERT(success == 1); +static void must_succeed(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); gpr_mu_lock(g_mu); *(int *)p = 1; - grpc_pollset_kick(g_pollset, NULL); + GPR_ASSERT( + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); gpr_mu_unlock(g_mu); } static void test_ref_unref(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_workqueue *wq = grpc_workqueue_create(&exec_ctx); + grpc_workqueue *wq; + GPR_ASSERT(GRPC_LOG_IF_ERROR("grpc_workqueue_create", + grpc_workqueue_create(&exec_ctx, &wq))); GRPC_WORKQUEUE_REF(wq, "test"); GRPC_WORKQUEUE_UNREF(&exec_ctx, wq, "test"); GRPC_WORKQUEUE_UNREF(&exec_ctx, wq, "destroy"); @@ -63,19 +66,23 @@ static void test_add_closure(void) { grpc_closure c; int done = 0; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_workqueue *wq = grpc_workqueue_create(&exec_ctx); + grpc_workqueue *wq; + GPR_ASSERT(GRPC_LOG_IF_ERROR("grpc_workqueue_create", + grpc_workqueue_create(&exec_ctx, &wq))); gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5); grpc_pollset_worker *worker = NULL; grpc_closure_init(&c, must_succeed, &done); - grpc_workqueue_push(wq, &c, 1); + grpc_workqueue_enqueue(&exec_ctx, wq, &c, GRPC_ERROR_NONE); grpc_workqueue_add_to_pollset(&exec_ctx, wq, g_pollset); gpr_mu_lock(g_mu); GPR_ASSERT(!done); while (!done) { - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(deadline.clock_type), deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(deadline.clock_type), deadline))); } gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); @@ -89,19 +96,24 @@ static void test_flush(void) { grpc_closure c; int done = 0; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_workqueue *wq = grpc_workqueue_create(&exec_ctx); + grpc_workqueue *wq; + GPR_ASSERT(GRPC_LOG_IF_ERROR("grpc_workqueue_create", + grpc_workqueue_create(&exec_ctx, &wq))); gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5); grpc_pollset_worker *worker = NULL; grpc_closure_init(&c, must_succeed, &done); - grpc_exec_ctx_enqueue(&exec_ctx, &c, true, NULL); + grpc_exec_ctx_sched(&exec_ctx, &c, GRPC_ERROR_NONE, NULL); grpc_workqueue_flush(&exec_ctx, wq); grpc_workqueue_add_to_pollset(&exec_ctx, wq, g_pollset); gpr_mu_lock(g_mu); + GPR_ASSERT(!done); while (!done) { - grpc_pollset_work(&exec_ctx, g_pollset, &worker, - gpr_now(deadline.clock_type), deadline); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(deadline.clock_type), deadline))); } gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); @@ -111,7 +123,8 @@ static void test_flush(void) { grpc_exec_ctx_finish(&exec_ctx); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/json/fuzzer.c b/test/core/json/fuzzer.c index e94b41ca99..26c5c25caf 100644 --- a/test/core/json/fuzzer.c +++ b/test/core/json/fuzzer.c @@ -31,6 +31,7 @@ * */ +#include <stdbool.h> #include <stdint.h> #include <string.h> @@ -40,6 +41,9 @@ #include "src/core/lib/json/json.h" #include "test/core/util/memory_counters.h" +bool squelch = true; +bool leak_check = true; + int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { char *s; struct grpc_memory_counters counters; diff --git a/test/core/nanopb/fuzzer_response.c b/test/core/nanopb/fuzzer_response.c index b4e386020a..21a5d7b968 100644 --- a/test/core/nanopb/fuzzer_response.c +++ b/test/core/nanopb/fuzzer_response.c @@ -38,6 +38,9 @@ #include "src/core/ext/lb_policy/grpclb/load_balancer_api.h" +bool squelch = true; +bool leak_check = true; + int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size); grpc_grpclb_response *response; diff --git a/test/core/nanopb/fuzzer_serverlist.c b/test/core/nanopb/fuzzer_serverlist.c index d4ec74f0e7..df2044d907 100644 --- a/test/core/nanopb/fuzzer_serverlist.c +++ b/test/core/nanopb/fuzzer_serverlist.c @@ -38,6 +38,9 @@ #include "src/core/ext/lb_policy/grpclb/load_balancer_api.h" +bool squelch = true; +bool leak_check = true; + int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size); grpc_grpclb_serverlist *serverlist; diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c index 3c36b767d3..1bd135f175 100644 --- a/test/core/security/create_jwt.c +++ b/test/core/security/create_jwt.c @@ -34,8 +34,8 @@ #include <stdio.h> #include <string.h> +#include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/security/credentials/jwt/jwt_credentials.h" -#include "src/core/lib/support/load_file.h" #include <grpc/support/alloc.h> #include <grpc/support/cmdline.h> @@ -45,13 +45,10 @@ void create_jwt(const char *json_key_file_path, const char *service_url, const char *scope) { grpc_auth_json_key key; - int ok = 0; char *jwt; - gpr_slice json_key_data = gpr_load_file(json_key_file_path, 1, &ok); - if (!ok) { - fprintf(stderr, "Could not read %s.\n", json_key_file_path); - exit(1); - } + gpr_slice json_key_data; + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "load_file", grpc_load_file(json_key_file_path, 1, &json_key_data))); key = grpc_auth_json_key_create_from_string( (const char *)GPR_SLICE_START_PTR(json_key_data)); gpr_slice_unref(json_key_data); diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c index 31e06372b9..e703dbdeb6 100644 --- a/test/core/security/credentials_test.c +++ b/test/core/security/credentials_test.c @@ -157,7 +157,7 @@ static grpc_httpcli_response http_response(int status, const char *body) { grpc_httpcli_response response; memset(&response, 0, sizeof(grpc_httpcli_response)); response.status = status; - response.body = (char *)body; + response.body = gpr_strdup((char *)body); response.body_length = strlen(body); return response; } @@ -247,6 +247,7 @@ static void test_oauth2_token_fetcher_creds_parsing_ok(void) { "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") == 0); grpc_credentials_md_store_unref(token_md); + grpc_http_response_destroy(&response); } static void test_oauth2_token_fetcher_creds_parsing_bad_http_status(void) { @@ -257,6 +258,7 @@ static void test_oauth2_token_fetcher_creds_parsing_bad_http_status(void) { GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response( &response, &token_md, &token_lifetime) == GRPC_CREDENTIALS_ERROR); + grpc_http_response_destroy(&response); } static void test_oauth2_token_fetcher_creds_parsing_empty_http_body(void) { @@ -266,6 +268,7 @@ static void test_oauth2_token_fetcher_creds_parsing_empty_http_body(void) { GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response( &response, &token_md, &token_lifetime) == GRPC_CREDENTIALS_ERROR); + grpc_http_response_destroy(&response); } static void test_oauth2_token_fetcher_creds_parsing_invalid_json(void) { @@ -279,6 +282,7 @@ static void test_oauth2_token_fetcher_creds_parsing_invalid_json(void) { GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response( &response, &token_md, &token_lifetime) == GRPC_CREDENTIALS_ERROR); + grpc_http_response_destroy(&response); } static void test_oauth2_token_fetcher_creds_parsing_missing_token(void) { @@ -291,6 +295,7 @@ static void test_oauth2_token_fetcher_creds_parsing_missing_token(void) { GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response( &response, &token_md, &token_lifetime) == GRPC_CREDENTIALS_ERROR); + grpc_http_response_destroy(&response); } static void test_oauth2_token_fetcher_creds_parsing_missing_token_type(void) { @@ -304,6 +309,7 @@ static void test_oauth2_token_fetcher_creds_parsing_missing_token_type(void) { GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response( &response, &token_md, &token_lifetime) == GRPC_CREDENTIALS_ERROR); + grpc_http_response_destroy(&response); } static void test_oauth2_token_fetcher_creds_parsing_missing_token_lifetime( @@ -317,6 +323,7 @@ static void test_oauth2_token_fetcher_creds_parsing_missing_token_lifetime( GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response( &response, &token_md, &token_lifetime) == GRPC_CREDENTIALS_ERROR); + grpc_http_response_destroy(&response); } static void check_metadata(expected_md *expected, grpc_credentials_md *md_elems, @@ -549,37 +556,37 @@ static void validate_compute_engine_http_request( static int compute_engine_httpcli_get_success_override( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = - http_response(200, valid_oauth2_json_response); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { validate_compute_engine_http_request(request); - on_response(exec_ctx, user_data, &response); + *response = http_response(200, valid_oauth2_json_response); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } static int compute_engine_httpcli_get_failure_override( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(403, "Not Authorized."); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { validate_compute_engine_http_request(request); - on_response(exec_ctx, user_data, &response); + *response = http_response(403, "Not Authorized."); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } static int httpcli_post_should_not_be_called( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, const char *body_bytes, size_t body_size, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, void *user_data) { + grpc_closure *on_done, grpc_httpcli_response *response) { GPR_ASSERT("HTTP POST should not be called" == NULL); return 1; } -static int httpcli_get_should_not_be_called( - grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { +static int httpcli_get_should_not_be_called(grpc_exec_ctx *exec_ctx, + const grpc_httpcli_request *request, + gpr_timespec deadline, + grpc_closure *on_done, + grpc_httpcli_response *response) { GPR_ASSERT("HTTP GET should not be called" == NULL); return 1; } @@ -653,21 +660,20 @@ static void validate_refresh_token_http_request( static int refresh_token_httpcli_post_success( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, const char *body, size_t body_size, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, void *user_data) { - grpc_httpcli_response response = - http_response(200, valid_oauth2_json_response); + grpc_closure *on_done, grpc_httpcli_response *response) { validate_refresh_token_http_request(request, body, body_size); - on_response(exec_ctx, user_data, &response); + *response = http_response(200, valid_oauth2_json_response); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } static int refresh_token_httpcli_post_failure( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, const char *body, size_t body_size, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, void *user_data) { - grpc_httpcli_response response = http_response(403, "Not Authorized."); + grpc_closure *on_done, grpc_httpcli_response *response) { validate_refresh_token_http_request(request, body, body_size); - on_response(exec_ctx, user_data, &response); + *response = http_response(403, "Not Authorized."); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -899,17 +905,17 @@ static void test_google_default_creds_refresh_token(void) { static int default_creds_gce_detection_httpcli_get_success_override( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(200, ""); - grpc_http_header header; - header.key = "Metadata-Flavor"; - header.value = "Google"; - response.hdr_count = 1; - response.hdrs = &header; + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, ""); + grpc_http_header *headers = gpr_malloc(sizeof(*headers) * 1); + headers[0].key = gpr_strdup("Metadata-Flavor"); + headers[0].value = gpr_strdup("Google"); + response->hdr_count = 1; + response->hdrs = headers; GPR_ASSERT(strcmp(request->http.path, "/") == 0); GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0); - on_response(exec_ctx, user_data, &response); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -961,13 +967,13 @@ static void test_google_default_creds_gce(void) { static int default_creds_gce_detection_httpcli_get_failure_override( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { /* No magic header. */ - grpc_httpcli_response response = http_response(200, ""); GPR_ASSERT(strcmp(request->http.path, "/") == 0); GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0); - on_response(exec_ctx, user_data, &response); + *response = http_response(200, ""); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } diff --git a/test/core/security/fetch_oauth2.c b/test/core/security/fetch_oauth2.c index 2a102fb139..292f59a7c1 100644 --- a/test/core/security/fetch_oauth2.c +++ b/test/core/security/fetch_oauth2.c @@ -42,19 +42,16 @@ #include <grpc/support/slice.h> #include <grpc/support/sync.h> +#include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/security/credentials/credentials.h" -#include "src/core/lib/support/load_file.h" #include "test/core/security/oauth2_utils.h" static grpc_call_credentials *create_refresh_token_creds( const char *json_refresh_token_file_path) { - int success; - gpr_slice refresh_token = - gpr_load_file(json_refresh_token_file_path, 1, &success); - if (!success) { - gpr_log(GPR_ERROR, "Could not read file %s.", json_refresh_token_file_path); - exit(1); - } + gpr_slice refresh_token; + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "load_file", + grpc_load_file(json_refresh_token_file_path, 1, &refresh_token))); return grpc_google_refresh_token_credentials_create( (const char *)GPR_SLICE_START_PTR(refresh_token), NULL); } diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c index 7f4f4ffadf..36b331a777 100644 --- a/test/core/security/jwt_verifier_test.c +++ b/test/core/security/jwt_verifier_test.c @@ -278,24 +278,23 @@ static grpc_httpcli_response http_response(int status, char *body) { static int httpcli_post_should_not_be_called( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, const char *body_bytes, size_t body_size, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, void *user_data) { + grpc_closure *on_done, grpc_httpcli_response *response) { GPR_ASSERT("HTTP POST should not be called" == NULL); return 1; } static int httpcli_get_google_keys_for_email( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(200, good_google_email_keys()); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, good_google_email_keys()); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0); GPR_ASSERT(strcmp(request->http.path, "/robot/v1/metadata/x509/" "777-abaslkan11hlb6nmim3bpspl31ud@developer." "gserviceaccount.com") == 0); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -325,22 +324,21 @@ static void test_jwt_verifier_google_email_issuer_success(void) { GPR_ASSERT(jwt != NULL); grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience, on_verification_success, (void *)expected_user_data); + grpc_exec_ctx_finish(&exec_ctx); gpr_free(jwt); grpc_jwt_verifier_destroy(verifier); grpc_httpcli_set_override(NULL, NULL); - grpc_exec_ctx_finish(&exec_ctx); } static int httpcli_get_custom_keys_for_email( grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set)); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, gpr_strdup(good_jwk_set)); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(strcmp(request->host, "keys.bar.com") == 0); GPR_ASSERT(strcmp(request->http.path, "/jwk/foo@bar.com") == 0); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -360,40 +358,36 @@ static void test_jwt_verifier_custom_email_issuer_success(void) { GPR_ASSERT(jwt != NULL); grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience, on_verification_success, (void *)expected_user_data); + grpc_exec_ctx_finish(&exec_ctx); gpr_free(jwt); grpc_jwt_verifier_destroy(verifier); grpc_httpcli_set_override(NULL, NULL); - grpc_exec_ctx_finish(&exec_ctx); } static int httpcli_get_jwk_set(grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, - grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set)); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, gpr_strdup(good_jwk_set)); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0); GPR_ASSERT(strcmp(request->http.path, "/oauth2/v3/certs") == 0); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } static int httpcli_get_openid_config(grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, gpr_timespec deadline, - grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = - http_response(200, gpr_strdup(good_openid_config)); + grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, gpr_strdup(good_openid_config)); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(strcmp(request->host, "accounts.google.com") == 0); GPR_ASSERT(strcmp(request->http.path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0); grpc_httpcli_set_override(httpcli_get_jwk_set, httpcli_post_should_not_be_called); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -413,10 +407,10 @@ static void test_jwt_verifier_url_issuer_success(void) { GPR_ASSERT(jwt != NULL); grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience, on_verification_success, (void *)expected_user_data); + grpc_exec_ctx_finish(&exec_ctx); gpr_free(jwt); grpc_jwt_verifier_destroy(verifier); grpc_httpcli_set_override(NULL, NULL); - grpc_exec_ctx_finish(&exec_ctx); } static void on_verification_key_retrieval_error(void *user_data, @@ -429,14 +423,11 @@ static void on_verification_key_retrieval_error(void *user_data, static int httpcli_get_bad_json(grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, - grpc_httpcli_response_cb on_response, - void *user_data) { - grpc_httpcli_response response = - http_response(200, gpr_strdup("{\"bad\": \"stuff\"}")); + gpr_timespec deadline, grpc_closure *on_done, + grpc_httpcli_response *response) { + *response = http_response(200, gpr_strdup("{\"bad\": \"stuff\"}")); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); - on_response(exec_ctx, user_data, &response); - gpr_free(response.body); + grpc_exec_ctx_sched(exec_ctx, on_done, GRPC_ERROR_NONE, NULL); return 1; } @@ -457,10 +448,10 @@ static void test_jwt_verifier_url_issuer_bad_config(void) { grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience, on_verification_key_retrieval_error, (void *)expected_user_data); + grpc_exec_ctx_finish(&exec_ctx); gpr_free(jwt); grpc_jwt_verifier_destroy(verifier); grpc_httpcli_set_override(NULL, NULL); - grpc_exec_ctx_finish(&exec_ctx); } static void test_jwt_verifier_bad_json_key(void) { @@ -480,10 +471,10 @@ static void test_jwt_verifier_bad_json_key(void) { grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience, on_verification_key_retrieval_error, (void *)expected_user_data); + grpc_exec_ctx_finish(&exec_ctx); gpr_free(jwt); grpc_jwt_verifier_destroy(verifier); grpc_httpcli_set_override(NULL, NULL); - grpc_exec_ctx_finish(&exec_ctx); } static void corrupt_jwt_sig(char *jwt) { @@ -529,16 +520,17 @@ static void test_jwt_verifier_bad_signature(void) { grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience, on_verification_bad_signature, (void *)expected_user_data); + grpc_exec_ctx_finish(&exec_ctx); gpr_free(jwt); grpc_jwt_verifier_destroy(verifier); grpc_httpcli_set_override(NULL, NULL); - grpc_exec_ctx_finish(&exec_ctx); } -static int httpcli_get_should_not_be_called( - grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request, - gpr_timespec deadline, grpc_httpcli_response_cb on_response, - void *user_data) { +static int httpcli_get_should_not_be_called(grpc_exec_ctx *exec_ctx, + const grpc_httpcli_request *request, + gpr_timespec deadline, + grpc_closure *on_done, + grpc_httpcli_response *response) { GPR_ASSERT(0); return 1; } @@ -559,9 +551,9 @@ static void test_jwt_verifier_bad_format(void) { grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, "bad jwt", expected_audience, on_verification_bad_format, (void *)expected_user_data); + grpc_exec_ctx_finish(&exec_ctx); grpc_jwt_verifier_destroy(verifier); grpc_httpcli_set_override(NULL, NULL); - grpc_exec_ctx_finish(&exec_ctx); } /* find verification key: bad jks, cannot find key in jks */ diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c index 80d21cc602..a334edc32d 100644 --- a/test/core/security/oauth2_utils.c +++ b/test/core/security/oauth2_utils.c @@ -46,7 +46,7 @@ typedef struct { gpr_mu *mu; - grpc_pollset *pollset; + grpc_polling_entity pops; int is_done; char *token; } oauth2_request; @@ -70,11 +70,14 @@ static void on_oauth2_response(grpc_exec_ctx *exec_ctx, void *user_data, gpr_mu_lock(request->mu); request->is_done = 1; request->token = token; - grpc_pollset_kick(request->pollset, NULL); + GRPC_LOG_IF_ERROR( + "pollset_kick", + grpc_pollset_kick(grpc_polling_entity_pollset(&request->pops), NULL)); gpr_mu_unlock(request->mu); } -static void do_nothing(grpc_exec_ctx *exec_ctx, void *unused, bool success) {} +static void do_nothing(grpc_exec_ctx *exec_ctx, void *unused, + grpc_error *error) {} char *grpc_test_fetch_oauth2_token_with_credentials( grpc_call_credentials *creds) { @@ -83,30 +86,35 @@ char *grpc_test_fetch_oauth2_token_with_credentials( grpc_closure do_nothing_closure; grpc_auth_metadata_context null_ctx = {"", "", NULL, NULL}; - request.pollset = gpr_malloc(grpc_pollset_size()); - grpc_pollset_init(request.pollset, &request.mu); + grpc_pollset *pollset = gpr_malloc(grpc_pollset_size()); + grpc_pollset_init(pollset, &request.mu); + request.pops = grpc_polling_entity_create_from_pollset(pollset); request.is_done = 0; grpc_closure_init(&do_nothing_closure, do_nothing, NULL); - grpc_call_credentials_get_request_metadata(&exec_ctx, creds, request.pollset, - null_ctx, on_oauth2_response, - &request); + grpc_call_credentials_get_request_metadata( + &exec_ctx, creds, &request.pops, null_ctx, on_oauth2_response, &request); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(request.mu); while (!request.is_done) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, request.pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - gpr_inf_future(GPR_CLOCK_MONOTONIC)); + if (!GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, + grpc_polling_entity_pollset(&request.pops), + &worker, gpr_now(GPR_CLOCK_MONOTONIC), + gpr_inf_future(GPR_CLOCK_MONOTONIC)))) { + request.is_done = 1; + } } gpr_mu_unlock(request.mu); - grpc_pollset_shutdown(&exec_ctx, request.pollset, &do_nothing_closure); + grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&request.pops), + &do_nothing_closure); grpc_exec_ctx_finish(&exec_ctx); - grpc_pollset_destroy(request.pollset); - gpr_free(request.pollset); + gpr_free(grpc_polling_entity_pollset(&request.pops)); return request.token; } diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c index 1b7036cf9e..18fbc3c41c 100644 --- a/test/core/security/print_google_default_creds_token.c +++ b/test/core/security/print_google_default_creds_token.c @@ -48,7 +48,7 @@ typedef struct { gpr_mu *mu; - grpc_pollset *pollset; + grpc_polling_entity pops; int is_done; } synchronizer; @@ -67,7 +67,9 @@ static void on_metadata_response(grpc_exec_ctx *exec_ctx, void *user_data, } gpr_mu_lock(sync->mu); sync->is_done = 1; - grpc_pollset_kick(sync->pollset, NULL); + GRPC_LOG_IF_ERROR( + "pollset_kick", + grpc_pollset_kick(grpc_polling_entity_pollset(&sync->pops), NULL)); gpr_mu_unlock(sync->mu); } @@ -94,20 +96,25 @@ int main(int argc, char **argv) { goto end; } - sync.pollset = gpr_malloc(grpc_pollset_size()); - grpc_pollset_init(sync.pollset, &sync.mu); + grpc_pollset *pollset = gpr_malloc(grpc_pollset_size()); + grpc_pollset_init(pollset, &sync.mu); + sync.pops = grpc_polling_entity_create_from_pollset(pollset); sync.is_done = 0; grpc_call_credentials_get_request_metadata( &exec_ctx, ((grpc_composite_channel_credentials *)creds)->call_creds, - sync.pollset, context, on_metadata_response, &sync); + &sync.pops, context, on_metadata_response, &sync); gpr_mu_lock(sync.mu); while (!sync.is_done) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, sync.pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - gpr_inf_future(GPR_CLOCK_MONOTONIC)); + if (!GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, + grpc_polling_entity_pollset(&sync.pops), &worker, + gpr_now(GPR_CLOCK_MONOTONIC), + gpr_inf_future(GPR_CLOCK_MONOTONIC)))) + sync.is_done = 1; gpr_mu_unlock(sync.mu); grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(sync.mu); @@ -117,7 +124,7 @@ int main(int argc, char **argv) { grpc_exec_ctx_finish(&exec_ctx); grpc_channel_credentials_release(creds); - gpr_free(sync.pollset); + gpr_free(grpc_polling_entity_pollset(&sync.pops)); end: gpr_cmdline_destroy(cl); diff --git a/test/core/security/secure_endpoint_test.c b/test/core/security/secure_endpoint_test.c index 6aba21a98c..1d2bf73bb1 100644 --- a/test/core/security/secure_endpoint_test.c +++ b/test/core/security/secure_endpoint_test.c @@ -139,7 +139,8 @@ static grpc_endpoint_test_config configs[] = { secure_endpoint_create_fixture_tcp_socketpair_leftover, clean_up}, }; -static void inc_call_ctr(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +static void inc_call_ctr(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { ++*(int *)arg; } @@ -172,7 +173,8 @@ static void test_leftover(grpc_endpoint_test_config config, size_t slice_size) { clean_up(); } -static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) { +static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { grpc_pollset_destroy(p); } diff --git a/test/core/security/verify_jwt.c b/test/core/security/verify_jwt.c index ecb873b655..728d2d637a 100644 --- a/test/core/security/verify_jwt.c +++ b/test/core/security/verify_jwt.c @@ -81,7 +81,7 @@ static void on_jwt_verification_done(void *user_data, gpr_mu_lock(sync->mu); sync->is_done = 1; - grpc_pollset_kick(sync->pollset, NULL); + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(sync->pollset, NULL)); gpr_mu_unlock(sync->mu); } @@ -115,9 +115,12 @@ int main(int argc, char **argv) { gpr_mu_lock(sync.mu); while (!sync.is_done) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, sync.pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - gpr_inf_future(GPR_CLOCK_MONOTONIC)); + if (!GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, sync.pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), + gpr_inf_future(GPR_CLOCK_MONOTONIC)))) + sync.is_done = true; gpr_mu_unlock(sync.mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(sync.mu); diff --git a/test/core/support/log_test.c b/test/core/support/log_test.c index 0ae298aa4c..807a8175d7 100644 --- a/test/core/support/log_test.c +++ b/test/core/support/log_test.c @@ -78,11 +78,13 @@ int main(int argc, char **argv) { gpr_set_log_function(test_callback); gpr_log_message(GPR_INFO, "hello 1 2 3"); gpr_log(GPR_INFO, "hello %d %d %d", 1, 2, 3); + gpr_set_log_function(NULL); /* gpr_log_verbosity_init() will be effective only once, and only before * gpr_set_log_verbosity() is called */ gpr_setenv("GRPC_VERBOSITY", "ERROR"); gpr_log_verbosity_init(); + test_log_function_reached(GPR_ERROR); test_log_function_unreached(GPR_INFO); test_log_function_unreached(GPR_DEBUG); diff --git a/test/core/support/slice_test.c b/test/core/support/slice_test.c index 2df38376a9..0da483a321 100644 --- a/test/core/support/slice_test.c +++ b/test/core/support/slice_test.c @@ -164,7 +164,7 @@ static void test_slice_split_head_works(size_t length) { size_t i; LOG_TEST_NAME("test_slice_split_head_works"); - gpr_log(GPR_INFO, "length=%d", length); + gpr_log(GPR_INFO, "length=%" PRIuPTR, length); /* Create a slice in which each byte is equal to the distance from it to the beginning of the slice. */ @@ -192,7 +192,7 @@ static void test_slice_split_tail_works(size_t length) { size_t i; LOG_TEST_NAME("test_slice_split_tail_works"); - gpr_log(GPR_INFO, "length=%d", length); + gpr_log(GPR_INFO, "length=%" PRIuPTR, length); /* Create a slice in which each byte is equal to the distance from it to the beginning of the slice. */ diff --git a/test/core/support/string_test.c b/test/core/support/string_test.c index d5f8107f21..553a824b3f 100644 --- a/test/core/support/string_test.c +++ b/test/core/support/string_test.c @@ -156,7 +156,7 @@ static void test_asprintf(void) { LOG_TEST_NAME("test_asprintf"); /* Print an empty string. */ - GPR_ASSERT(gpr_asprintf(&buf, "") == 0); + GPR_ASSERT(gpr_asprintf(&buf, "%s", "") == 0); GPR_ASSERT(buf[0] == '\0'); gpr_free(buf); @@ -334,6 +334,38 @@ static void test_int64toa() { GPR_ASSERT(0 == strcmp("-9223372036854775808", buf)); } +static void test_leftpad() { + char *padded; + + padded = gpr_leftpad("foo", ' ', 5); + GPR_ASSERT(0 == strcmp(" foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 4); + GPR_ASSERT(0 == strcmp(" foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 3); + GPR_ASSERT(0 == strcmp("foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 2); + GPR_ASSERT(0 == strcmp("foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 1); + GPR_ASSERT(0 == strcmp("foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 0); + GPR_ASSERT(0 == strcmp("foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", '0', 5); + GPR_ASSERT(0 == strcmp("00foo", padded)); + gpr_free(padded); +} + int main(int argc, char **argv) { grpc_test_init(argc, argv); test_strdup(); @@ -346,5 +378,6 @@ int main(int argc, char **argv) { test_strsplit(); test_ltoa(); test_int64toa(); + test_leftpad(); return 0; } diff --git a/test/core/support/tls_test.c b/test/core/support/tls_test.c index 7b732ee10e..2acc302ef2 100644 --- a/test/core/support/tls_test.c +++ b/test/core/support/tls_test.c @@ -50,7 +50,7 @@ static void thd_body(void *arg) { GPR_ASSERT(gpr_tls_get(&test_var) == 0); - for (i = 0; i < 10000000; i++) { + for (i = 0; i < 100000; i++) { gpr_tls_set(&test_var, i); GPR_ASSERT(gpr_tls_get(&test_var) == i); } diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index 49a1fc441f..1486d2508f 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -96,8 +96,8 @@ static void test_cq_end_op(void) { cc = grpc_completion_queue_create(NULL); grpc_cq_begin_op(cc, tag); - grpc_cq_end_op(&exec_ctx, cc, tag, 1, do_nothing_end_completion, NULL, - &completion); + grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, do_nothing_end_completion, + NULL, &completion); ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); @@ -155,8 +155,8 @@ static void test_pluck(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { grpc_cq_begin_op(cc, tags[i]); - grpc_cq_end_op(&exec_ctx, cc, tags[i], 1, do_nothing_end_completion, NULL, - &completions[i]); + grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, + do_nothing_end_completion, NULL, &completions[i]); } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -167,8 +167,8 @@ static void test_pluck(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { grpc_cq_begin_op(cc, tags[i]); - grpc_cq_end_op(&exec_ctx, cc, tags[i], 1, do_nothing_end_completion, NULL, - &completions[i]); + grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, + do_nothing_end_completion, NULL, &completions[i]); } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -240,8 +240,8 @@ static void test_too_many_plucks(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { grpc_cq_begin_op(cc, tags[i]); - grpc_cq_end_op(&exec_ctx, cc, tags[i], 1, do_nothing_end_completion, NULL, - &completions[i]); + grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, + do_nothing_end_completion, NULL, &completions[i]); } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -294,8 +294,9 @@ static void producer_thread(void *arg) { gpr_log(GPR_INFO, "producer %d phase 2", opt->id); for (i = 0; i < TEST_THREAD_EVENTS; i++) { - grpc_cq_end_op(&exec_ctx, opt->cc, (void *)(intptr_t)1, 1, free_completion, - NULL, gpr_malloc(sizeof(grpc_cq_completion))); + grpc_cq_end_op(&exec_ctx, opt->cc, (void *)(intptr_t)1, GRPC_ERROR_NONE, + free_completion, NULL, + gpr_malloc(sizeof(grpc_cq_completion))); opt->events_triggered++; grpc_exec_ctx_finish(&exec_ctx); } @@ -348,8 +349,8 @@ static void test_threading(size_t producers, size_t consumers) { size_t total_consumed = 0; static int optid = 101; - gpr_log(GPR_INFO, "%s: %d producers, %d consumers", "test_threading", - producers, consumers); + gpr_log(GPR_INFO, "%s: %" PRIuPTR " producers, %" PRIuPTR " consumers", + "test_threading", producers, consumers); /* start all threads: they will wait for phase1 */ for (i = 0; i < producers + consumers; i++) { diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c index de9ba8d27b..f447a68887 100644 --- a/test/core/surface/concurrent_connectivity_test.c +++ b/test/core/surface/concurrent_connectivity_test.c @@ -1,35 +1,35 @@ /* -* -* Copyright 2016, Google Inc. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are -* met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above -* copyright notice, this list of conditions and the following disclaimer -* in the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Google Inc. nor the names of its -* contributors may be used to endorse or promote products derived from -* this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ #include <memory.h> #include <stdio.h> @@ -102,7 +102,7 @@ static void on_connect(grpc_exec_ctx *exec_ctx, void *vargs, grpc_endpoint *tcp, (void)acceptor; grpc_endpoint_shutdown(exec_ctx, tcp); grpc_endpoint_destroy(exec_ctx, tcp); - grpc_pollset_kick(args->pollset, NULL); + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(args->pollset, NULL)); } void bad_server_thread(void *vargs) { @@ -112,10 +112,14 @@ void bad_server_thread(void *vargs) { struct sockaddr_storage addr; socklen_t addr_len = sizeof(addr); int port; - grpc_tcp_server *s = grpc_tcp_server_create(NULL); + grpc_tcp_server *s; + grpc_error *error = grpc_tcp_server_create(NULL, &s); + GPR_ASSERT(error == GRPC_ERROR_NONE); memset(&addr, 0, sizeof(addr)); addr.ss_family = AF_INET; - port = grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, addr_len); + error = + grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, addr_len, &port); + GPR_ASSERT(GRPC_LOG_IF_ERROR("grpc_tcp_server_add_port", error)); GPR_ASSERT(port > 0); gpr_asprintf(&args->addr, "localhost:%d", port); @@ -129,7 +133,11 @@ void bad_server_thread(void *vargs) { gpr_time_add(now, gpr_time_from_millis(100, GPR_TIMESPAN)); grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, args->pollset, &worker, now, deadline); + if (!GRPC_LOG_IF_ERROR("pollset_work", + grpc_pollset_work(&exec_ctx, args->pollset, &worker, + now, deadline))) { + gpr_atm_rel_store(&args->stop, 1); + } gpr_mu_unlock(args->mu); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(args->mu); @@ -144,7 +152,7 @@ void bad_server_thread(void *vargs) { } static void done_pollset_shutdown(grpc_exec_ctx *exec_ctx, void *pollset, - bool success) { + grpc_error *error) { grpc_pollset_destroy(pollset); gpr_free(pollset); } diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c index 12fa9de6cf..f36f980575 100644 --- a/test/core/surface/lame_client_test.c +++ b/test/core/surface/lame_client_test.c @@ -47,13 +47,14 @@ grpc_closure transport_op_cb; static void *tag(intptr_t x) { return (void *)x; } -void verify_connectivity(grpc_exec_ctx *exec_ctx, void *arg, bool success) { +void verify_connectivity(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { grpc_transport_op *op = arg; - GPR_ASSERT(GRPC_CHANNEL_FATAL_FAILURE == *op->connectivity_state); - GPR_ASSERT(success); + GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN == *op->connectivity_state); + GPR_ASSERT(error == GRPC_ERROR_NONE); } -void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, bool success) {} +void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {} void test_transport_op(grpc_channel *channel) { grpc_transport_op op; @@ -104,7 +105,7 @@ int main(int argc, char **argv) { test_transport_op(chan); - GPR_ASSERT(GRPC_CHANNEL_FATAL_FAILURE == + GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN == grpc_channel_check_connectivity_state(chan, 0)); cq = grpc_completion_queue_create(NULL); @@ -115,6 +116,7 @@ int main(int argc, char **argv) { GPR_ASSERT(call); cqv = cq_verifier_create(cq); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -133,6 +135,7 @@ int main(int argc, char **argv) { cq_expect_completion(cqv, tag(1), 0); cq_verify(cqv); + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index fd6ff2c26f..3eeb55d033 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -36,7 +36,6 @@ #include <grpc/census.h> #include <grpc/compression.h> #include <grpc/grpc.h> -#include <grpc/grpc_cronet.h> #include <grpc/grpc_security.h> #include <grpc/grpc_security_constants.h> #include <grpc/impl/codegen/alloc.h> diff --git a/test/core/surface/sequential_connectivity_test.c b/test/core/surface/sequential_connectivity_test.c new file mode 100644 index 0000000000..2fba3927ba --- /dev/null +++ b/test/core/surface/sequential_connectivity_test.c @@ -0,0 +1,179 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include <grpc/grpc.h> +#include <grpc/grpc_security.h> +#include <grpc/support/alloc.h> +#include <grpc/support/host_port.h> +#include <grpc/support/log.h> +#include <grpc/support/thd.h> + +#include "src/core/lib/channel/channel_args.h" +#include "test/core/end2end/data/ssl_test_data.h" +#include "test/core/util/port.h" +#include "test/core/util/test_config.h" + +typedef struct test_fixture { + const char *name; + void (*add_server_port)(grpc_server *server, const char *addr); + grpc_channel *(*create_channel)(const char *addr); +} test_fixture; + +#define NUM_CONNECTIONS 1000 + +typedef struct { + grpc_server *server; + grpc_completion_queue *cq; +} server_thread_args; + +static void server_thread_func(void *args) { + server_thread_args *a = args; + grpc_event ev = grpc_completion_queue_next( + a->cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); + GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); + GPR_ASSERT(ev.tag == NULL); + GPR_ASSERT(ev.success == true); +} + +static void run_test(const test_fixture *fixture) { + gpr_log(GPR_INFO, "TEST: %s", fixture->name); + + grpc_init(); + + char *addr; + gpr_join_host_port(&addr, "localhost", grpc_pick_unused_port_or_die()); + + grpc_server *server = grpc_server_create(NULL, NULL); + fixture->add_server_port(server, addr); + grpc_completion_queue *server_cq = grpc_completion_queue_create(NULL); + grpc_server_register_completion_queue(server, server_cq, NULL); + grpc_server_start(server); + + server_thread_args sta = {server, server_cq}; + gpr_thd_id server_thread; + gpr_thd_options thdopt = gpr_thd_options_default(); + gpr_thd_options_set_joinable(&thdopt); + gpr_thd_new(&server_thread, server_thread_func, &sta, &thdopt); + + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); + grpc_channel *channels[NUM_CONNECTIONS]; + for (size_t i = 0; i < NUM_CONNECTIONS; i++) { + channels[i] = fixture->create_channel(addr); + + gpr_timespec connect_deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(30); + grpc_connectivity_state state; + while ((state = grpc_channel_check_connectivity_state(channels[i], 1)) != + GRPC_CHANNEL_READY) { + grpc_channel_watch_connectivity_state(channels[i], state, + connect_deadline, cq, NULL); + grpc_event ev = grpc_completion_queue_next( + cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); + GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); + GPR_ASSERT(ev.tag == NULL); + GPR_ASSERT(ev.success == true); + } + } + + grpc_server_shutdown_and_notify(server, server_cq, NULL); + gpr_thd_join(server_thread); + + grpc_completion_queue_shutdown(server_cq); + grpc_completion_queue_shutdown(cq); + + while (grpc_completion_queue_next(server_cq, + gpr_inf_future(GPR_CLOCK_REALTIME), NULL) + .type != GRPC_QUEUE_SHUTDOWN) + ; + while ( + grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL) + .type != GRPC_QUEUE_SHUTDOWN) + ; + + for (size_t i = 0; i < NUM_CONNECTIONS; i++) { + grpc_channel_destroy(channels[i]); + } + + grpc_server_destroy(server); + grpc_completion_queue_destroy(server_cq); + grpc_completion_queue_destroy(cq); + + grpc_shutdown(); + gpr_free(addr); +} + +static void insecure_test_add_port(grpc_server *server, const char *addr) { + grpc_server_add_insecure_http2_port(server, addr); +} + +static grpc_channel *insecure_test_create_channel(const char *addr) { + return grpc_insecure_channel_create(addr, NULL, NULL); +} + +static const test_fixture insecure_test = { + "insecure", insecure_test_add_port, insecure_test_create_channel, +}; + +static void secure_test_add_port(grpc_server *server, const char *addr) { + grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, + test_server1_cert}; + grpc_server_credentials *ssl_creds = + grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); + grpc_server_add_secure_http2_port(server, addr, ssl_creds); + grpc_server_credentials_release(ssl_creds); +} + +static grpc_channel *secure_test_create_channel(const char *addr) { + grpc_channel_credentials *ssl_creds = + grpc_ssl_credentials_create(NULL, NULL, NULL); + grpc_arg ssl_name_override = {GRPC_ARG_STRING, + GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, + {"foo.test.google.fr"}}; + grpc_channel_args *new_client_args = + grpc_channel_args_copy_and_add(NULL, &ssl_name_override, 1); + grpc_channel *channel = + grpc_secure_channel_create(ssl_creds, addr, new_client_args, NULL); + grpc_channel_args_destroy(new_client_args); + grpc_channel_credentials_release(ssl_creds); + return channel; +} + +static const test_fixture secure_test = { + "secure", secure_test_add_port, secure_test_create_channel, +}; + +int main(int argc, char **argv) { + grpc_test_init(argc, argv); + + run_test(&insecure_test); + run_test(&secure_test); +} diff --git a/test/core/surface/server_test.c b/test/core/surface/server_test.c index 1e94c5a41b..02eb432e2d 100644 --- a/test/core/surface/server_test.c +++ b/test/core/surface/server_test.c @@ -32,9 +32,13 @@ */ #include <grpc/grpc.h> +#include <grpc/grpc_security.h> #include <grpc/support/alloc.h> +#include <grpc/support/host_port.h> #include <grpc/support/log.h> #include <grpc/support/string_util.h> +#include "src/core/lib/iomgr/resolve_address.h" +#include "src/core/lib/security/credentials/fake/fake_credentials.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" @@ -86,8 +90,13 @@ void test_bind_server_twice(void) { gpr_asprintf(&addr, "[::]:%d", port); grpc_server_register_completion_queue(server1, cq, NULL); grpc_server_register_completion_queue(server2, cq, NULL); + GPR_ASSERT(0 == grpc_server_add_secure_http2_port(server2, addr, NULL)); GPR_ASSERT(port == grpc_server_add_insecure_http2_port(server1, addr)); GPR_ASSERT(0 == grpc_server_add_insecure_http2_port(server2, addr)); + grpc_server_credentials *fake_creds = + grpc_fake_transport_security_server_credentials_create(); + GPR_ASSERT(0 == grpc_server_add_secure_http2_port(server2, addr, fake_creds)); + grpc_server_credentials_release(fake_creds); grpc_server_shutdown_and_notify(server1, cq, NULL); grpc_server_shutdown_and_notify(server2, cq, NULL); grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL); @@ -98,12 +107,68 @@ void test_bind_server_twice(void) { gpr_free(addr); } +void test_bind_server_to_addr(const char *host, bool secure) { + int port = grpc_pick_unused_port_or_die(); + char *addr; + gpr_join_host_port(&addr, host, port); + gpr_log(GPR_INFO, "Test bind to %s", addr); + + grpc_server *server = grpc_server_create(NULL, NULL); + if (secure) { + grpc_server_credentials *fake_creds = + grpc_fake_transport_security_server_credentials_create(); + GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, fake_creds)); + grpc_server_credentials_release(fake_creds); + } else { + GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr)); + } + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); + grpc_server_register_completion_queue(server, cq, NULL); + grpc_server_start(server); + grpc_server_shutdown_and_notify(server, cq, NULL); + grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL); + grpc_server_destroy(server); + grpc_completion_queue_destroy(cq); + gpr_free(addr); +} + +static int external_dns_works(const char *host) { + grpc_resolved_addresses *res; + grpc_error *error = grpc_blocking_resolve_address(host, "80", &res); + GRPC_ERROR_UNREF(error); + if (res != NULL) { + grpc_resolved_addresses_destroy(res); + return 1; + } + return 0; +} + +static void test_bind_server_to_addrs(const char **addrs, size_t n) { + for (size_t i = 0; i < n; i++) { + test_bind_server_to_addr(addrs[i], false); + test_bind_server_to_addr(addrs[i], true); + } +} + int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); test_register_method_fail(); test_request_call_on_no_server_cq(); test_bind_server_twice(); + + static const char *addrs[] = { + "::1", "127.0.0.1", "::ffff:127.0.0.1", "localhost", "0.0.0.0", "::", + }; + test_bind_server_to_addrs(addrs, GPR_ARRAY_SIZE(addrs)); + + if (external_dns_works("loopback46.unittest.grpc.io")) { + static const char *dns_addrs[] = { + "loopback46.unittest.grpc.io", "loopback4.unittest.grpc.io", + }; + test_bind_server_to_addrs(dns_addrs, GPR_ARRAY_SIZE(dns_addrs)); + } + grpc_shutdown(); return 0; } diff --git a/test/core/transport/chttp2/bin_decoder_test.c b/test/core/transport/chttp2/bin_decoder_test.c new file mode 100644 index 0000000000..c4e6cd332f --- /dev/null +++ b/test/core/transport/chttp2/bin_decoder_test.c @@ -0,0 +1,144 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/ext/transport/chttp2/transport/bin_decoder.h" + +#include <string.h> + +#include <grpc/support/alloc.h> +#include <grpc/support/log.h> +#include "src/core/ext/transport/chttp2/transport/bin_encoder.h" +#include "src/core/lib/support/string.h" + +static int all_ok = 1; + +static void expect_slice_eq(gpr_slice expected, gpr_slice slice, char *debug, + int line) { + if (0 != gpr_slice_cmp(slice, expected)) { + char *hs = gpr_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII); + char *he = gpr_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII); + gpr_log(GPR_ERROR, "FAILED:%d: %s\ngot: %s\nwant: %s", line, debug, hs, + he); + gpr_free(hs); + gpr_free(he); + all_ok = 0; + } + gpr_slice_unref(expected); + gpr_slice_unref(slice); +} + +static gpr_slice base64_encode(const char *s) { + gpr_slice ss = gpr_slice_from_copied_string(s); + gpr_slice out = grpc_chttp2_base64_encode(ss); + gpr_slice_unref(ss); + return out; +} + +static gpr_slice base64_decode(const char *s) { + gpr_slice ss = gpr_slice_from_copied_string(s); + gpr_slice out = grpc_chttp2_base64_decode(ss); + gpr_slice_unref(ss); + return out; +} + +static gpr_slice base64_decode_with_length(const char *s, + size_t output_length) { + gpr_slice ss = gpr_slice_from_copied_string(s); + gpr_slice out = grpc_chttp2_base64_decode_with_length(ss, output_length); + gpr_slice_unref(ss); + return out; +} + +#define EXPECT_SLICE_EQ(expected, slice) \ + expect_slice_eq( \ + gpr_slice_from_copied_buffer(expected, sizeof(expected) - 1), slice, \ + #slice, __LINE__); + +#define ENCODE_AND_DECODE(s) \ + EXPECT_SLICE_EQ( \ + s, grpc_chttp2_base64_decode_with_length(base64_encode(s), strlen(s))); + +int main(int argc, char **argv) { + /* ENCODE_AND_DECODE tests grpc_chttp2_base64_decode_with_length(), which + takes encoded base64 strings without pad chars, but output length is + required. */ + /* Base64 test vectors from RFC 4648 */ + ENCODE_AND_DECODE(""); + ENCODE_AND_DECODE("f"); + ENCODE_AND_DECODE("foo"); + ENCODE_AND_DECODE("fo"); + ENCODE_AND_DECODE("foob"); + ENCODE_AND_DECODE("fooba"); + ENCODE_AND_DECODE("foobar"); + + ENCODE_AND_DECODE("\xc0\xc1\xc2\xc3\xc4\xc5"); + + /* Base64 test vectors from RFC 4648, with pad chars */ + /* BASE64("") = "" */ + EXPECT_SLICE_EQ("", base64_decode("")); + /* BASE64("f") = "Zg==" */ + EXPECT_SLICE_EQ("f", base64_decode("Zg==")); + /* BASE64("fo") = "Zm8=" */ + EXPECT_SLICE_EQ("fo", base64_decode("Zm8=")); + /* BASE64("foo") = "Zm9v" */ + EXPECT_SLICE_EQ("foo", base64_decode("Zm9v")); + /* BASE64("foob") = "Zm9vYg==" */ + EXPECT_SLICE_EQ("foob", base64_decode("Zm9vYg==")); + /* BASE64("fooba") = "Zm9vYmE=" */ + EXPECT_SLICE_EQ("fooba", base64_decode("Zm9vYmE=")); + /* BASE64("foobar") = "Zm9vYmFy" */ + EXPECT_SLICE_EQ("foobar", base64_decode("Zm9vYmFy")); + + EXPECT_SLICE_EQ("\xc0\xc1\xc2\xc3\xc4\xc5", base64_decode("wMHCw8TF")); + + // Test illegal input length in grpc_chttp2_base64_decode + EXPECT_SLICE_EQ("", base64_decode("a")); + EXPECT_SLICE_EQ("", base64_decode("ab")); + EXPECT_SLICE_EQ("", base64_decode("abc")); + + // Test illegal charactors in grpc_chttp2_base64_decode + EXPECT_SLICE_EQ("", base64_decode("Zm:v")); + EXPECT_SLICE_EQ("", base64_decode("Zm=v")); + + // Test output_length longer than max possible output length in + // grpc_chttp2_base64_decode_with_length + EXPECT_SLICE_EQ("", base64_decode_with_length("Zg", 2)); + EXPECT_SLICE_EQ("", base64_decode_with_length("Zm8", 3)); + EXPECT_SLICE_EQ("", base64_decode_with_length("Zm9v", 4)); + + // Test illegal charactors in grpc_chttp2_base64_decode_with_length + EXPECT_SLICE_EQ("", base64_decode_with_length("Zm:v", 3)); + EXPECT_SLICE_EQ("", base64_decode_with_length("Zm=v", 3)); + + return all_ok ? 0 : 1; +} diff --git a/test/core/transport/chttp2/bin_encoder_test.c b/test/core/transport/chttp2/bin_encoder_test.c index 095861e974..08d10735a5 100644 --- a/test/core/transport/chttp2/bin_encoder_test.c +++ b/test/core/transport/chttp2/bin_encoder_test.c @@ -88,7 +88,8 @@ static void expect_combined_equiv(const char *s, size_t len, int line) { char *t = gpr_dump_slice(input, GPR_DUMP_HEX | GPR_DUMP_ASCII); char *e = gpr_dump_slice(expect, GPR_DUMP_HEX | GPR_DUMP_ASCII); char *g = gpr_dump_slice(got, GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_ERROR, "FAILED:%d:\ntest: %s\ngot: %s\nwant: %s", t, g, e); + gpr_log(GPR_ERROR, "FAILED:%d:\ntest: %s\ngot: %s\nwant: %s", line, t, g, + e); gpr_free(t); gpr_free(e); gpr_free(g); diff --git a/test/core/transport/chttp2/hpack_parser_fuzzer_test.c b/test/core/transport/chttp2/hpack_parser_fuzzer_test.c index e41eda8653..b7f68e0dd4 100644 --- a/test/core/transport/chttp2/hpack_parser_fuzzer_test.c +++ b/test/core/transport/chttp2/hpack_parser_fuzzer_test.c @@ -40,17 +40,20 @@ #include "src/core/ext/transport/chttp2/transport/hpack_parser.h" +bool squelch = true; +bool leak_check = true; + static void onhdr(void *ud, grpc_mdelem *md) { GRPC_MDELEM_UNREF(md); } static void dont_log(gpr_log_func_args *args) {} int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_test_only_set_metadata_hash_seed(0); - gpr_set_log_function(dont_log); + if (squelch) gpr_set_log_function(dont_log); grpc_init(); grpc_chttp2_hpack_parser parser; grpc_chttp2_hpack_parser_init(&parser); parser.on_header = onhdr; - grpc_chttp2_hpack_parser_parse(&parser, data, data + size); + GRPC_ERROR_UNREF(grpc_chttp2_hpack_parser_parse(&parser, data, data + size)); grpc_chttp2_hpack_parser_destroy(&parser); grpc_shutdown(); return 0; diff --git a/test/core/transport/chttp2/hpack_parser_test.c b/test/core/transport/chttp2/hpack_parser_test.c index 51bf48dc09..9ddceb8981 100644 --- a/test/core/transport/chttp2/hpack_parser_test.c +++ b/test/core/transport/chttp2/hpack_parser_test.c @@ -76,7 +76,8 @@ static void test_vector(grpc_chttp2_hpack_parser *parser, for (i = 0; i < nslices; i++) { GPR_ASSERT(grpc_chttp2_hpack_parser_parse( - parser, GPR_SLICE_START_PTR(slices[i]), GPR_SLICE_END_PTR(slices[i]))); + parser, GPR_SLICE_START_PTR(slices[i]), + GPR_SLICE_END_PTR(slices[i])) == GRPC_ERROR_NONE); } for (i = 0; i < nslices; i++) { diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c index 73e59f1536..75b0ef4629 100644 --- a/test/core/transport/chttp2/hpack_table_test.c +++ b/test/core/transport/chttp2/hpack_table_test.c @@ -139,12 +139,12 @@ static void test_many_additions(void) { grpc_chttp2_hptbl_init(&tbl); - for (i = 0; i < 1000000; i++) { + for (i = 0; i < 100000; i++) { grpc_mdelem *elem; gpr_asprintf(&key, "K:%d", i); gpr_asprintf(&value, "VALUE:%d", i); elem = grpc_mdelem_from_strings(key, value); - GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem)); + GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE); GRPC_MDELEM_UNREF(elem); assert_index(&tbl, 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY, key, value); gpr_free(key); @@ -181,13 +181,13 @@ static void test_find(void) { grpc_chttp2_hptbl_init(&tbl); elem = grpc_mdelem_from_strings("abc", "xyz"); - GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem)); + GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE); GRPC_MDELEM_UNREF(elem); elem = grpc_mdelem_from_strings("abc", "123"); - GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem)); + GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE); GRPC_MDELEM_UNREF(elem); elem = grpc_mdelem_from_strings("x", "1"); - GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem)); + GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE); GRPC_MDELEM_UNREF(elem); r = find_simple(&tbl, "abc", "123"); @@ -238,7 +238,7 @@ static void test_find(void) { for (i = 0; i < 10000; i++) { int64_ttoa(i, buffer); elem = grpc_mdelem_from_strings("test", buffer); - GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem)); + GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE); GRPC_MDELEM_UNREF(elem); } diff --git a/test/core/transport/connectivity_state_test.c b/test/core/transport/connectivity_state_test.c index 6bb7c3b06b..1050059eff 100644 --- a/test/core/transport/connectivity_state_test.c +++ b/test/core/transport/connectivity_state_test.c @@ -43,14 +43,15 @@ int g_counter; -static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - GPR_ASSERT(success); +static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(arg == THE_ARG); g_counter++; } -static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - GPR_ASSERT(!success); +static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { + GPR_ASSERT(error != GRPC_ERROR_NONE); GPR_ASSERT(arg == THE_ARG); g_counter++; } @@ -66,17 +67,19 @@ static void test_connectivity_state_name(void) { GPR_ASSERT( 0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_TRANSIENT_FAILURE), "TRANSIENT_FAILURE")); - GPR_ASSERT(0 == - strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_FATAL_FAILURE), - "FATAL_FAILURE")); + GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_SHUTDOWN), + "SHUTDOWN")); } static void test_check(void) { grpc_connectivity_state_tracker tracker; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_error *error; gpr_log(GPR_DEBUG, "test_check"); grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx"); - GPR_ASSERT(grpc_connectivity_state_check(&tracker) == GRPC_CHANNEL_IDLE); + GPR_ASSERT(grpc_connectivity_state_check(&tracker, &error) == + GRPC_CHANNEL_IDLE); + GPR_ASSERT(error == GRPC_ERROR_NONE); grpc_connectivity_state_destroy(&exec_ctx, &tracker); grpc_exec_ctx_finish(&exec_ctx); } @@ -119,26 +122,26 @@ static void test_subscribe_then_destroy(void) { GPR_ASSERT(g_counter == 0); grpc_connectivity_state_destroy(&exec_ctx, &tracker); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(state == GRPC_CHANNEL_FATAL_FAILURE); + GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN); GPR_ASSERT(g_counter == 1); } static void test_subscribe_with_failure_then_destroy(void) { grpc_connectivity_state_tracker tracker; grpc_closure *closure = grpc_closure_create(must_fail, THE_ARG); - grpc_connectivity_state state = GRPC_CHANNEL_FATAL_FAILURE; + grpc_connectivity_state state = GRPC_CHANNEL_SHUTDOWN; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; gpr_log(GPR_DEBUG, "test_subscribe_with_failure_then_destroy"); g_counter = 0; - grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_FATAL_FAILURE, "xxx"); + grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_SHUTDOWN, "xxx"); GPR_ASSERT(0 == grpc_connectivity_state_notify_on_state_change( &exec_ctx, &tracker, &state, closure)); grpc_exec_ctx_flush(&exec_ctx); - GPR_ASSERT(state == GRPC_CHANNEL_FATAL_FAILURE); + GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN); GPR_ASSERT(g_counter == 0); grpc_connectivity_state_destroy(&exec_ctx, &tracker); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(state == GRPC_CHANNEL_FATAL_FAILURE); + GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN); GPR_ASSERT(g_counter == 1); } diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c index a4e9694a93..007892930c 100644 --- a/test/core/transport/metadata_test.c +++ b/test/core/transport/metadata_test.c @@ -166,7 +166,7 @@ static void test_things_stick_around(void) { grpc_init(); for (i = 0; i < nstrs; i++) { - gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%dx", i); + gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%" PRIuPTR "x", i); strs[i] = grpc_mdstr_from_string(buffer); shuf[i] = i; gpr_free(buffer); @@ -188,7 +188,8 @@ static void test_things_stick_around(void) { for (i = 0; i < nstrs; i++) { GRPC_MDSTR_UNREF(strs[shuf[i]]); for (j = i + 1; j < nstrs; j++) { - gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%dx", shuf[j]); + gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%" PRIuPTR "x", + shuf[j]); test = grpc_mdstr_from_string(buffer); GPR_ASSERT(test == strs[shuf[j]]); GRPC_MDSTR_UNREF(test); diff --git a/test/core/util/mock_endpoint.c b/test/core/util/mock_endpoint.c index 7768413095..ed9545e9df 100644 --- a/test/core/util/mock_endpoint.c +++ b/test/core/util/mock_endpoint.c @@ -51,7 +51,7 @@ static void me_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, gpr_mu_lock(&m->mu); if (m->read_buffer.count > 0) { gpr_slice_buffer_swap(&m->read_buffer, slices); - grpc_exec_ctx_enqueue(exec_ctx, cb, true, NULL); + grpc_exec_ctx_sched(exec_ctx, cb, GRPC_ERROR_NONE, NULL); } else { m->on_read = cb; m->on_read_out = slices; @@ -65,7 +65,7 @@ static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, for (size_t i = 0; i < slices->count; i++) { m->on_write(slices->slices[i]); } - grpc_exec_ctx_enqueue(exec_ctx, cb, true, NULL); + grpc_exec_ctx_sched(exec_ctx, cb, GRPC_ERROR_NONE, NULL); } static void me_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, @@ -78,7 +78,8 @@ static void me_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) { grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep; gpr_mu_lock(&m->mu); if (m->on_read) { - grpc_exec_ctx_enqueue(exec_ctx, m->on_read, false, NULL); + grpc_exec_ctx_sched(exec_ctx, m->on_read, + GRPC_ERROR_CREATE("Endpoint Shutdown"), NULL); m->on_read = NULL; } gpr_mu_unlock(&m->mu); @@ -115,7 +116,7 @@ void grpc_mock_endpoint_put_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, gpr_mu_lock(&m->mu); if (m->on_read != NULL) { gpr_slice_buffer_add(m->on_read_out, slice); - grpc_exec_ctx_enqueue(exec_ctx, m->on_read, true, NULL); + grpc_exec_ctx_sched(exec_ctx, m->on_read, GRPC_ERROR_NONE, NULL); m->on_read = NULL; } else { gpr_slice_buffer_add(&m->read_buffer, slice); diff --git a/test/core/util/one_corpus_entry_fuzzer.c b/test/core/util/one_corpus_entry_fuzzer.c index 41f9558211..95ae4cf706 100644 --- a/test/core/util/one_corpus_entry_fuzzer.c +++ b/test/core/util/one_corpus_entry_fuzzer.c @@ -31,15 +31,22 @@ * */ +#include <stdbool.h> + #include <grpc/support/log.h> -#include "src/core/lib/support/load_file.h" +#include "src/core/lib/iomgr/load_file.h" extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); +extern bool squelch; +extern bool leak_check; + int main(int argc, char **argv) { - int ok = 0; - gpr_slice buffer = gpr_load_file(argv[1], 0, &ok); - GPR_ASSERT(ok); + gpr_slice buffer; + squelch = false; + leak_check = false; + GPR_ASSERT( + GRPC_LOG_IF_ERROR("load_file", grpc_load_file(argv[1], 0, &buffer))); LLVMFuzzerTestOneInput(GPR_SLICE_START_PTR(buffer), GPR_SLICE_LENGTH(buffer)); gpr_slice_unref(buffer); return 0; diff --git a/test/core/util/passthru_endpoint.c b/test/core/util/passthru_endpoint.c index ae955b1f68..a39f3dd66e 100644 --- a/test/core/util/passthru_endpoint.c +++ b/test/core/util/passthru_endpoint.c @@ -59,10 +59,11 @@ static void me_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, half *m = (half *)ep; gpr_mu_lock(&m->parent->mu); if (m->parent->shutdown) { - grpc_exec_ctx_enqueue(exec_ctx, cb, false, NULL); + grpc_exec_ctx_sched(exec_ctx, cb, GRPC_ERROR_CREATE("Already shutdown"), + NULL); } else if (m->read_buffer.count > 0) { gpr_slice_buffer_swap(&m->read_buffer, slices); - grpc_exec_ctx_enqueue(exec_ctx, cb, true, NULL); + grpc_exec_ctx_sched(exec_ctx, cb, GRPC_ERROR_NONE, NULL); } else { m->on_read = cb; m->on_read_out = slices; @@ -79,14 +80,14 @@ static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, gpr_slice_buffer *slices, grpc_closure *cb) { half *m = other_half((half *)ep); gpr_mu_lock(&m->parent->mu); - bool ok = true; + grpc_error *error = GRPC_ERROR_NONE; if (m->parent->shutdown) { - ok = false; + error = GRPC_ERROR_CREATE("Endpoint already shutdown"); } else if (m->on_read != NULL) { for (size_t i = 0; i < slices->count; i++) { gpr_slice_buffer_add(m->on_read_out, gpr_slice_ref(slices->slices[i])); } - grpc_exec_ctx_enqueue(exec_ctx, m->on_read, true, NULL); + grpc_exec_ctx_sched(exec_ctx, m->on_read, GRPC_ERROR_NONE, NULL); m->on_read = NULL; } else { for (size_t i = 0; i < slices->count; i++) { @@ -94,7 +95,7 @@ static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, } } gpr_mu_unlock(&m->parent->mu); - grpc_exec_ctx_enqueue(exec_ctx, cb, ok, NULL); + grpc_exec_ctx_sched(exec_ctx, cb, error, NULL); } static void me_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, @@ -108,12 +109,14 @@ static void me_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) { gpr_mu_lock(&m->parent->mu); m->parent->shutdown = true; if (m->on_read) { - grpc_exec_ctx_enqueue(exec_ctx, m->on_read, false, NULL); + grpc_exec_ctx_sched(exec_ctx, m->on_read, GRPC_ERROR_CREATE("Shutdown"), + NULL); m->on_read = NULL; } m = other_half(m); if (m->on_read) { - grpc_exec_ctx_enqueue(exec_ctx, m->on_read, false, NULL); + grpc_exec_ctx_sched(exec_ctx, m->on_read, GRPC_ERROR_CREATE("Shutdown"), + NULL); m->on_read = NULL; } gpr_mu_unlock(&m->parent->mu); diff --git a/test/core/util/port_server_client.c b/test/core/util/port_server_client.c index 84e90547aa..a5c8c49650 100644 --- a/test/core/util/port_server_client.c +++ b/test/core/util/port_server_client.c @@ -51,29 +51,33 @@ typedef struct freereq { gpr_mu *mu; - grpc_pollset *pollset; + grpc_polling_entity pops; int done; } freereq; -static void destroy_pollset_and_shutdown(grpc_exec_ctx *exec_ctx, void *p, - bool success) { - grpc_pollset_destroy(p); - gpr_free(p); +static void destroy_pops_and_shutdown(grpc_exec_ctx *exec_ctx, void *p, + grpc_error *error) { + grpc_pollset *pollset = grpc_polling_entity_pollset(p); + grpc_pollset_destroy(pollset); + gpr_free(pollset); grpc_shutdown(); } static void freed_port_from_server(grpc_exec_ctx *exec_ctx, void *arg, - const grpc_httpcli_response *response) { + grpc_error *error) { freereq *pr = arg; gpr_mu_lock(pr->mu); pr->done = 1; - grpc_pollset_kick(pr->pollset, NULL); + GRPC_LOG_IF_ERROR( + "pollset_kick", + grpc_pollset_kick(grpc_polling_entity_pollset(&pr->pops), NULL)); gpr_mu_unlock(pr->mu); } void grpc_free_port_using_server(char *server, int port) { grpc_httpcli_context context; grpc_httpcli_request req; + grpc_httpcli_response rsp; freereq pr; char *path; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -83,56 +87,66 @@ void grpc_free_port_using_server(char *server, int port) { memset(&pr, 0, sizeof(pr)); memset(&req, 0, sizeof(req)); + memset(&rsp, 0, sizeof(rsp)); - pr.pollset = gpr_malloc(grpc_pollset_size()); - grpc_pollset_init(pr.pollset, &pr.mu); - shutdown_closure = - grpc_closure_create(destroy_pollset_and_shutdown, pr.pollset); + grpc_pollset *pollset = gpr_malloc(grpc_pollset_size()); + grpc_pollset_init(pollset, &pr.mu); + pr.pops = grpc_polling_entity_create_from_pollset(pollset); + shutdown_closure = grpc_closure_create(destroy_pops_and_shutdown, &pr.pops); req.host = server; gpr_asprintf(&path, "/drop/%d", port); req.http.path = path; grpc_httpcli_context_init(&context); - grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), freed_port_from_server, - &pr); + grpc_httpcli_get(&exec_ctx, &context, &pr.pops, &req, + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), + grpc_closure_create(freed_port_from_server, &pr), &rsp); gpr_mu_lock(pr.mu); while (!pr.done) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, pr.pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)); + if (!GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&pr.pops), + &worker, gpr_now(GPR_CLOCK_MONOTONIC), + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)))) { + pr.done = 1; + } } gpr_mu_unlock(pr.mu); grpc_httpcli_context_destroy(&context); grpc_exec_ctx_finish(&exec_ctx); - grpc_pollset_shutdown(&exec_ctx, pr.pollset, shutdown_closure); + grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&pr.pops), + shutdown_closure); grpc_exec_ctx_finish(&exec_ctx); gpr_free(path); + grpc_http_response_destroy(&rsp); } typedef struct portreq { gpr_mu *mu; - grpc_pollset *pollset; + grpc_polling_entity pops; int port; int retries; char *server; grpc_httpcli_context *ctx; + grpc_httpcli_response response; } portreq; static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg, - const grpc_httpcli_response *response) { + grpc_error *error) { size_t i; int port = 0; portreq *pr = arg; int failed = 0; + grpc_httpcli_response *response = &pr->response; - if (!response) { + if (error != GRPC_ERROR_NONE) { failed = 1; - gpr_log(GPR_DEBUG, - "failed port pick from server: retrying [response=NULL]"); + const char *msg = grpc_error_string(error); + gpr_log(GPR_DEBUG, "failed port pick from server: retrying [%s]", msg); + grpc_error_free_string(msg); } else if (response->status != 200) { failed = 1; gpr_log(GPR_DEBUG, "failed port pick from server: status=%d", @@ -151,9 +165,12 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg, pr->retries++; req.host = pr->server; req.http.path = "/get"; - grpc_httpcli_get(exec_ctx, pr->ctx, pr->pollset, &req, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server, - pr); + grpc_http_response_destroy(&pr->response); + memset(&pr->response, 0, sizeof(pr->response)); + grpc_httpcli_get(exec_ctx, pr->ctx, &pr->pops, &req, + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), + grpc_closure_create(got_port_from_server, pr), + &pr->response); return; } GPR_ASSERT(response); @@ -165,7 +182,9 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg, GPR_ASSERT(port > 1024); gpr_mu_lock(pr->mu); pr->port = port; - grpc_pollset_kick(pr->pollset, NULL); + GRPC_LOG_IF_ERROR( + "pollset_kick", + grpc_pollset_kick(grpc_polling_entity_pollset(&pr->pops), NULL)); gpr_mu_unlock(pr->mu); } @@ -180,10 +199,10 @@ int grpc_pick_port_using_server(char *server) { memset(&pr, 0, sizeof(pr)); memset(&req, 0, sizeof(req)); - pr.pollset = gpr_malloc(grpc_pollset_size()); - grpc_pollset_init(pr.pollset, &pr.mu); - shutdown_closure = - grpc_closure_create(destroy_pollset_and_shutdown, pr.pollset); + grpc_pollset *pollset = gpr_malloc(grpc_pollset_size()); + grpc_pollset_init(pollset, &pr.mu); + pr.pops = grpc_polling_entity_create_from_pollset(pollset); + shutdown_closure = grpc_closure_create(destroy_pops_and_shutdown, &pr.pops); pr.port = -1; pr.server = server; pr.ctx = &context; @@ -192,21 +211,27 @@ int grpc_pick_port_using_server(char *server) { req.http.path = "/get"; grpc_httpcli_context_init(&context); - grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server, - &pr); + grpc_httpcli_get( + &exec_ctx, &context, &pr.pops, &req, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), + grpc_closure_create(got_port_from_server, &pr), &pr.response); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_lock(pr.mu); while (pr.port == -1) { grpc_pollset_worker *worker = NULL; - grpc_pollset_work(&exec_ctx, pr.pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)); + if (!GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&pr.pops), + &worker, gpr_now(GPR_CLOCK_MONOTONIC), + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)))) { + pr.port = 0; + } } gpr_mu_unlock(pr.mu); + grpc_http_response_destroy(&pr.response); grpc_httpcli_context_destroy(&context); - grpc_pollset_shutdown(&exec_ctx, pr.pollset, shutdown_closure); + grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&pr.pops), + shutdown_closure); grpc_exec_ctx_finish(&exec_ctx); return pr.port; diff --git a/test/core/util/test_tcp_server.c b/test/core/util/test_tcp_server.c index e39a95712c..27c16fc764 100644 --- a/test/core/util/test_tcp_server.c +++ b/test/core/util/test_tcp_server.c @@ -46,7 +46,7 @@ #include "test/core/util/port.h" static void on_server_destroyed(grpc_exec_ctx *exec_ctx, void *data, - bool success) { + grpc_error *error) { test_tcp_server *server = data; server->shutdown = 1; } @@ -72,9 +72,12 @@ void test_tcp_server_start(test_tcp_server *server, int port) { addr.sin_port = htons((uint16_t)port); memset(&addr.sin_addr, 0, sizeof(addr.sin_addr)); - server->tcp_server = grpc_tcp_server_create(&server->shutdown_complete); - port_added = - grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr)); + grpc_error *error = + grpc_tcp_server_create(&server->shutdown_complete, &server->tcp_server); + GPR_ASSERT(error == GRPC_ERROR_NONE); + error = grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr), + &port_added); + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(port_added == port); grpc_tcp_server_start(&exec_ctx, server->tcp_server, &server->pollset, 1, @@ -91,13 +94,14 @@ void test_tcp_server_poll(test_tcp_server *server, int seconds) { gpr_time_from_seconds(seconds, GPR_TIMESPAN)); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; gpr_mu_lock(server->mu); - grpc_pollset_work(&exec_ctx, server->pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), deadline); + GRPC_LOG_IF_ERROR("pollset_work", + grpc_pollset_work(&exec_ctx, server->pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), deadline)); gpr_mu_unlock(server->mu); grpc_exec_ctx_finish(&exec_ctx); } -static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, bool success) {} +static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {} void test_tcp_server_destroy(test_tcp_server *server) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; |