diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.c index 357b182fcae..f2038d7cbcf 100644 --- a/test/core/end2end/tests/binary_metadata.c +++ b/test/core/end2end/tests/binary_metadata.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -149,7 +147,7 @@ static void test_request_response_with_metadata_and_payload( int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -290,7 +288,6 @@ static void test_request_response_with_metadata_and_payload( } void binary_metadata(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_request_response_with_metadata_and_payload(config); } diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c index ae3c3e7795c..027c5fdfd5c 100644 --- a/test/core/end2end/tests/call_creds.c +++ b/test/core/end2end/tests/call_creds.c @@ -51,8 +51,6 @@ static const char iam_selector[] = "selector"; static const char overridden_iam_token[] = "overridden_token"; static const char overridden_iam_selector[] = "overridden_selector"; -static const char *authority; - typedef enum { NONE, OVERRIDE, DESTROY } override_mode; static void *tag(intptr_t t) { return (void *)t; } @@ -167,7 +165,7 @@ static void request_response_with_payload_and_call_creds( cqv = cq_verifier_create(f.cq); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); creds = grpc_google_iam_credentials_create(iam_token, iam_selector, NULL); GPR_ASSERT(creds != NULL); @@ -402,7 +400,7 @@ static void test_request_with_server_rejecting_client_creds( cqv = cq_verifier_create(f.cq); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); creds = grpc_google_iam_credentials_create(iam_token, iam_selector, NULL); @@ -475,7 +473,6 @@ static void test_request_with_server_rejecting_client_creds( void call_creds(grpc_end2end_test_config config) { if (config.feature_mask & FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS) { - authority = get_host_override_string("foo.test.google.fr", config); test_request_response_with_payload_and_call_creds(config); test_request_response_with_payload_and_overridden_call_creds(config); test_request_response_with_payload_and_deleted_call_creds(config); diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index 238e603633b..010ad088129 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -44,8 +44,6 @@ #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/tests/cancel_test_helpers.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -128,7 +126,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -231,7 +229,6 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, void cancel_after_accept(grpc_end2end_test_config config) { unsigned i; - authority = get_host_override_string("foo.test.google.fr", config); for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) { test_cancel_after_accept(config, cancellation_modes[i]); } diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.c index 91b2589441b..7644658b199 100644 --- a/test/core/end2end/tests/cancel_after_client_done.c +++ b/test/core/end2end/tests/cancel_after_client_done.c @@ -44,8 +44,6 @@ #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/tests/cancel_test_helpers.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -128,7 +126,7 @@ static void test_cancel_after_accept_and_writes_closed( int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -235,7 +233,6 @@ static void test_cancel_after_accept_and_writes_closed( void cancel_after_client_done(grpc_end2end_test_config config) { unsigned i; - authority = get_host_override_string("foo.test.google.fr", config); for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) { test_cancel_after_accept_and_writes_closed(config, cancellation_modes[i]); } diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index b10a8756d4c..1628f0d5602 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -44,8 +44,6 @@ #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/tests/cancel_test_helpers.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -123,7 +121,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, grpc_raw_byte_buffer_create(&request_payload_slice, 1); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -194,7 +192,6 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, void cancel_after_invoke(grpc_end2end_test_config config) { unsigned i, j; - authority = get_host_override_string("foo.test.google.fr", config); for (j = 2; j < 6; j++) { for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) { test_cancel_after_invoke(config, cancellation_modes[i], j); diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index e97ddd63cac..7e1d4ca1fb1 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -121,7 +119,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, grpc_raw_byte_buffer_create(&request_payload_slice, 1); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c, NULL)); @@ -191,7 +189,6 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, void cancel_before_invoke(grpc_end2end_test_config config) { size_t i; - authority = get_host_override_string("foo.test.google.fr", config); for (i = 1; i <= 6; i++) { test_cancel_before_invoke(config, i); } diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c index f78d4cc891a..780d693ac55 100644 --- a/test/core/end2end/tests/cancel_in_a_vacuum.c +++ b/test/core/end2end/tests/cancel_in_a_vacuum.c @@ -44,8 +44,6 @@ #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/tests/cancel_test_helpers.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -108,7 +106,7 @@ static void test_cancel_in_a_vacuum(grpc_end2end_test_config config, cq_verifier *v_client = cq_verifier_create(f.cq); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL)); @@ -123,7 +121,6 @@ static void test_cancel_in_a_vacuum(grpc_end2end_test_config config, void cancel_in_a_vacuum(grpc_end2end_test_config config) { unsigned i; - authority = get_host_override_string("foo.test.google.fr", config); for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) { test_cancel_in_a_vacuum(config, cancellation_modes[i]); } diff --git a/test/core/end2end/tests/cancel_with_status.c b/test/core/end2end/tests/cancel_with_status.c index ebd7cb216fa..15de1eaaf75 100644 --- a/test/core/end2end/tests/cancel_with_status.c +++ b/test/core/end2end/tests/cancel_with_status.c @@ -45,8 +45,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -99,7 +97,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) { +static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f, size_t num_ops) { grpc_call *c; gpr_timespec deadline = five_seconds_time(); cq_verifier *cqv = cq_verifier_create(f.cq); @@ -115,7 +113,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t 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", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -171,14 +169,13 @@ static void test_invoke_simple_request(grpc_end2end_test_config config, grpc_end2end_test_fixture f; f = begin_test(config, "test_invoke_simple_request", NULL, NULL); - simple_request_body(f, num_ops); + simple_request_body(config, f, num_ops); end_test(&f); config.tear_down_data(&f); } void cancel_with_status(grpc_end2end_test_config config) { size_t i; - authority = get_host_override_string("foo.test.google.fr:1234", config); for (i = 1; i <= 4; i++) { test_invoke_simple_request(config, i); } diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c index 4607940e6c3..5925ce7b81a 100644 --- a/test/core/end2end/tests/compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.c @@ -50,8 +50,6 @@ #include "src/core/lib/surface/call_test_only.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -149,7 +147,7 @@ static void request_for_disabled_algorithm( cqv = cq_verifier_create(f.cq); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -323,7 +321,7 @@ static void request_with_payload_template( cqv = cq_verifier_create(f.cq); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -600,7 +598,6 @@ static void test_invoke_request_with_disabled_algorithm( } void compressed_payload(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_invoke_request_with_exceptionally_uncompressed_payload(config); test_invoke_request_with_uncompressed_payload(config); test_invoke_request_with_compressed_payload(config); diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c index a934a9e5fe1..6b32b36d2ca 100644 --- a/test/core/end2end/tests/disappearing_server.c +++ b/test/core/end2end/tests/disappearing_server.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static gpr_timespec n_seconds_time(int n) { @@ -81,7 +79,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f, +static void do_request_and_shutdown_server(grpc_end2end_test_config config, + grpc_end2end_test_fixture *f, cq_verifier *cqv) { grpc_call *c; grpc_call *s; @@ -99,7 +98,7 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f, int was_cancelled = 2; c = grpc_channel_create_call(f->client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -199,12 +198,12 @@ static void disappearing_server_test(grpc_end2end_test_config config) { config.init_client(&f, NULL); config.init_server(&f, NULL); - do_request_and_shutdown_server(&f, cqv); + do_request_and_shutdown_server(config, &f, cqv); /* now destroy and recreate the server */ config.init_server(&f, NULL); - do_request_and_shutdown_server(&f, cqv); + do_request_and_shutdown_server(config, &f, cqv); cq_verifier_destroy(cqv); @@ -213,7 +212,6 @@ static void disappearing_server_test(grpc_end2end_test_config config) { } void disappearing_server(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr:1234", config); GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION); disappearing_server_test(config); } diff --git a/test/core/end2end/tests/empty_batch.c b/test/core/end2end/tests/empty_batch.c index 146f83b0808..580cbac67d4 100644 --- a/test/core/end2end/tests/empty_batch.c +++ b/test/core/end2end/tests/empty_batch.c @@ -45,8 +45,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -99,7 +97,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void empty_batch_body(grpc_end2end_test_fixture f) { +static void empty_batch_body(grpc_end2end_test_config config, + grpc_end2end_test_fixture f) { grpc_call *c; gpr_timespec deadline = five_seconds_time(); cq_verifier *cqv = cq_verifier_create(f.cq); @@ -107,7 +106,7 @@ static void empty_batch_body(grpc_end2end_test_fixture f) { grpc_op *op = NULL; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); error = grpc_call_start_batch(c, op, 0, tag(1), NULL); @@ -124,13 +123,12 @@ static void test_invoke_empty_body(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; f = begin_test(config, "test_invoke_empty_body", NULL, NULL); - empty_batch_body(f); + empty_batch_body(config, f); end_test(&f); config.tear_down_data(&f); } void empty_batch(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_invoke_empty_body(config); } diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c index 892e92e7642..4255e758147 100644 --- a/test/core/end2end/tests/filter_call_init_fails.c +++ b/test/core/end2end/tests/filter_call_init_fails.c @@ -49,8 +49,6 @@ enum { TIMEOUT = 200000 }; -static const char *authority; - static bool g_enable_filter = false; static void *tag(intptr_t t) { return (void *)t; } @@ -130,7 +128,7 @@ static void test_request(grpc_end2end_test_config config) { size_t details_capacity = 0; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -265,7 +263,6 @@ static void init_plugin(void) { static void destroy_plugin(void) {} void filter_call_init_fails(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); g_enable_filter = true; test_request(config); g_enable_filter = false; diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index 163dbf87f0c..210c464cf11 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -46,8 +46,6 @@ #include "src/core/lib/surface/channel_init.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static bool g_enable_filter = false; static void *tag(intptr_t t) { return (void *)t; } @@ -126,7 +124,7 @@ static void test_request(grpc_end2end_test_config config) { size_t details_capacity = 0; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -284,7 +282,6 @@ static void init_plugin(void) { static void destroy_plugin(void) {} void filter_causes_close(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); g_enable_filter = true; test_request(config); g_enable_filter = false; diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c index 5204c90b277..45892b8824f 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -114,7 +112,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -212,7 +210,6 @@ static void test_early_server_shutdown_finishes_inflight_calls( } void graceful_server_shutdown(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_early_server_shutdown_finishes_inflight_calls(config); } diff --git a/test/core/end2end/tests/high_initial_seqno.c b/test/core/end2end/tests/high_initial_seqno.c index b9cfbd8b715..96d58d47877 100644 --- a/test/core/end2end/tests/high_initial_seqno.c +++ b/test/core/end2end/tests/high_initial_seqno.c @@ -47,8 +47,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -101,7 +99,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void simple_request_body(grpc_end2end_test_fixture f) { +static void simple_request_body(grpc_end2end_test_config config, + grpc_end2end_test_fixture f) { grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); @@ -119,7 +118,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -232,7 +231,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config, initial_sequence_number); f = begin_test(config, name, &client_args, NULL); for (i = 0; i < 10; i++) { - simple_request_body(f); + simple_request_body(config, f); gpr_log(GPR_INFO, "Passed simple request %d", i); } end_test(&f); @@ -241,7 +240,6 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config, } void high_initial_seqno(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr:1234", config); test_invoke_10_simple_requests(config, 16777213); if (config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION) { test_invoke_10_simple_requests(config, 2147483645); diff --git a/test/core/end2end/tests/hpack_size.c b/test/core/end2end/tests/hpack_size.c index 5b23d6b1e73..c400134e1fe 100644 --- a/test/core/end2end/tests/hpack_size.c +++ b/test/core/end2end/tests/hpack_size.c @@ -47,8 +47,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } const char *hobbits[][2] = { @@ -241,7 +239,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void simple_request_body(grpc_end2end_test_fixture f, size_t index) { +static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f, size_t index) { grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); @@ -271,7 +269,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t index) { extra_metadata[2].value_length = strlen(extra_metadata[2].value); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -386,7 +384,7 @@ static void test_size(grpc_end2end_test_config config, int encode_size, f = begin_test(config, name, encode_size != 4096 ? &client_args : NULL, decode_size != 4096 ? &server_args : NULL); for (i = 0; i < 4 * GPR_ARRAY_SIZE(hobbits); i++) { - simple_request_body(f, i); + simple_request_body(config, f, i); } end_test(&f); config.tear_down_data(&f); @@ -398,7 +396,6 @@ void hpack_size(grpc_end2end_test_config config) { 1000, 32768, 4 * 1024 * 1024}; size_t i, j; - authority = get_host_override_string("foo.test.google.fr:1234", config); for (i = 0; i < GPR_ARRAY_SIZE(interesting_sizes); i++) { for (j = 0; j < GPR_ARRAY_SIZE(interesting_sizes); j++) { test_size(config, interesting_sizes[i], interesting_sizes[j]); diff --git a/test/core/end2end/tests/idempotent_request.c b/test/core/end2end/tests/idempotent_request.c index 5b02e4410a3..bbde35b5df6 100644 --- a/test/core/end2end/tests/idempotent_request.c +++ b/test/core/end2end/tests/idempotent_request.c @@ -45,8 +45,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -99,7 +97,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void simple_request_body(grpc_end2end_test_fixture f) { +static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); @@ -118,7 +116,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { char *peer; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); peer = grpc_call_get_peer(c); @@ -225,7 +223,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; f = begin_test(config, "test_invoke_simple_request", NULL, NULL); - simple_request_body(f); + simple_request_body(config, f); end_test(&f); config.tear_down_data(&f); } @@ -235,7 +233,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_simple_requests", NULL, NULL); for (i = 0; i < 10; i++) { - simple_request_body(f); + simple_request_body(config, f); gpr_log(GPR_INFO, "Passed simple request %d", i); } end_test(&f); @@ -244,7 +242,6 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { void idempotent_request(grpc_end2end_test_config config) { int i; - authority = get_host_override_string("foo.test.google.fr:1234", config); for (i = 0; i < 10; i++) { test_invoke_simple_request(config); } diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c index c55bac48301..67dc2c8f0a4 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.c @@ -44,8 +44,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -147,7 +145,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config, int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -274,7 +272,6 @@ static void test_invoke_large_request(grpc_end2end_test_config config, } void invoke_large_request(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_invoke_large_request(config, 16384, 65536); test_invoke_large_request(config, 32768, 65536); diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index b19b6f8b800..618e8497702 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -128,7 +126,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); meta.key = "key"; @@ -257,7 +255,6 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { } void large_metadata(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_request_with_large_metadata(config); } diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index 1f353ce7c91..652eedf7179 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -48,8 +48,6 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/transport/static_metadata.h" -static const char *authority; - enum { TIMEOUT = 200000 }; static void *tag(intptr_t t) { return (void *)t; } @@ -123,7 +121,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void request_response_with_payload(grpc_end2end_test_fixture f, +static void request_response_with_payload(grpc_end2end_test_config config, + grpc_end2end_test_fixture f, const char *method_name, const char *request_msg, const char *response_msg, @@ -154,7 +153,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f, int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - method_name, authority, deadline, NULL); + method_name, get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -308,15 +307,13 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) { memset(&trailing_lr_metadata.internal_data, 0, sizeof(trailing_lr_metadata.internal_data)); - request_response_with_payload(f, method_name, request_msg, response_msg, - &initial_lr_metadata, &trailing_lr_metadata); + request_response_with_payload(config, f, method_name, request_msg, response_msg, &initial_lr_metadata, &trailing_lr_metadata); end_test(&f); grpc_channel_args_destroy(lr_server_args); config.tear_down_data(&f); } void load_reporting_hook(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_load_reporting_hook(config); } diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index 707be0950af..78c0237a66c 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -97,7 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void simple_request_body(grpc_end2end_test_fixture f) { +static void simple_request_body(grpc_end2end_test_config config, + grpc_end2end_test_fixture f) { grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); @@ -115,7 +114,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -253,18 +252,18 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { /* perform a ping-pong to ensure that settings have had a chance to round trip */ - simple_request_body(f); + simple_request_body(config, f); /* perform another one to make sure that the one stream case still works */ - simple_request_body(f); + simple_request_body(config, f); /* start two requests - ensuring that the second is not accepted until the first completes */ deadline = n_seconds_time(1000); c1 = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/alpha", authority, deadline, NULL); + "/alpha", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c1); c2 = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/beta", authority, deadline, NULL); + "/beta", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c2); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( @@ -441,7 +440,6 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { } void max_concurrent_streams(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr:1234", config); test_max_concurrent_streams(config); } diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index 62e4cb35db8..c98f52fed87 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -143,7 +141,7 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, cqv = cq_verifier_create(f.cq); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, + "/foo", get_host_override_string("foo.test.google.fr:1234", config), gpr_inf_future(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(c); @@ -397,7 +395,6 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, } void max_message_length(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr:1234", config); test_max_message_length_on_request(config, false /* send_limit */); test_max_message_length_on_request(config, true /* send_limit */); test_max_message_length_on_response(config, false /* send_limit */); diff --git a/test/core/end2end/tests/negative_deadline.c b/test/core/end2end/tests/negative_deadline.c index a715c434bd9..62490608fb2 100644 --- a/test/core/end2end/tests/negative_deadline.c +++ b/test/core/end2end/tests/negative_deadline.c @@ -45,8 +45,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -99,7 +97,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) { +static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f, size_t num_ops) { grpc_call *c; gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_REALTIME); cq_verifier *cqv = cq_verifier_create(f.cq); @@ -115,7 +113,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t 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", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -168,14 +166,13 @@ static void test_invoke_simple_request(grpc_end2end_test_config config, grpc_end2end_test_fixture f; f = begin_test(config, "test_invoke_simple_request", NULL, NULL); - simple_request_body(f, num_ops); + simple_request_body(config, f, num_ops); end_test(&f); config.tear_down_data(&f); } void negative_deadline(grpc_end2end_test_config config) { size_t i; - authority = get_host_override_string("foo.test.google.fr:1234", config); for (i = 1; i <= 4; i++) { test_invoke_simple_request(config, i); } diff --git a/test/core/end2end/tests/network_status_change.c b/test/core/end2end/tests/network_status_change.c index b55bebbf0f3..bf02e6a9fc5 100644 --- a/test/core/end2end/tests/network_status_change.c +++ b/test/core/end2end/tests/network_status_change.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - /* this is a private API but exposed here for testing*/ extern void grpc_network_status_shutdown_all_endpoints(); @@ -125,7 +123,7 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) { int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -238,7 +236,6 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) { } void network_status_change(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_invoke_network_status_change(config); } diff --git a/test/core/end2end/tests/no_logging.c b/test/core/end2end/tests/no_logging.c index e299abe5997..99f2b466867 100644 --- a/test/core/end2end/tests/no_logging.c +++ b/test/core/end2end/tests/no_logging.c @@ -47,8 +47,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - enum { TIMEOUT = 200000 }; static void *tag(intptr_t t) { return (void *)t; } @@ -127,7 +125,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void simple_request_body(grpc_end2end_test_fixture f) { +static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); @@ -146,7 +144,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { char *peer; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); peer = grpc_call_get_peer(c); @@ -251,7 +249,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) { f = begin_test(config, "test_invoke_simple_request_with_no_error_logging", NULL, NULL); - simple_request_body(f); + simple_request_body(config, f); end_test(&f); config.tear_down_data(&f); } @@ -262,10 +260,10 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { begin_test(config, "test_invoke_10_simple_requests_with_no_error_logging", NULL, NULL); for (i = 0; i < 10; i++) { - simple_request_body(f); + simple_request_body(config, f); gpr_log(GPR_INFO, "Passed simple request %d", i); } - simple_request_body(f); + simple_request_body(config, f); end_test(&f); config.tear_down_data(&f); } @@ -286,17 +284,16 @@ static void test_no_logging_in_one_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test(config, "test_no_logging_in_last_request", NULL, NULL); for (i = 0; i < 10; i++) { - simple_request_body(f); + simple_request_body(config, f); } gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)test_no_log); - simple_request_body(f); + simple_request_body(config, f); gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)gpr_default_log); end_test(&f); config.tear_down_data(&f); } void no_logging(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr:1234", config); gpr_set_log_function(log_dispatcher_func); test_no_logging_in_one_request(config); test_no_error_logging_in_entire_process(config); diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c index 9d593617edf..96a565db5a1 100644 --- a/test/core/end2end/tests/payload.c +++ b/test/core/end2end/tests/payload.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -97,7 +95,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void request_response_with_payload(grpc_end2end_test_fixture f) { +static void request_response_with_payload(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world"); gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you"); grpc_call *c; @@ -123,7 +121,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -252,7 +250,7 @@ static void test_invoke_request_response_with_payload( grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test( config, "test_invoke_request_response_with_payload", NULL, NULL); - request_response_with_payload(f); + request_response_with_payload(config, f); end_test(&f); config.tear_down_data(&f); } @@ -263,14 +261,13 @@ static void test_invoke_10_request_response_with_payload( grpc_end2end_test_fixture f = begin_test( config, "test_invoke_10_request_response_with_payload", NULL, NULL); for (i = 0; i < 10; i++) { - request_response_with_payload(f); + request_response_with_payload(config, f); } end_test(&f); config.tear_down_data(&f); } void payload(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_invoke_request_response_with_payload(config); test_invoke_10_request_response_with_payload(config); } diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index f53a2888905..a33ce5f8621 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -126,7 +124,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you"); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -277,7 +275,6 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, void ping_pong_streaming(grpc_end2end_test_config config) { int i; - authority = get_host_override_string("foo.test.google.fr:1234", config); for (i = 1; i < 10; i++) { test_pingpong_streaming(config, i); } diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c index fd1557a5d90..05582f96826 100644 --- a/test/core/end2end/tests/registered_call.c +++ b/test/core/end2end/tests/registered_call.c @@ -45,8 +45,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -208,7 +206,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) { static void test_invoke_simple_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test(config, "test_invoke_simple_request", NULL, NULL); - void *rc = grpc_channel_register_call(f.client, "/foo", authority, NULL); + void *rc = grpc_channel_register_call(f.client, "/foo", get_host_override_string("foo.test.google.fr:1234", config), NULL); simple_request_body(f, rc); end_test(&f); @@ -219,7 +217,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { int i; grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_simple_requests", NULL, NULL); - void *rc = grpc_channel_register_call(f.client, "/foo", authority, NULL); + void *rc = grpc_channel_register_call(f.client, "/foo", get_host_override_string("foo.test.google.fr:1234", config), NULL); for (i = 0; i < 10; i++) { simple_request_body(f, rc); @@ -230,7 +228,6 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { } void registered_call(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr:1234", config); test_invoke_simple_request(config); test_invoke_10_simple_requests(config); } diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c index 1ef0dbeb3fd..c8489fb8c77 100644 --- a/test/core/end2end/tests/request_with_flags.c +++ b/test/core/end2end/tests/request_with_flags.c @@ -44,8 +44,6 @@ #include "src/core/lib/transport/byte_stream.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -123,7 +121,7 @@ static void test_invoke_request_with_flags( grpc_call_error expectation; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -188,7 +186,6 @@ static void test_invoke_request_with_flags( void request_with_flags(grpc_end2end_test_config config) { size_t i; - authority = get_host_override_string("foo.test.google.fr", config); uint32_t flags_for_op[GRPC_OP_RECV_CLOSE_ON_SERVER + 1]; { diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index 9cbe9869f89..5755d20fe5b 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -122,7 +120,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -235,7 +233,6 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { } void request_with_payload(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_invoke_request_with_payload(config); } diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c index a85e9d425b7..313b0c3324f 100644 --- a/test/core/end2end/tests/server_finishes_request.c +++ b/test/core/end2end/tests/server_finishes_request.c @@ -45,8 +45,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -99,7 +97,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void simple_request_body(grpc_end2end_test_fixture f) { +static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); @@ -117,7 +115,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -205,13 +203,12 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; f = begin_test(config, "test_invoke_simple_request", NULL, NULL); - simple_request_body(f); + simple_request_body(config, f); end_test(&f); config.tear_down_data(&f); } void server_finishes_request(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr:1234", config); test_invoke_simple_request(config); } diff --git a/test/core/end2end/tests/shutdown_finishes_calls.c b/test/core/end2end/tests/shutdown_finishes_calls.c index 62fe068fa9e..26d61f2dcfd 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.c +++ b/test/core/end2end/tests/shutdown_finishes_calls.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -107,7 +105,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -194,7 +192,6 @@ static void test_early_server_shutdown_finishes_inflight_calls( } void shutdown_finishes_calls(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_early_server_shutdown_finishes_inflight_calls(config); } diff --git a/test/core/end2end/tests/simple_cacheable_request.c b/test/core/end2end/tests/simple_cacheable_request.c index c1fef2768c7..166ee638b9b 100644 --- a/test/core/end2end/tests/simple_cacheable_request.c +++ b/test/core/end2end/tests/simple_cacheable_request.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - enum { TIMEOUT = 200000 }; static void *tag(intptr_t t) { return (void *)t; } @@ -136,7 +134,7 @@ static void test_cacheable_request_response_with_metadata_and_payload( int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -274,7 +272,6 @@ static void test_cacheable_request_response_with_metadata_and_payload( } void simple_cacheable_request(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_cacheable_request_response_with_metadata_and_payload(config); } diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c index b76a53eb68f..b19c7986082 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static gpr_timespec n_seconds_time(int n) { @@ -109,7 +107,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, config.init_client(f, client_args); c = grpc_channel_create_call(f->client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -221,7 +219,6 @@ static void test_simple_delayed_request_long(grpc_end2end_test_config config) { } void simple_delayed_request(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION); test_simple_delayed_request_short(config); test_simple_delayed_request_long(config); diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c index ede19b6a146..c8370b4b150 100644 --- a/test/core/end2end/tests/simple_metadata.c +++ b/test/core/end2end/tests/simple_metadata.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -133,7 +131,7 @@ static void test_request_response_with_metadata_and_payload( int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -266,7 +264,6 @@ static void test_request_response_with_metadata_and_payload( } void simple_metadata(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_request_response_with_metadata_and_payload(config); } diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c index bdda097878e..a87a455a8da 100644 --- a/test/core/end2end/tests/simple_request.c +++ b/test/core/end2end/tests/simple_request.c @@ -45,8 +45,6 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -99,7 +97,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void simple_request_body(grpc_end2end_test_fixture f) { +static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); @@ -118,7 +116,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { char *peer; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); peer = grpc_call_get_peer(c); @@ -225,7 +223,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; f = begin_test(config, "test_invoke_simple_request", NULL, NULL); - simple_request_body(f); + simple_request_body(config, f); end_test(&f); config.tear_down_data(&f); } @@ -235,7 +233,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_simple_requests", NULL, NULL); for (i = 0; i < 10; i++) { - simple_request_body(f); + simple_request_body(config, f); gpr_log(GPR_INFO, "Passed simple request %d", i); } end_test(&f); @@ -244,7 +242,6 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { void simple_request(grpc_end2end_test_config config) { int i; - authority = get_host_override_string("foo.test.google.fr:1234", config); for (i = 0; i < 10; i++) { test_invoke_simple_request(config); } diff --git a/test/core/end2end/tests/streaming_error_response.c b/test/core/end2end/tests/streaming_error_response.c index 2eaa4a4d1bd..b6167aa135c 100644 --- a/test/core/end2end/tests/streaming_error_response.c +++ b/test/core/end2end/tests/streaming_error_response.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -128,7 +126,7 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -273,7 +271,6 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { } void streaming_error_response(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test(config, false); test(config, true); } diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.c index 892a4247778..39a90d17e19 100644 --- a/test/core/end2end/tests/trailing_metadata.c +++ b/test/core/end2end/tests/trailing_metadata.c @@ -43,8 +43,6 @@ #include #include "test/core/end2end/cq_verifier.h" -static const char *authority; - static void *tag(intptr_t t) { return (void *)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -136,7 +134,7 @@ static void test_request_response_with_metadata_and_payload( int was_cancelled = 2; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", authority, deadline, NULL); + "/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -271,7 +269,6 @@ static void test_request_response_with_metadata_and_payload( } void trailing_metadata(grpc_end2end_test_config config) { - authority = get_host_override_string("foo.test.google.fr", config); test_request_response_with_metadata_and_payload(config); }