Update unit tests and fixtures with AUTHORITY_HEADER support option

pull/8241/head
Muxi Yan 9 years ago
parent a6a6fa4f12
commit 6d68645162
  1. 4
      test/core/end2end/end2end_tests.h
  2. 3
      test/core/end2end/fixtures/h2_census.c
  3. 3
      test/core/end2end/fixtures/h2_compress.c
  4. 3
      test/core/end2end/fixtures/h2_fakesec.c
  5. 6
      test/core/end2end/fixtures/h2_fd.c
  6. 3
      test/core/end2end/fixtures/h2_full+pipe.c
  7. 3
      test/core/end2end/fixtures/h2_full+trace.c
  8. 3
      test/core/end2end/fixtures/h2_full.c
  9. 2
      test/core/end2end/fixtures/h2_load_reporting.c
  10. 3
      test/core/end2end/fixtures/h2_oauth2.c
  11. 6
      test/core/end2end/fixtures/h2_proxy.c
  12. 2
      test/core/end2end/fixtures/h2_sockpair+trace.c
  13. 3
      test/core/end2end/fixtures/h2_sockpair.c
  14. 3
      test/core/end2end/fixtures/h2_sockpair_1byte.c
  15. 3
      test/core/end2end/fixtures/h2_ssl.c
  16. 3
      test/core/end2end/fixtures/h2_ssl_proxy.c
  17. 4
      test/core/end2end/fixtures/h2_uds.c
  18. 11
      test/core/end2end/tests/call_creds.c
  19. 5
      test/core/end2end/tests/cancel_after_accept.c
  20. 5
      test/core/end2end/tests/cancel_after_client_done.c
  21. 5
      test/core/end2end/tests/cancel_after_invoke.c
  22. 5
      test/core/end2end/tests/cancel_before_invoke.c
  23. 5
      test/core/end2end/tests/cancel_in_a_vacuum.c
  24. 5
      test/core/end2end/tests/cancel_with_status.c
  25. 15
      test/core/end2end/tests/compressed_payload.c
  26. 9
      test/core/end2end/tests/disappearing_server.c
  27. 5
      test/core/end2end/tests/empty_batch.c
  28. 5
      test/core/end2end/tests/filter_call_init_fails.c
  29. 5
      test/core/end2end/tests/filter_causes_close.c
  30. 9
      test/core/end2end/tests/graceful_server_shutdown.c
  31. 9
      test/core/end2end/tests/high_initial_seqno.c
  32. 9
      test/core/end2end/tests/hpack_size.c
  33. 9
      test/core/end2end/tests/idempotent_request.c
  34. 9
      test/core/end2end/tests/invoke_large_request.c
  35. 9
      test/core/end2end/tests/large_metadata.c
  36. 5
      test/core/end2end/tests/load_reporting_hook.c
  37. 13
      test/core/end2end/tests/max_concurrent_streams.c
  38. 9
      test/core/end2end/tests/max_message_length.c
  39. 5
      test/core/end2end/tests/negative_deadline.c
  40. 9
      test/core/end2end/tests/network_status_change.c
  41. 9
      test/core/end2end/tests/no_logging.c
  42. 9
      test/core/end2end/tests/payload.c
  43. 5
      test/core/end2end/tests/ping_pong_streaming.c
  44. 11
      test/core/end2end/tests/registered_call.c
  45. 5
      test/core/end2end/tests/request_with_flags.c
  46. 9
      test/core/end2end/tests/request_with_payload.c
  47. 9
      test/core/end2end/tests/server_finishes_request.c
  48. 9
      test/core/end2end/tests/shutdown_finishes_calls.c
  49. 9
      test/core/end2end/tests/simple_cacheable_request.c
  50. 9
      test/core/end2end/tests/simple_delayed_request.c
  51. 9
      test/core/end2end/tests/simple_metadata.c
  52. 10
      test/core/end2end/tests/simple_request.c
  53. 9
      test/core/end2end/tests/streaming_error_response.c
  54. 9
      test/core/end2end/tests/trailing_metadata.c

@ -43,9 +43,13 @@ typedef struct grpc_end2end_test_config grpc_end2end_test_config;
#define FEATURE_MASK_SUPPORTS_HOSTNAME_VERIFICATION 2
#define FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS 4
#define FEATURE_MASK_SUPPORTS_REQUEST_PROXYING 8
#define FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER 16
#define FAIL_AUTH_CHECK_SERVER_ARG_NAME "fail_auth_check"
#define validate_host_override_string(str, config) \
((config).feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER ? (str) : NULL)
struct grpc_end2end_test_fixture {
grpc_completion_queue *cq;
grpc_server *server;

@ -111,7 +111,8 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack+census", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION,
{"chttp2/fullstack+census",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -113,7 +113,8 @@ void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack_compression", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION,
{"chttp2/fullstack_compression",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack_compression,
chttp2_init_client_fullstack_compression,
chttp2_init_server_fullstack_compression,

@ -140,7 +140,8 @@ static void chttp2_init_server_fake_secure_fullstack(
static grpc_end2end_test_config configs[] = {
{"chttp2/fake_secure_fullstack",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS,
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_secure_fullstack,
chttp2_init_client_fake_secure_fullstack,
chttp2_init_server_fake_secure_fullstack,

@ -106,9 +106,9 @@ static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) {
/* 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},
{"chttp2/fd", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_socketpair, chttp2_init_client_socketpair,
chttp2_init_server_socketpair, chttp2_tear_down_socketpair},
};
int main(int argc, char **argv) {

@ -97,7 +97,8 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION,
{"chttp2/fullstack",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -97,7 +97,8 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION,
{"chttp2/fullstack",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -96,7 +96,8 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION,
{"chttp2/fullstack",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -103,7 +103,7 @@ void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack+load_reporting",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION,
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_load_reporting, chttp2_init_client_load_reporting,
chttp2_init_server_load_reporting, chttp2_tear_down_load_reporting},
};

@ -216,7 +216,8 @@ static void chttp2_init_server_simple_ssl_secure_fullstack(
static grpc_end2end_test_config configs[] = {
{"chttp2/simple_ssl_with_oauth2_fullstack",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS,
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_secure_fullstack,
chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack,
chttp2_init_server_simple_ssl_secure_fullstack,

@ -113,8 +113,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack+proxy", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_REQUEST_PROXYING,
{"chttp2/fullstack+proxy",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -134,7 +134,7 @@ static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/socketpair", 0, chttp2_create_fixture_socketpair,
{"chttp2/socketpair", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_socketpair,
chttp2_init_client_socketpair, chttp2_init_server_socketpair,
chttp2_tear_down_socketpair},
};

@ -133,7 +133,8 @@ static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/socketpair", 0, chttp2_create_fixture_socketpair,
{"chttp2/socketpair", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_socketpair,
chttp2_init_client_socketpair, chttp2_init_server_socketpair,
chttp2_tear_down_socketpair},
};

@ -133,7 +133,8 @@ static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/socketpair_one_byte_at_a_time", 0,
{"chttp2/socketpair_one_byte_at_a_time",
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_socketpair, chttp2_init_client_socketpair,
chttp2_init_server_socketpair, chttp2_tear_down_socketpair},
};

@ -151,7 +151,8 @@ static void chttp2_init_server_simple_ssl_secure_fullstack(
static grpc_end2end_test_config configs[] = {
{"chttp2/simple_ssl_fullstack",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS,
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_secure_fullstack,
chttp2_init_client_simple_ssl_secure_fullstack,
chttp2_init_server_simple_ssl_secure_fullstack,

@ -185,7 +185,8 @@ static grpc_end2end_test_config configs[] = {
{"chttp2/simple_ssl_fullstack",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS,
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_secure_fullstack,
chttp2_init_client_simple_ssl_secure_fullstack,
chttp2_init_server_simple_ssl_secure_fullstack,

@ -101,7 +101,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION,
{"chttp2/fullstack_uds",
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -51,6 +51,8 @@ static const char iam_selector[] = "selector";
static const char overridden_iam_token[] = "overridden_token";
static const char overridden_iam_selector[] = "overridden_selector";
static char *authority;
typedef enum { NONE, OVERRIDE, DESTROY } override_mode;
static void *tag(intptr_t t) { return (void *)t; }
@ -165,7 +167,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
creds = grpc_google_iam_credentials_create(iam_token, iam_selector, NULL);
GPR_ASSERT(creds != NULL);
@ -294,7 +296,9 @@ static void request_response_with_payload_and_call_creds(
GPR_ASSERT(status == GRPC_STATUS_OK);
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
@ -398,7 +402,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
creds = grpc_google_iam_credentials_create(iam_token, iam_selector, NULL);
@ -471,6 +475,7 @@ 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 = validate_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);

@ -44,6 +44,8 @@
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
static void *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -126,7 +128,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -229,6 +231,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
void cancel_after_accept(grpc_end2end_test_config config) {
unsigned i;
authority = validate_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]);
}

@ -44,6 +44,8 @@
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
static 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 +128,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -233,6 +235,7 @@ static void test_cancel_after_accept_and_writes_closed(
void cancel_after_client_done(grpc_end2end_test_config config) {
unsigned i;
authority = validate_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]);
}

@ -44,6 +44,8 @@
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
static 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 +123,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -192,6 +194,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
void cancel_after_invoke(grpc_end2end_test_config config) {
unsigned i, j;
authority = validate_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);

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -119,7 +121,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c, NULL));
@ -189,6 +191,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config,
void cancel_before_invoke(grpc_end2end_test_config config) {
size_t i;
authority = validate_host_override_string("foo.test.google.fr", config);
for (i = 1; i <= 6; i++) {
test_cancel_before_invoke(config, i);
}

@ -44,6 +44,8 @@
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -106,7 +108,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
@ -121,6 +123,7 @@ 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 = validate_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]);
}

@ -45,6 +45,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -113,7 +115,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -177,6 +179,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config,
void cancel_with_status(grpc_end2end_test_config config) {
size_t i;
authority = validate_host_override_string("foo.test.google.fr:1234", config);
for (i = 1; i <= 4; i++) {
test_invoke_simple_request(config, i);
}

@ -50,6 +50,8 @@
#include "src/core/lib/surface/call_test_only.h"
#include "test/core/end2end/cq_verifier.h"
static 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 +149,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -242,7 +244,9 @@ static void request_for_disabled_algorithm(
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@ -319,7 +323,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -491,7 +495,9 @@ static void request_with_payload_template(
GPR_ASSERT(status == GRPC_STATUS_OK);
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 0);
gpr_free(details);
@ -594,6 +600,7 @@ static void test_invoke_request_with_disabled_algorithm(
}
void compressed_payload(grpc_end2end_test_config config) {
authority = validate_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);

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static gpr_timespec n_seconds_time(int n) {
@ -97,7 +99,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -174,7 +176,9 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -210,6 +214,7 @@ static void disappearing_server_test(grpc_end2end_test_config config) {
}
void disappearing_server(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr:1234", config);
GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
disappearing_server_test(config);
}

@ -45,6 +45,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -105,7 +107,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
error = grpc_call_start_batch(c, op, 0, tag(1), NULL);
@ -128,6 +130,7 @@ static void test_invoke_empty_body(grpc_end2end_test_config config) {
}
void empty_batch(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_invoke_empty_body(config);
}

@ -49,6 +49,8 @@
enum { TIMEOUT = 200000 };
static char *authority;
static bool g_enable_filter = false;
static void *tag(intptr_t t) { return (void *)t; }
@ -128,7 +130,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -263,6 +265,7 @@ static void init_plugin(void) {
static void destroy_plugin(void) {}
void filter_call_init_fails(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
g_enable_filter = true;
test_request(config);
g_enable_filter = false;

@ -46,6 +46,8 @@
#include "src/core/lib/surface/channel_init.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static bool g_enable_filter = false;
static void *tag(intptr_t t) { return (void *)t; }
@ -124,7 +126,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -282,6 +284,7 @@ static void init_plugin(void) {
static void destroy_plugin(void) {}
void filter_causes_close(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
g_enable_filter = true;
test_request(config);
g_enable_filter = false;

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -112,7 +114,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -190,7 +192,9 @@ static void test_early_server_shutdown_finishes_inflight_calls(
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -208,6 +212,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
}
void graceful_server_shutdown(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_early_server_shutdown_finishes_inflight_calls(config);
}

@ -47,6 +47,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -117,7 +119,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -189,7 +191,9 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -238,6 +242,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config,
}
void high_initial_seqno(grpc_end2end_test_config config) {
authority = validate_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);

@ -47,6 +47,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
const char *hobbits[][2] = {
@ -269,7 +271,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -342,7 +344,9 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t index) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -395,6 +399,7 @@ void hpack_size(grpc_end2end_test_config config) {
1000, 32768, 4 * 1024 * 1024};
size_t i, j;
authority = validate_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]);

@ -45,6 +45,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -116,7 +118,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -202,7 +204,9 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST == call_details.flags);
GPR_ASSERT(was_cancelled == 1);
@ -241,6 +245,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
void idempotent_request(grpc_end2end_test_config config) {
int i;
authority = validate_host_override_string("foo.test.google.fr:1234", config);
for (i = 0; i < 10; i++) {
test_invoke_simple_request(config);
}

@ -44,6 +44,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -145,7 +147,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -244,7 +246,9 @@ static void test_invoke_large_request(grpc_end2end_test_config config,
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -270,6 +274,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config,
}
void invoke_large_request(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_invoke_large_request(config, 16384, 65536);
test_invoke_large_request(config, 32768, 65536);

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static 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 +128,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
meta.key = "key";
@ -227,7 +229,9 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
GPR_ASSERT(status == GRPC_STATUS_OK);
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(contains_metadata(&request_metadata_recv, "key", meta.value));
@ -253,6 +257,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
}
void large_metadata(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_request_with_large_metadata(config);
}

@ -48,6 +48,8 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/transport/static_metadata.h"
static char *authority;
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
@ -152,7 +154,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, "foo.test.google.fr", deadline,
method_name, authority, deadline,
NULL);
GPR_ASSERT(c);
@ -315,6 +317,7 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) {
}
void load_reporting_hook(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_load_reporting_hook(config);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -113,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -185,7 +187,9 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -258,11 +262,11 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
the first completes */
deadline = n_seconds_time(1000);
c1 = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
"/alpha", "foo.test.google.fr:1234", deadline,
"/alpha", authority, deadline,
NULL);
GPR_ASSERT(c1);
c2 = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
"/beta", "foo.test.google.fr:1234", deadline,
"/beta", authority, deadline,
NULL);
GPR_ASSERT(c2);
@ -440,6 +444,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
}
void max_concurrent_streams(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr:1234", config);
test_max_concurrent_streams(config);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -138,7 +140,7 @@ static void test_max_message_length(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", "foo.test.google.fr:1234",
"/foo", authority,
gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
GPR_ASSERT(c);
@ -212,7 +214,9 @@ static void test_max_message_length(grpc_end2end_test_config config,
cq_verify(cqv);
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
done:
@ -240,6 +244,7 @@ done:
}
void max_message_length(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr:1234", config);
test_max_message_length(config, true);
test_max_message_length(config, false);
}

@ -45,6 +45,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -113,7 +115,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -174,6 +176,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config,
void negative_deadline(grpc_end2end_test_config config) {
size_t i;
authority = validate_host_override_string("foo.test.google.fr:1234", config);
for (i = 1; i <= 4; i++) {
test_invoke_simple_request(config, i);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
/* this is a private API but exposed here for testing*/
extern void grpc_network_status_shutdown_all_endpoints();
@ -123,7 +125,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -212,7 +214,9 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) {
// Expected behavior of a RPC when network is lost.
GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 0);
gpr_free(details);
@ -234,6 +238,7 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) {
}
void network_status_change(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_invoke_network_status_change(config);
}

@ -47,6 +47,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
@ -137,7 +139,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -220,7 +222,9 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(0 == call_details.flags);
GPR_ASSERT(was_cancelled == 1);
@ -286,6 +290,7 @@ static void test_no_logging_in_one_request(grpc_end2end_test_config config) {
}
void no_logging(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr:1234", config);
test_no_logging_in_one_request(config);
test_no_error_logging_in_entire_process(config);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static 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 +123,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -220,7 +222,9 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
GPR_ASSERT(status == GRPC_STATUS_OK);
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
@ -266,6 +270,7 @@ static void test_invoke_10_request_response_with_payload(
}
void payload(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_invoke_request_response_with_payload(config);
test_invoke_10_request_response_with_payload(config);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -124,7 +126,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -276,6 +278,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
void ping_pong_streaming(grpc_end2end_test_config config) {
int i;
authority = validate_host_override_string("foo.test.google.fr:1234", config);
for (i = 1; i < 10; i++) {
test_pingpong_streaming(config, i);
}

@ -45,6 +45,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -186,7 +188,9 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -205,7 +209,7 @@ 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",
"foo.test.google.fr:1234", NULL);
authority, NULL);
simple_request_body(f, rc);
end_test(&f);
@ -217,7 +221,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);
void *rc = grpc_channel_register_call(f.client, "/foo",
"foo.test.google.fr:1234", NULL);
authority, NULL);
for (i = 0; i < 10; i++) {
simple_request_body(f, rc);
@ -228,6 +232,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
}
void registered_call(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr:1234", config);
test_invoke_simple_request(config);
test_invoke_10_simple_requests(config);
}

@ -44,6 +44,8 @@
#include "src/core/lib/transport/byte_stream.h"
#include "test/core/end2end/cq_verifier.h"
static 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 +123,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -186,6 +188,7 @@ static void test_invoke_request_with_flags(
void request_with_flags(grpc_end2end_test_config config) {
size_t i;
authority = validate_host_override_string("foo.test.google.fr", config);
uint32_t flags_for_op[GRPC_OP_RECV_CLOSE_ON_SERVER + 1];
{

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -120,7 +122,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -208,7 +210,9 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
GPR_ASSERT(status == GRPC_STATUS_OK);
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
@ -231,6 +235,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
}
void request_with_payload(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_invoke_request_with_payload(config);
}

@ -45,6 +45,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -115,7 +117,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", "foo.test.google.fr:1234", deadline,
"/foo", authority, deadline,
NULL);
GPR_ASSERT(c);
@ -183,7 +185,9 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -208,6 +212,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) {
}
void server_finishes_request(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr:1234", config);
test_invoke_simple_request(config);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -105,7 +107,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -171,7 +173,9 @@ static void test_early_server_shutdown_finishes_inflight_calls(
GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -190,6 +194,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
}
void shutdown_finishes_calls(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_early_server_shutdown_finishes_inflight_calls(config);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
@ -134,7 +136,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -235,7 +237,9 @@ static void test_cacheable_request_response_with_metadata_and_payload(
GPR_ASSERT(status == GRPC_STATUS_OK);
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
if (config.feature_mask & FEATURE_MASK_SUPPORTS_REQUEST_PROXYING) {
// Our simple proxy does not support cacheable requests
} else {
@ -270,6 +274,7 @@ static void test_cacheable_request_response_with_metadata_and_payload(
}
void simple_cacheable_request(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_cacheable_request_response_with_metadata_and_payload(config);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static gpr_timespec n_seconds_time(int n) {
@ -107,7 +109,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -180,7 +182,9 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -217,6 +221,7 @@ static void test_simple_delayed_request_long(grpc_end2end_test_config config) {
}
void simple_delayed_request(grpc_end2end_test_config config) {
authority = validate_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);

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -131,7 +133,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -232,7 +234,9 @@ static void test_request_response_with_metadata_and_payload(
GPR_ASSERT(status == GRPC_STATUS_OK);
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
@ -262,6 +266,7 @@ static void test_request_response_with_metadata_and_payload(
}
void simple_metadata(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_request_response_with_metadata_and_payload(config);
}

@ -45,6 +45,8 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -116,8 +118,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", "foo.test.google.fr:1234", deadline,
NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
peer = grpc_call_get_peer(c);
@ -202,7 +203,9 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
}
GPR_ASSERT(0 == call_details.flags);
GPR_ASSERT(was_cancelled == 1);
@ -241,6 +244,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
void simple_request(grpc_end2end_test_config config) {
int i;
authority = validate_host_override_string("foo.test.google.fr:1234", config);
for (i = 0; i < 10; i++) {
test_invoke_simple_request(config);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static 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 +128,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -245,7 +247,9 @@ static void test(grpc_end2end_test_config config, bool request_status_early) {
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
@ -269,6 +273,7 @@ static void test(grpc_end2end_test_config config, bool request_status_early) {
}
void streaming_error_response(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test(config, false);
test(config, true);
}

@ -43,6 +43,8 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -134,7 +136,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", "foo.test.google.fr", deadline, NULL);
"/foo", authority, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -236,7 +238,9 @@ static void test_request_response_with_metadata_and_payload(
GPR_ASSERT(status == GRPC_STATUS_OK);
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"));
if (authority) {
GPR_ASSERT(0 == strcmp(call_details.host, authority));
}
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
GPR_ASSERT(contains_metadata(&request_metadata_recv, "key1", "val1"));
@ -267,6 +271,7 @@ static void test_request_response_with_metadata_and_payload(
}
void trailing_metadata(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_request_response_with_metadata_and_payload(config);
}

Loading…
Cancel
Save