Added host override info to test fixture config

reviewable/pr14615/r17
David Garcia Quintas 7 years ago
parent fa460dcf1d
commit 0287924466
  1. 9
      src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.mm
  2. 5
      test/core/end2end/end2end_tests.h
  3. 2
      test/core/end2end/fixtures/h2_census.cc
  4. 2
      test/core/end2end/fixtures/h2_compress.cc
  5. 2
      test/core/end2end/fixtures/h2_fakesec.cc
  6. 2
      test/core/end2end/fixtures/h2_fd.cc
  7. 2
      test/core/end2end/fixtures/h2_full+pipe.cc
  8. 2
      test/core/end2end/fixtures/h2_full+trace.cc
  9. 2
      test/core/end2end/fixtures/h2_full+workarounds.cc
  10. 2
      test/core/end2end/fixtures/h2_full.cc
  11. 2
      test/core/end2end/fixtures/h2_http_proxy.cc
  12. 5
      test/core/end2end/fixtures/h2_load_reporting.cc
  13. 2
      test/core/end2end/fixtures/h2_oauth2.cc
  14. 2
      test/core/end2end/fixtures/h2_proxy.cc
  15. 2
      test/core/end2end/fixtures/h2_sockpair+trace.cc
  16. 2
      test/core/end2end/fixtures/h2_sockpair.cc
  17. 6
      test/core/end2end/fixtures/h2_sockpair_1byte.cc
  18. 2
      test/core/end2end/fixtures/h2_ssl.cc
  19. 2
      test/core/end2end/fixtures/h2_ssl_proxy.cc
  20. 2
      test/core/end2end/fixtures/h2_uds.cc
  21. 5
      test/core/end2end/fixtures/inproc.cc
  22. 1
      test/core/end2end/h2_ssl_cert_test.cc
  23. 15
      test/core/end2end/tests/default_host.cc

@ -147,12 +147,9 @@ 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,
chttp2_create_fixture_secure_fullstack,
cronet_init_client_simple_ssl_secure_fullstack,
chttp2_init_server_simple_ssl_secure_fullstack,
chttp2_tear_down_secure_fullstack},
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS, nullptr,
chttp2_create_fixture_secure_fullstack, cronet_init_client_simple_ssl_secure_fullstack,
chttp2_init_server_simple_ssl_secure_fullstack, chttp2_tear_down_secure_fullstack},
};
static char *roots_filename;

@ -52,6 +52,11 @@ struct grpc_end2end_test_config {
/* Which features are supported by this fixture. See feature flags above. */
uint32_t feature_mask;
/* If the call host is setup by the fixture (for example, via the
* GRPC_SSL_TARGET_NAME_OVERRIDE_ARG channel arg), which value should the test
* expect to find in call_details.host */
const char* overridden_call_host;
grpc_end2end_test_fixture (*create_fixture)(grpc_channel_args* client_args,
grpc_channel_args* server_args);
void (*init_client)(grpc_end2end_test_fixture* f,

@ -111,7 +111,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
nullptr, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -109,7 +109,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack_compression,
nullptr, chttp2_create_fixture_fullstack_compression,
chttp2_init_client_fullstack_compression,
chttp2_init_server_fullstack_compression,
chttp2_tear_down_fullstack_compression},

@ -134,7 +134,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_secure_fullstack,
nullptr, chttp2_create_fixture_secure_fullstack,
chttp2_init_client_fake_secure_fullstack,
chttp2_init_server_fake_secure_fullstack,
chttp2_tear_down_secure_fullstack},

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

@ -96,7 +96,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
nullptr, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -96,7 +96,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
nullptr, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -107,7 +107,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER |
FEATURE_MASK_SUPPORTS_WORKAROUNDS,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
nullptr, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -90,7 +90,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
nullptr, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -113,7 +113,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
nullptr, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -98,8 +98,9 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
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},
nullptr, chttp2_create_fixture_load_reporting,
chttp2_init_client_load_reporting, chttp2_init_server_load_reporting,
chttp2_tear_down_load_reporting},
};
int main(int argc, char** argv) {

@ -216,7 +216,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_secure_fullstack,
"foo.test.google.fr", chttp2_create_fixture_secure_fullstack,
chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack,
chttp2_init_server_simple_ssl_secure_fullstack,
chttp2_tear_down_secure_fullstack},

@ -117,7 +117,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
nullptr, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

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

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

@ -130,9 +130,9 @@ 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",
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_socketpair,
chttp2_init_client_socketpair, chttp2_init_server_socketpair,
chttp2_tear_down_socketpair},
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, nullptr,
chttp2_create_fixture_socketpair, chttp2_init_client_socketpair,
chttp2_init_server_socketpair, chttp2_tear_down_socketpair},
};
int main(int argc, char** argv) {

@ -149,7 +149,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_secure_fullstack,
"foo.test.google.fr", chttp2_create_fixture_secure_fullstack,
chttp2_init_client_simple_ssl_secure_fullstack,
chttp2_init_server_simple_ssl_secure_fullstack,
chttp2_tear_down_secure_fullstack},

@ -187,7 +187,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_secure_fullstack,
"foo.test.google.fr", chttp2_create_fixture_secure_fullstack,
chttp2_init_client_simple_ssl_secure_fullstack,
chttp2_init_server_simple_ssl_secure_fullstack,
chttp2_tear_down_secure_fullstack},

@ -95,7 +95,7 @@ static grpc_end2end_test_config configs[] = {
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
nullptr, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
};

@ -75,8 +75,9 @@ void inproc_tear_down(grpc_end2end_test_fixture* f) {
/* All test configurations */
static grpc_end2end_test_config configs[] = {
{"inproc", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, inproc_create_fixture,
inproc_init_client, inproc_init_server, inproc_tear_down},
{"inproc", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, nullptr,
inproc_create_fixture, inproc_init_client, inproc_init_server,
inproc_tear_down},
};
int main(int argc, char** argv) {

@ -202,6 +202,7 @@ typedef enum { SUCCESS, FAIL } test_result;
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | \
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \
"foo.test.google.fr", \
chttp2_create_fixture_secure_fullstack, \
CLIENT_INIT_NAME(cert_type), \
SERVER_INIT_NAME(request_type), \

@ -88,10 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
static void test_invoke_simple_request(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f =
begin_test(config, "test_invoke_simple_request", nullptr, nullptr);
const bool override_host_for_call_creds_use =
(config.feature_mask & FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS) != 0;
const char* expected_host =
override_host_for_call_creds_use ? "foo.test.google.fr" : "localhost";
grpc_call* c;
grpc_call* s;
cq_verifier* cqv = cq_verifier_create(f.cq);
@ -197,12 +193,13 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
if (override_host_for_call_creds_use) {
validate_host_override_string("foo.test.google.fr", call_details.host,
config);
if (config.overridden_call_host != nullptr) {
validate_host_override_string(config.overridden_call_host,
call_details.host, config);
} else {
GPR_ASSERT(grpc_slice_buf_start_eq(call_details.host, "localhost", 9));
}
GPR_ASSERT(grpc_slice_buf_start_eq(call_details.host, expected_host,
strlen(expected_host)));
GPR_ASSERT(was_cancelled == 1);
grpc_slice_unref(details);

Loading…
Cancel
Save