diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/core/bad_client/gen_build_yaml.py (renamed from test/core/bad_client/gen_build_json.py) | 7 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_compress.c (renamed from test/core/end2end/fixtures/chttp2_fullstack_compression.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_fakesec.c (renamed from test/core/end2end/fixtures/chttp2_fake_security.c) | 2 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_full+poll.c (renamed from test/core/end2end/fixtures/chttp2_fullstack_with_poll.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_full.c (renamed from test/core/end2end/fixtures/chttp2_fullstack.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_oauth2.c (renamed from test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c) | 45 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_proxy.c (renamed from test/core/end2end/fixtures/chttp2_fullstack_with_proxy.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_sockpair+trace.c (renamed from test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_sockpair.c (renamed from test/core/end2end/fixtures/chttp2_socket_pair.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_sockpair_1byte.c (renamed from test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_ssl+poll.c (renamed from test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c) | 2 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_ssl.c (renamed from test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c) | 2 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_ssl_proxy.c (renamed from test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_proxy.c) | 2 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_uds+poll.c (renamed from test/core/end2end/fixtures/chttp2_fullstack_uds_posix_with_poll.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_uds.c (renamed from test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c) | 0 | ||||
-rwxr-xr-x | test/core/end2end/gen_build_yaml.py (renamed from test/core/end2end/gen_build_json.py) | 71 | ||||
-rw-r--r-- | test/core/end2end/tests/binary_metadata.c (renamed from test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/call_creds.c (renamed from test/core/end2end/tests/request_response_with_payload_and_call_creds.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_after_client_done.c (renamed from test/core/end2end/tests/cancel_after_accept_and_writes_closed.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/compressed_payload.c (renamed from test/core/end2end/tests/request_with_compressed_payload.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/high_initial_seqno.c (renamed from test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/large_metadata.c (renamed from test/core/end2end/tests/request_with_large_metadata.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/metadata.c (renamed from test/core/end2end/tests/request_response_with_metadata_and_payload.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/payload.c (renamed from test/core/end2end/tests/request_response_with_payload.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/shutdown_finishes_calls.c (renamed from test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/shutdown_finishes_tags.c (renamed from test/core/end2end/tests/early_server_shutdown_finishes_tags.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/tests/trailing_metadata.c (renamed from test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c) | 0 | ||||
-rw-r--r-- | test/core/util/reconnect_server.c | 4 | ||||
-rw-r--r-- | test/cpp/client/credentials_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/common/auth_property_iterator_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/common/secure_auth_context_test.cc | 24 | ||||
-rw-r--r-- | test/cpp/end2end/async_end2end_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/end2end/client_crash_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/end2end/client_crash_test_server.cc | 1 | ||||
-rw-r--r-- | test/cpp/end2end/end2end_test.cc | 179 | ||||
-rw-r--r-- | test/cpp/end2end/generic_end2end_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/end2end/mock_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/end2end/server_crash_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/end2end/server_crash_test_client.cc | 1 | ||||
-rw-r--r-- | test/cpp/end2end/shutdown_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/end2end/thread_stress_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/end2end/zookeeper_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/interop/client_helper.cc | 2 | ||||
-rw-r--r-- | test/cpp/interop/interop_client.cc | 2 | ||||
-rw-r--r-- | test/cpp/interop/reconnect_interop_server.cc | 1 | ||||
-rw-r--r-- | test/cpp/interop/server.cc | 2 | ||||
-rw-r--r-- | test/cpp/interop/server_helper.cc | 2 | ||||
-rw-r--r-- | test/cpp/interop/server_helper.h | 2 | ||||
-rw-r--r-- | test/cpp/qps/client_sync.cc | 2 | ||||
-rw-r--r-- | test/cpp/qps/driver.cc | 1 | ||||
-rw-r--r-- | test/cpp/qps/perf_db_client.h | 2 | ||||
-rw-r--r-- | test/cpp/qps/qps_worker.cc | 2 | ||||
-rw-r--r-- | test/cpp/qps/server_async.cc | 5 | ||||
-rw-r--r-- | test/cpp/qps/server_sync.cc | 4 | ||||
-rw-r--r-- | test/cpp/util/cli_call_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/util/create_test_channel.cc | 2 | ||||
-rw-r--r-- | test/cpp/util/create_test_channel.h | 2 | ||||
-rw-r--r-- | test/cpp/util/grpc_cli.cc | 4 | ||||
-rw-r--r-- | test/cpp/util/messages.proto | 1 |
59 files changed, 275 insertions, 123 deletions
diff --git a/test/core/bad_client/gen_build_json.py b/test/core/bad_client/gen_build_yaml.py index 33bf65ac04..02dda10be0 100755 --- a/test/core/bad_client/gen_build_json.py +++ b/test/core/bad_client/gen_build_yaml.py @@ -32,8 +32,8 @@ """Generates the appropriate build.json data for all the end2end tests.""" -import simplejson import collections +import yaml TestOptions = collections.namedtuple('TestOptions', 'flaky') default_test_options = TestOptions(False) @@ -58,6 +58,7 @@ def main(): 'headers': [ 'test/core/bad_client/bad_client.h' ], + 'vs_proj_dir': 'test', 'deps': [ 'grpc_test_util_unsecure', 'grpc_unsecure', @@ -72,7 +73,7 @@ def main(): 'language': 'c', 'secure': 'no', 'src': ['test/core/bad_client/tests/%s.c' % t], - 'flaky': 'invoke_large_request' in t, + 'vs_proj_dir': 'test', 'deps': [ 'bad_client_test', 'grpc_test_util_unsecure', @@ -82,7 +83,7 @@ def main(): ] } for t in sorted(BAD_CLIENT_TESTS.keys())]} - print simplejson.dumps(json, sort_keys=True, indent=2 * ' ') + print yaml.dump(json) if __name__ == '__main__': diff --git a/test/core/end2end/fixtures/chttp2_fullstack_compression.c b/test/core/end2end/fixtures/h2_compress.c index 6e7a1faf55..6e7a1faf55 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_compression.c +++ b/test/core/end2end/fixtures/h2_compress.c diff --git a/test/core/end2end/fixtures/chttp2_fake_security.c b/test/core/end2end/fixtures/h2_fakesec.c index b4a248fb52..3e64cc08e8 100644 --- a/test/core/end2end/fixtures/chttp2_fake_security.c +++ b/test/core/end2end/fixtures/h2_fakesec.c @@ -128,7 +128,7 @@ static void chttp2_init_server_fake_secure_fullstack( grpc_server_credentials *fake_ts_creds = grpc_fake_transport_security_server_credentials_create(); if (fail_server_auth_check(server_args)) { - grpc_auth_metadata_processor processor = {process_auth_failure, NULL}; + grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL}; grpc_server_credentials_set_auth_metadata_processor(fake_ts_creds, processor); } diff --git a/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c b/test/core/end2end/fixtures/h2_full+poll.c index 48feefc931..48feefc931 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c +++ b/test/core/end2end/fixtures/h2_full+poll.c diff --git a/test/core/end2end/fixtures/chttp2_fullstack.c b/test/core/end2end/fixtures/h2_full.c index 0170dcf0e5..0170dcf0e5 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack.c +++ b/test/core/end2end/fixtures/h2_full.c diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c b/test/core/end2end/fixtures/h2_oauth2.c index 9a545b1e3d..e61e276fff 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c +++ b/test/core/end2end/fixtures/h2_oauth2.c @@ -67,13 +67,21 @@ static const grpc_metadata *find_metadata(const grpc_metadata *md, return NULL; } +typedef struct { + size_t pseudo_refcount; +} test_processor_state; + static void process_oauth2_success(void *state, grpc_auth_context *ctx, const grpc_metadata *md, size_t md_count, grpc_process_auth_metadata_done_cb cb, void *user_data) { const grpc_metadata *oauth2 = find_metadata(md, md_count, "Authorization", oauth2_md); - GPR_ASSERT(state == NULL); + test_processor_state *s; + + GPR_ASSERT(state != NULL); + s = (test_processor_state *)state; + GPR_ASSERT(s->pseudo_refcount == 1); GPR_ASSERT(oauth2 != NULL); grpc_auth_context_add_cstring_property(ctx, client_identity_property_name, client_identity); @@ -88,7 +96,10 @@ static void process_oauth2_failure(void *state, grpc_auth_context *ctx, void *user_data) { const grpc_metadata *oauth2 = find_metadata(md, md_count, "Authorization", oauth2_md); - GPR_ASSERT(state == NULL); + test_processor_state *s; + GPR_ASSERT(state != NULL); + s = (test_processor_state *)state; + GPR_ASSERT(s->pseudo_refcount == 1); GPR_ASSERT(oauth2 != NULL); cb(user_data, oauth2, 1, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL); } @@ -171,20 +182,34 @@ static int fail_server_auth_check(grpc_channel_args *server_args) { return 0; } +static void processor_destroy(void *state) { + test_processor_state *s = (test_processor_state *)state; + GPR_ASSERT((s->pseudo_refcount--) == 1); + gpr_free(s); +} + +static grpc_auth_metadata_processor test_processor_create(int failing) { + test_processor_state *s = gpr_malloc(sizeof(*s)); + grpc_auth_metadata_processor result; + s->pseudo_refcount = 1; + result.state = s; + result.destroy = processor_destroy; + if (failing) { + result.process = process_oauth2_failure; + } else { + result.process = process_oauth2_success; + } + return result; +} + static void chttp2_init_server_simple_ssl_secure_fullstack( grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key, test_server1_cert}; grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL); - grpc_auth_metadata_processor processor; - processor.state = NULL; - if (fail_server_auth_check(server_args)) { - processor.process = process_oauth2_failure; - } else { - processor.process = process_oauth2_success; - } - grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor); + grpc_server_credentials_set_auth_metadata_processor( + ssl_creds, test_processor_create(fail_server_auth_check(server_args))); chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); } diff --git a/test/core/end2end/fixtures/chttp2_fullstack_with_proxy.c b/test/core/end2end/fixtures/h2_proxy.c index 44083e2676..44083e2676 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_with_proxy.c +++ b/test/core/end2end/fixtures/h2_proxy.c diff --git a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c index 588c4b23e1..588c4b23e1 100644 --- a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c +++ b/test/core/end2end/fixtures/h2_sockpair+trace.c diff --git a/test/core/end2end/fixtures/chttp2_socket_pair.c b/test/core/end2end/fixtures/h2_sockpair.c index 16a04fbebf..16a04fbebf 100644 --- a/test/core/end2end/fixtures/chttp2_socket_pair.c +++ b/test/core/end2end/fixtures/h2_sockpair.c diff --git a/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c index 94fc36f5ec..94fc36f5ec 100644 --- a/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c b/test/core/end2end/fixtures/h2_ssl+poll.c index e7375f15e6..2c605d1471 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c +++ b/test/core/end2end/fixtures/h2_ssl+poll.c @@ -138,7 +138,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); if (fail_server_auth_check(server_args)) { - grpc_auth_metadata_processor processor = {process_auth_failure, NULL}; + grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL}; grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor); } chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c b/test/core/end2end/fixtures/h2_ssl.c index 201d202dff..9193a09b17 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c +++ b/test/core/end2end/fixtures/h2_ssl.c @@ -138,7 +138,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); if (fail_server_auth_check(server_args)) { - grpc_auth_metadata_processor processor = {process_auth_failure, NULL}; + grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL}; grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor); } chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.c index be0dda25a6..8133a69a0c 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_proxy.c +++ b/test/core/end2end/fixtures/h2_ssl_proxy.c @@ -167,7 +167,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); if (fail_server_auth_check(server_args)) { - grpc_auth_metadata_processor processor = {process_auth_failure, NULL}; + grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL}; grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor); } chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); diff --git a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix_with_poll.c b/test/core/end2end/fixtures/h2_uds+poll.c index 05b9ea0949..05b9ea0949 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix_with_poll.c +++ b/test/core/end2end/fixtures/h2_uds+poll.c diff --git a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c b/test/core/end2end/fixtures/h2_uds.c index 59d39bbb0f..59d39bbb0f 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c +++ b/test/core/end2end/fixtures/h2_uds.c diff --git a/test/core/end2end/gen_build_json.py b/test/core/end2end/gen_build_yaml.py index 6f10b78dad..3fe2909493 100755 --- a/test/core/end2end/gen_build_json.py +++ b/test/core/end2end/gen_build_yaml.py @@ -32,8 +32,9 @@ """Generates the appropriate build.json data for all the end2end tests.""" -import simplejson +import yaml import collections +import hashlib FixtureOptions = collections.namedtuple('FixtureOptions', 'fullstack includes_proxy dns_resolver secure platforms ci_mac') @@ -42,22 +43,23 @@ socketpair_unsecure_fixture_options = default_unsecure_fixture_options._replace( default_secure_fixture_options = default_unsecure_fixture_options._replace(secure=True) uds_fixture_options = default_unsecure_fixture_options._replace(dns_resolver=False, platforms=['linux', 'mac', 'posix']) + # maps fixture name to whether it requires the security library END2END_FIXTURES = { - 'chttp2_fake_security': default_secure_fixture_options._replace(ci_mac=False), - 'chttp2_fullstack': default_unsecure_fixture_options, - 'chttp2_fullstack_compression': default_unsecure_fixture_options, - 'chttp2_fullstack_uds_posix': uds_fixture_options, - 'chttp2_fullstack_uds_posix_with_poll': uds_fixture_options._replace(platforms=['linux']), - 'chttp2_fullstack_with_poll': default_unsecure_fixture_options._replace(platforms=['linux']), - 'chttp2_fullstack_with_proxy': default_unsecure_fixture_options._replace(includes_proxy=True, ci_mac=False), - 'chttp2_simple_ssl_fullstack': default_secure_fixture_options, - 'chttp2_simple_ssl_fullstack_with_poll': default_secure_fixture_options._replace(platforms=['linux']), - 'chttp2_simple_ssl_fullstack_with_proxy': default_secure_fixture_options._replace(includes_proxy=True, ci_mac=False), - 'chttp2_simple_ssl_with_oauth2_fullstack': default_secure_fixture_options._replace(ci_mac=False), - 'chttp2_socket_pair': socketpair_unsecure_fixture_options._replace(ci_mac=False), - 'chttp2_socket_pair_one_byte_at_a_time': socketpair_unsecure_fixture_options._replace(ci_mac=False), - 'chttp2_socket_pair_with_grpc_trace': socketpair_unsecure_fixture_options, + 'h2_fakesec': default_secure_fixture_options._replace(ci_mac=False), + 'h2_full': default_unsecure_fixture_options, + 'h2_compress': default_unsecure_fixture_options, + 'h2_uds': uds_fixture_options, + 'h2_uds+poll': uds_fixture_options._replace(platforms=['linux']), + 'h2_full+poll': default_unsecure_fixture_options._replace(platforms=['linux']), + 'h2_proxy': default_unsecure_fixture_options._replace(includes_proxy=True, ci_mac=False), + 'h2_ssl': default_secure_fixture_options, + 'h2_ssl+poll': default_secure_fixture_options._replace(platforms=['linux']), + 'h2_ssl_proxy': default_secure_fixture_options._replace(includes_proxy=True, ci_mac=False), + 'h2_oauth2': default_secure_fixture_options._replace(ci_mac=False), + 'h2_sockpair': socketpair_unsecure_fixture_options._replace(ci_mac=False), + 'h2_sockpair_1byte': socketpair_unsecure_fixture_options._replace(ci_mac=False), + 'h2_sockpair+trace': socketpair_unsecure_fixture_options, } TestOptions = collections.namedtuple('TestOptions', 'needs_fullstack needs_dns proxyable flaky secure') @@ -67,7 +69,7 @@ connectivity_test_options = default_test_options._replace(needs_fullstack=True) # maps test names to options END2END_TESTS = { 'bad_hostname': default_test_options, - 'cancel_after_accept_and_writes_closed': default_test_options, + 'cancel_after_client_done': default_test_options, 'cancel_after_accept': default_test_options, 'cancel_after_invoke': default_test_options, 'cancel_before_invoke': default_test_options, @@ -76,8 +78,8 @@ END2END_TESTS = { 'channel_connectivity': connectivity_test_options._replace(proxyable=False), 'default_host': default_test_options._replace(needs_fullstack=True, needs_dns=True), 'disappearing_server': connectivity_test_options, - 'early_server_shutdown_finishes_inflight_calls': default_test_options, - 'early_server_shutdown_finishes_tags': default_test_options, + 'shutdown_finishes_calls': default_test_options, + 'shutdown_finishes_tags': default_test_options, 'empty_batch': default_test_options, 'graceful_server_shutdown': default_test_options, 'invoke_large_request': default_test_options, @@ -86,19 +88,19 @@ END2END_TESTS = { 'no_op': default_test_options, 'ping_pong_streaming': default_test_options, 'registered_call': default_test_options, - 'request_response_with_binary_metadata_and_payload': default_test_options, - 'request_response_with_metadata_and_payload': default_test_options, - 'request_response_with_payload_and_call_creds': default_test_options._replace(secure=True), - 'request_response_with_payload': default_test_options, - 'request_response_with_trailing_metadata_and_payload': default_test_options, - 'request_with_compressed_payload': default_test_options._replace(proxyable=False), + 'binary_metadata': default_test_options, + 'metadata': default_test_options, + 'call_creds': default_test_options._replace(secure=True), + 'payload': default_test_options, + 'trailing_metadata': default_test_options, + 'compressed_payload': default_test_options._replace(proxyable=False), 'request_with_flags': default_test_options._replace(proxyable=False), - 'request_with_large_metadata': default_test_options, + 'large_metadata': default_test_options, 'request_with_payload': default_test_options, 'server_finishes_request': default_test_options, 'simple_delayed_request': connectivity_test_options, 'simple_request': default_test_options, - 'simple_request_with_high_initial_sequence_number': default_test_options, + 'high_initial_seqno': default_test_options, } @@ -147,6 +149,7 @@ def main(): 'platforms': [ 'linux', 'mac', 'posix' ] if f.endswith('_posix') else END2END_FIXTURES[f].platforms, 'deps': sec_deps if END2END_FIXTURES[f].secure else unsec_deps, 'headers': ['test/core/end2end/end2end_tests.h'], + 'vs_proj_dir': 'test', } for f in sorted(END2END_FIXTURES.keys())] + [ { @@ -157,7 +160,8 @@ def main(): 'src': ['test/core/end2end/tests/%s.c' % t], 'headers': ['test/core/end2end/tests/cancel_test_helpers.h', 'test/core/end2end/end2end_tests.h'], - 'deps': sec_deps if END2END_TESTS[t].secure else unsec_deps + 'deps': sec_deps if END2END_TESTS[t].secure else unsec_deps, + 'vs_proj_dir': 'test', } for t in sorted(END2END_TESTS.keys())] + [ { @@ -168,7 +172,8 @@ def main(): "test/core/end2end/data/test_root_cert.c", "test/core/end2end/data/server1_cert.c", "test/core/end2end/data/server1_key.c" - ] + ], + 'vs_proj_dir': 'test', } ], 'targets': [ @@ -184,13 +189,14 @@ def main(): else without(END2END_FIXTURES[f].platforms, 'mac')), 'deps': [ 'end2end_fixture_%s' % f, - 'end2end_test_%s' % t] + sec_deps + 'end2end_test_%s' % t] + sec_deps, + 'vs_proj_dir': 'test', } for f in sorted(END2END_FIXTURES.keys()) for t in sorted(END2END_TESTS.keys()) if compatible(f, t)] + [ { - 'name': '%s_%s_unsecure_test' % (f, t), + 'name': '%s_%s_nosec_test' % (f, t), 'build': 'test', 'language': 'c', 'secure': 'no', @@ -202,11 +208,12 @@ def main(): else without(END2END_FIXTURES[f].platforms, 'mac')), 'deps': [ 'end2end_fixture_%s' % f, - 'end2end_test_%s' % t] + unsec_deps + 'end2end_test_%s' % t] + unsec_deps, + 'vs_proj_dir': 'test', } for f in sorted(END2END_FIXTURES.keys()) if not END2END_FIXTURES[f].secure for t in sorted(END2END_TESTS.keys()) if compatible(f, t) and not END2END_TESTS[t].secure]} - print simplejson.dumps(json, sort_keys=True, indent=2 * ' ') + print yaml.dump(json) if __name__ == '__main__': diff --git a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c b/test/core/end2end/tests/binary_metadata.c index 2345f94044..2345f94044 100644 --- a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c +++ b/test/core/end2end/tests/binary_metadata.c diff --git a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c b/test/core/end2end/tests/call_creds.c index 75c5bba5bd..75c5bba5bd 100644 --- a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c +++ b/test/core/end2end/tests/call_creds.c diff --git a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c b/test/core/end2end/tests/cancel_after_client_done.c index 2430a6d218..2430a6d218 100644 --- a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c +++ b/test/core/end2end/tests/cancel_after_client_done.c diff --git a/test/core/end2end/tests/request_with_compressed_payload.c b/test/core/end2end/tests/compressed_payload.c index 299943c548..299943c548 100644 --- a/test/core/end2end/tests/request_with_compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.c diff --git a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c b/test/core/end2end/tests/high_initial_seqno.c index 0067bb4bef..0067bb4bef 100644 --- a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c +++ b/test/core/end2end/tests/high_initial_seqno.c diff --git a/test/core/end2end/tests/request_with_large_metadata.c b/test/core/end2end/tests/large_metadata.c index 98e47aaf98..98e47aaf98 100644 --- a/test/core/end2end/tests/request_with_large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c diff --git a/test/core/end2end/tests/request_response_with_metadata_and_payload.c b/test/core/end2end/tests/metadata.c index a4cc27896c..a4cc27896c 100644 --- a/test/core/end2end/tests/request_response_with_metadata_and_payload.c +++ b/test/core/end2end/tests/metadata.c diff --git a/test/core/end2end/tests/request_response_with_payload.c b/test/core/end2end/tests/payload.c index ff00ae6d9d..ff00ae6d9d 100644 --- a/test/core/end2end/tests/request_response_with_payload.c +++ b/test/core/end2end/tests/payload.c diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c b/test/core/end2end/tests/shutdown_finishes_calls.c index 233bc9bee2..233bc9bee2 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c +++ b/test/core/end2end/tests/shutdown_finishes_calls.c diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c b/test/core/end2end/tests/shutdown_finishes_tags.c index 9b678a1754..9b678a1754 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c +++ b/test/core/end2end/tests/shutdown_finishes_tags.c diff --git a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c b/test/core/end2end/tests/trailing_metadata.c index 8b764751f6..8b764751f6 100644 --- a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c +++ b/test/core/end2end/tests/trailing_metadata.c diff --git a/test/core/util/reconnect_server.c b/test/core/util/reconnect_server.c index a06cb50b3a..61535cc5c0 100644 --- a/test/core/util/reconnect_server.c +++ b/test/core/util/reconnect_server.c @@ -33,7 +33,6 @@ #include "test/core/util/reconnect_server.h" -#include <arpa/inet.h> #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/host_port.h> @@ -42,6 +41,7 @@ #include <grpc/support/time.h> #include <string.h> #include "src/core/iomgr/endpoint.h" +#include "src/core/iomgr/sockaddr.h" #include "src/core/iomgr/tcp_server.h" #include "test/core/util/port.h" @@ -116,7 +116,7 @@ void reconnect_server_start(reconnect_server *server, int port) { addr.sin_family = AF_INET; addr.sin_port = htons(port); - inet_pton(AF_INET, "0.0.0.0", &addr.sin_addr); + memset(&addr.sin_addr, 0, sizeof(addr.sin_addr)); server->tcp_server = grpc_tcp_server_create(); port_added = diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 18fcffe7cd..743ad065d1 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -31,7 +31,7 @@ * */ -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> #include <memory> diff --git a/test/cpp/common/auth_property_iterator_test.cc b/test/cpp/common/auth_property_iterator_test.cc index e6226d6a09..a629ff5a90 100644 --- a/test/cpp/common/auth_property_iterator_test.cc +++ b/test/cpp/common/auth_property_iterator_test.cc @@ -32,7 +32,7 @@ */ #include <grpc/grpc_security.h> -#include <grpc++/support/auth_context.h> +#include <grpc++/security/auth_context.h> #include <gtest/gtest.h> #include "src/cpp/common/secure_auth_context.h" #include "test/cpp/util/string_ref_helper.h" diff --git a/test/cpp/common/secure_auth_context_test.cc b/test/cpp/common/secure_auth_context_test.cc index 25538c1853..11de646999 100644 --- a/test/cpp/common/secure_auth_context_test.cc +++ b/test/cpp/common/secure_auth_context_test.cc @@ -32,7 +32,7 @@ */ #include <grpc/grpc_security.h> -#include <grpc++/support/auth_context.h> +#include <grpc++/security/auth_context.h> #include <gtest/gtest.h> #include "src/cpp/common/secure_auth_context.h" #include "test/cpp/util/string_ref_helper.h" @@ -50,7 +50,7 @@ class SecureAuthContextTest : public ::testing::Test {}; // Created with nullptr TEST_F(SecureAuthContextTest, EmptyContext) { - SecureAuthContext context(nullptr); + SecureAuthContext context(nullptr, true); EXPECT_TRUE(context.GetPeerIdentity().empty()); EXPECT_TRUE(context.GetPeerIdentityPropertyName().empty()); EXPECT_TRUE(context.FindPropertyValues("").empty()); @@ -60,12 +60,12 @@ TEST_F(SecureAuthContextTest, EmptyContext) { TEST_F(SecureAuthContextTest, Properties) { grpc_auth_context* ctx = grpc_auth_context_create(NULL); - grpc_auth_context_add_cstring_property(ctx, "name", "chapi"); - grpc_auth_context_add_cstring_property(ctx, "name", "chapo"); - grpc_auth_context_add_cstring_property(ctx, "foo", "bar"); - EXPECT_EQ(1, grpc_auth_context_set_peer_identity_property_name(ctx, "name")); + SecureAuthContext context(ctx, true); + context.AddProperty("name", "chapi"); + context.AddProperty("name", "chapo"); + context.AddProperty("foo", "bar"); + EXPECT_TRUE(context.SetPeerIdentityPropertyName("name")); - SecureAuthContext context(ctx); std::vector<grpc::string_ref> peer_identity = context.GetPeerIdentity(); EXPECT_EQ(2u, peer_identity.size()); EXPECT_EQ("chapi", ToString(peer_identity[0])); @@ -78,12 +78,12 @@ TEST_F(SecureAuthContextTest, Properties) { TEST_F(SecureAuthContextTest, Iterators) { grpc_auth_context* ctx = grpc_auth_context_create(NULL); - grpc_auth_context_add_cstring_property(ctx, "name", "chapi"); - grpc_auth_context_add_cstring_property(ctx, "name", "chapo"); - grpc_auth_context_add_cstring_property(ctx, "foo", "bar"); - EXPECT_EQ(1, grpc_auth_context_set_peer_identity_property_name(ctx, "name")); + SecureAuthContext context(ctx, true); + context.AddProperty("name", "chapi"); + context.AddProperty("name", "chapo"); + context.AddProperty("foo", "bar"); + EXPECT_TRUE(context.SetPeerIdentityPropertyName("name")); - SecureAuthContext context(ctx); AuthPropertyIterator iter = context.begin(); EXPECT_TRUE(context.end() != iter); AuthProperty p0 = *iter; diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index bbcac9ba34..686e7627b9 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -39,11 +39,9 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <gtest/gtest.h> #include "test/core/util/port.h" diff --git a/test/cpp/end2end/client_crash_test.cc b/test/cpp/end2end/client_crash_test.cc index 3a6e55216a..058e696166 100644 --- a/test/cpp/end2end/client_crash_test.cc +++ b/test/cpp/end2end/client_crash_test.cc @@ -37,11 +37,9 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <gtest/gtest.h> #include "test/core/util/port.h" diff --git a/test/cpp/end2end/client_crash_test_server.cc b/test/cpp/end2end/client_crash_test_server.cc index 79a7832874..7ffeecca70 100644 --- a/test/cpp/end2end/client_crash_test_server.cc +++ b/test/cpp/end2end/client_crash_test_server.cc @@ -39,7 +39,6 @@ #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include "test/cpp/util/echo.grpc.pb.h" DEFINE_string(address, "", "Address to bind to"); diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 5e2332cbe9..10a4c5ac26 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -40,11 +40,12 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> +#include <grpc++/security/auth_metadata_processor.h> +#include <grpc++/security/credentials.h> +#include <grpc++/security/server_credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <gtest/gtest.h> #include "src/core/security/credentials.h" @@ -79,14 +80,23 @@ void MaybeEchoDeadline(ServerContext* context, const EchoRequest* request, } } -void CheckServerAuthContext(const ServerContext* context) { +void CheckServerAuthContext(const ServerContext* context, + const grpc::string& expected_client_identity) { std::shared_ptr<const AuthContext> auth_ctx = context->auth_context(); std::vector<grpc::string_ref> ssl = auth_ctx->FindPropertyValues("transport_security_type"); EXPECT_EQ(1u, ssl.size()); EXPECT_EQ("ssl", ToString(ssl[0])); - EXPECT_TRUE(auth_ctx->GetPeerIdentityPropertyName().empty()); - EXPECT_TRUE(auth_ctx->GetPeerIdentity().empty()); + if (expected_client_identity.length() == 0) { + EXPECT_TRUE(auth_ctx->GetPeerIdentityPropertyName().empty()); + EXPECT_TRUE(auth_ctx->GetPeerIdentity().empty()); + EXPECT_FALSE(auth_ctx->IsPeerAuthenticated()); + } else { + auto identity = auth_ctx->GetPeerIdentity(); + EXPECT_TRUE(auth_ctx->IsPeerAuthenticated()); + EXPECT_EQ(1u, identity.size()); + EXPECT_EQ(expected_client_identity, identity[0]); + } } bool CheckIsLocalhost(const grpc::string& addr) { @@ -98,6 +108,54 @@ bool CheckIsLocalhost(const grpc::string& addr) { addr.substr(0, kIpv6.size()) == kIpv6; } +class TestAuthMetadataProcessor : public AuthMetadataProcessor { + public: + static const char kGoodGuy[]; + + TestAuthMetadataProcessor(bool is_blocking) : is_blocking_(is_blocking) {} + + std::shared_ptr<Credentials> GetCompatibleClientCreds() { + return AccessTokenCredentials(kGoodGuy); + } + std::shared_ptr<Credentials> GetIncompatibleClientCreds() { + return AccessTokenCredentials("Mr Hyde"); + } + + // Interface implementation + bool IsBlocking() const GRPC_OVERRIDE { return is_blocking_; } + + Status Process(const InputMetadata& auth_metadata, AuthContext* context, + OutputMetadata* consumed_auth_metadata, + OutputMetadata* response_metadata) GRPC_OVERRIDE { + EXPECT_TRUE(consumed_auth_metadata != nullptr); + EXPECT_TRUE(context != nullptr); + EXPECT_TRUE(response_metadata != nullptr); + auto auth_md = auth_metadata.find(GRPC_AUTHORIZATION_METADATA_KEY); + EXPECT_NE(auth_md, auth_metadata.end()); + string_ref auth_md_value = auth_md->second; + if (auth_md_value.ends_with(kGoodGuy)) { + context->AddProperty(kIdentityPropName, kGoodGuy); + context->SetPeerIdentityPropertyName(kIdentityPropName); + consumed_auth_metadata->insert( + std::make_pair(string(auth_md->first.data(), auth_md->first.length()), + auth_md->second)); + return Status::OK; + } else { + return Status(StatusCode::UNAUTHENTICATED, + string("Invalid principal: ") + + string(auth_md_value.data(), auth_md_value.length())); + } + } + + protected: + static const char kIdentityPropName[]; + bool is_blocking_; +}; + +const char TestAuthMetadataProcessor::kGoodGuy[] = "Dr Jekyll"; +const char TestAuthMetadataProcessor::kIdentityPropName[] = "novel identity"; + + } // namespace class Proxy : public ::grpc::cpp::test::util::TestService::Service { @@ -162,8 +220,10 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service { ToString(iter->second)); } } - if (request->has_param() && request->param().check_auth_context()) { - CheckServerAuthContext(context); + if (request->has_param() && + (request->param().expected_client_identity().length() > 0 || + request->param().check_auth_context())) { + CheckServerAuthContext(context, request->param().expected_client_identity()); } if (request->has_param() && request->param().response_message_length() > 0) { @@ -259,9 +319,18 @@ class TestServiceImplDupPkg class End2endTest : public ::testing::TestWithParam<bool> { protected: End2endTest() - : kMaxMessageSize_(8192), special_service_("special") {} + : is_server_started_(false), + kMaxMessageSize_(8192), + special_service_("special") {} + + void TearDown() GRPC_OVERRIDE { + if (is_server_started_) { + server_->Shutdown(); + if (proxy_server_) proxy_server_->Shutdown(); + } + } - void SetUp() GRPC_OVERRIDE { + void StartServer(const std::shared_ptr<AuthMetadataProcessor>& processor) { int port = grpc_pick_unused_port_or_die(); server_address_ << "127.0.0.1:" << port; // Setup server @@ -271,22 +340,23 @@ class End2endTest : public ::testing::TestWithParam<bool> { SslServerCredentialsOptions ssl_opts; ssl_opts.pem_root_certs = ""; ssl_opts.pem_key_cert_pairs.push_back(pkcp); - builder.AddListeningPort(server_address_.str(), - SslServerCredentials(ssl_opts)); + auto server_creds = SslServerCredentials(ssl_opts); + server_creds->SetAuthMetadataProcessor(processor); + builder.AddListeningPort(server_address_.str(), server_creds); builder.RegisterService(&service_); builder.RegisterService("foo.test.youtube.com", &special_service_); builder.SetMaxMessageSize( kMaxMessageSize_); // For testing max message size. builder.RegisterService(&dup_pkg_service_); server_ = builder.BuildAndStart(); - } - - void TearDown() GRPC_OVERRIDE { - server_->Shutdown(); - if (proxy_server_) proxy_server_->Shutdown(); + is_server_started_ = true; } void ResetChannel() { + if (!is_server_started_) { + StartServer(std::shared_ptr<AuthMetadataProcessor>()); + } + EXPECT_TRUE(is_server_started_); SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; ChannelArguments args; args.SetSslTargetNameOverride("foo.test.google.fr"); @@ -313,6 +383,7 @@ class End2endTest : public ::testing::TestWithParam<bool> { stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel_)); } + bool is_server_started_; std::shared_ptr<Channel> channel_; std::unique_ptr<grpc::cpp::test::util::TestService::Stub> stub_; std::unique_ptr<Server> server_; @@ -805,6 +876,82 @@ TEST_F(End2endTest, OverridePerCallCredentials) { EXPECT_TRUE(s.ok()); } +TEST_F(End2endTest, NonBlockingAuthMetadataProcessorSuccess) { + auto* processor = new TestAuthMetadataProcessor(false); + StartServer(std::shared_ptr<AuthMetadataProcessor>(processor)); + ResetStub(false); + EchoRequest request; + EchoResponse response; + ClientContext context; + context.set_credentials(processor->GetCompatibleClientCreds()); + request.set_message("Hello"); + request.mutable_param()->set_echo_metadata(true); + request.mutable_param()->set_expected_client_identity( + TestAuthMetadataProcessor::kGoodGuy); + + Status s = stub_->Echo(&context, request, &response); + EXPECT_EQ(request.message(), response.message()); + EXPECT_TRUE(s.ok()); + + // Metadata should have been consumed by the processor. + EXPECT_FALSE(MetadataContains( + context.GetServerTrailingMetadata(), GRPC_AUTHORIZATION_METADATA_KEY, + grpc::string("Bearer ") + TestAuthMetadataProcessor::kGoodGuy)); +} + +TEST_F(End2endTest, NonBlockingAuthMetadataProcessorFailure) { + auto* processor = new TestAuthMetadataProcessor(false); + StartServer(std::shared_ptr<AuthMetadataProcessor>(processor)); + ResetStub(false); + EchoRequest request; + EchoResponse response; + ClientContext context; + context.set_credentials(processor->GetIncompatibleClientCreds()); + request.set_message("Hello"); + + Status s = stub_->Echo(&context, request, &response); + EXPECT_FALSE(s.ok()); + EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED); +} + +TEST_F(End2endTest, BlockingAuthMetadataProcessorSuccess) { + auto* processor = new TestAuthMetadataProcessor(true); + StartServer(std::shared_ptr<AuthMetadataProcessor>(processor)); + ResetStub(false); + EchoRequest request; + EchoResponse response; + ClientContext context; + context.set_credentials(processor->GetCompatibleClientCreds()); + request.set_message("Hello"); + request.mutable_param()->set_echo_metadata(true); + request.mutable_param()->set_expected_client_identity( + TestAuthMetadataProcessor::kGoodGuy); + + Status s = stub_->Echo(&context, request, &response); + EXPECT_EQ(request.message(), response.message()); + EXPECT_TRUE(s.ok()); + + // Metadata should have been consumed by the processor. + EXPECT_FALSE(MetadataContains( + context.GetServerTrailingMetadata(), GRPC_AUTHORIZATION_METADATA_KEY, + grpc::string("Bearer ") + TestAuthMetadataProcessor::kGoodGuy)); +} + +TEST_F(End2endTest, BlockingAuthMetadataProcessorFailure) { + auto* processor = new TestAuthMetadataProcessor(true); + StartServer(std::shared_ptr<AuthMetadataProcessor>(processor)); + ResetStub(false); + EchoRequest request; + EchoResponse response; + ClientContext context; + context.set_credentials(processor->GetIncompatibleClientCreds()); + request.set_message("Hello"); + + Status s = stub_->Echo(&context, request, &response); + EXPECT_FALSE(s.ok()); + EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED); +} + // Client sends 20 requests and the server returns CANCELLED status after // reading 10 requests. TEST_F(End2endTest, RequestStreamServerEarlyCancelTest) { diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 7acbc711fb..6a46916728 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -40,13 +40,11 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include <grpc++/generic/async_generic_service.h> #include <grpc++/generic/generic_stub.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <grpc++/support/slice.h> #include <gtest/gtest.h> diff --git a/test/cpp/end2end/mock_test.cc b/test/cpp/end2end/mock_test.cc index 077d21aa72..4450e29f09 100644 --- a/test/cpp/end2end/mock_test.cc +++ b/test/cpp/end2end/mock_test.cc @@ -39,11 +39,9 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <gtest/gtest.h> #include "test/core/util/port.h" diff --git a/test/cpp/end2end/server_crash_test.cc b/test/cpp/end2end/server_crash_test.cc index 1a0f04e22b..4b6793abe6 100644 --- a/test/cpp/end2end/server_crash_test.cc +++ b/test/cpp/end2end/server_crash_test.cc @@ -37,11 +37,9 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <gtest/gtest.h> #include "test/core/util/port.h" diff --git a/test/cpp/end2end/server_crash_test_client.cc b/test/cpp/end2end/server_crash_test_client.cc index 6ff42fcb30..17869362c2 100644 --- a/test/cpp/end2end/server_crash_test_client.cc +++ b/test/cpp/end2end/server_crash_test_client.cc @@ -40,7 +40,6 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include "test/cpp/util/echo.grpc.pb.h" DEFINE_string(address, "", "Address to connect to"); diff --git a/test/cpp/end2end/shutdown_test.cc b/test/cpp/end2end/shutdown_test.cc index 59fec6ad40..a25f85cc75 100644 --- a/test/cpp/end2end/shutdown_test.cc +++ b/test/cpp/end2end/shutdown_test.cc @@ -38,11 +38,9 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <gtest/gtest.h> #include "src/core/support/env.h" diff --git a/test/cpp/end2end/thread_stress_test.cc b/test/cpp/end2end/thread_stress_test.cc index 2a16481972..539e141d39 100644 --- a/test/cpp/end2end/thread_stress_test.cc +++ b/test/cpp/end2end/thread_stress_test.cc @@ -40,11 +40,9 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <gtest/gtest.h> #include "test/core/util/port.h" diff --git a/test/cpp/end2end/zookeeper_test.cc b/test/cpp/end2end/zookeeper_test.cc index 931541ca34..d4c7f0489f 100644 --- a/test/cpp/end2end/zookeeper_test.cc +++ b/test/cpp/end2end/zookeeper_test.cc @@ -34,11 +34,9 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <gtest/gtest.h> #include <grpc/grpc.h> #include <grpc/grpc_zookeeper.h> diff --git a/test/cpp/interop/client_helper.cc b/test/cpp/interop/client_helper.cc index 7093463fa8..f85aa6ad8e 100644 --- a/test/cpp/interop/client_helper.cc +++ b/test/cpp/interop/client_helper.cc @@ -45,7 +45,7 @@ #include <gflags/gflags.h> #include <grpc++/channel.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> #include "src/cpp/client/secure_credentials.h" #include "test/core/security/oauth2_utils.h" diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 73d1a143c4..48ccf06da9 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -44,7 +44,7 @@ #include <grpc/support/useful.h> #include <grpc++/channel.h> #include <grpc++/client_context.h> -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> #include "src/core/transport/stream_op.h" #include "test/cpp/interop/client_helper.h" diff --git a/test/cpp/interop/reconnect_interop_server.cc b/test/cpp/interop/reconnect_interop_server.cc index d4f171b1d0..f52417bae0 100644 --- a/test/cpp/interop/reconnect_interop_server.cc +++ b/test/cpp/interop/reconnect_interop_server.cc @@ -45,7 +45,6 @@ #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include "test/core/util/reconnect_server.h" #include "test/cpp/util/test_config.h" diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc index 4921fde9fa..03b6532447 100644 --- a/test/cpp/interop/server.cc +++ b/test/cpp/interop/server.cc @@ -46,7 +46,7 @@ #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> +#include <grpc++/security/server_credentials.h> #include "test/cpp/interop/server_helper.h" #include "test/cpp/util/test_config.h" diff --git a/test/cpp/interop/server_helper.cc b/test/cpp/interop/server_helper.cc index e897f4ebf0..015198354e 100644 --- a/test/cpp/interop/server_helper.cc +++ b/test/cpp/interop/server_helper.cc @@ -36,7 +36,7 @@ #include <memory> #include <gflags/gflags.h> -#include <grpc++/server_credentials.h> +#include <grpc++/security/server_credentials.h> #include "src/core/surface/call.h" #include "test/core/end2end/data/ssl_test_data.h" diff --git a/test/cpp/interop/server_helper.h b/test/cpp/interop/server_helper.h index 7b6b12cd4d..dc0ae1dccd 100644 --- a/test/cpp/interop/server_helper.h +++ b/test/cpp/interop/server_helper.h @@ -38,7 +38,7 @@ #include <grpc/compression.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> +#include <grpc++/security/server_credentials.h> namespace grpc { namespace testing { diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index 123dca6600..beef604856 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -31,8 +31,6 @@ * */ -#include <sys/signal.h> - #include <cassert> #include <chrono> #include <memory> diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 0e771d6b81..a63548b32d 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -31,7 +31,6 @@ * */ -#include <unistd.h> #include <list> #include <thread> #include <deque> diff --git a/test/cpp/qps/perf_db_client.h b/test/cpp/qps/perf_db_client.h index ae5d17074b..72ebe79c3c 100644 --- a/test/cpp/qps/perf_db_client.h +++ b/test/cpp/qps/perf_db_client.h @@ -41,7 +41,7 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> #include "test/cpp/qps/perf_db.grpc.pb.h" namespace grpc { diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc index 51e955a80a..4b4ca1a0ce 100644 --- a/test/cpp/qps/qps_worker.cc +++ b/test/cpp/qps/qps_worker.cc @@ -49,7 +49,7 @@ #include <grpc++/client_context.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> -#include <grpc++/server_credentials.h> +#include <grpc++/security/server_credentials.h> #include "test/core/util/grpc_profiler.h" #include "test/cpp/qps/qpstest.pb.h" diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 77415f42ce..c25d5afc6d 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -35,9 +35,6 @@ #include <functional> #include <memory> #include <mutex> -#include <sys/time.h> -#include <sys/resource.h> -#include <sys/signal.h> #include <thread> #include <gflags/gflags.h> @@ -49,7 +46,7 @@ #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> +#include <grpc++/security/server_credentials.h> #include <gtest/gtest.h> #include "test/cpp/qps/qpstest.grpc.pb.h" diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc index 29ec19cd4b..d930ba2464 100644 --- a/test/cpp/qps/server_sync.cc +++ b/test/cpp/qps/server_sync.cc @@ -31,8 +31,6 @@ * */ -#include <sys/signal.h> -#include <unistd.h> #include <thread> #include <gflags/gflags.h> @@ -43,7 +41,7 @@ #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> +#include <grpc++/security/server_credentials.h> #include "test/cpp/qps/qpstest.grpc.pb.h" #include "test/cpp/qps/server.h" diff --git a/test/cpp/util/cli_call_test.cc b/test/cpp/util/cli_call_test.cc index 0efa201622..b4133aa71a 100644 --- a/test/cpp/util/cli_call_test.cc +++ b/test/cpp/util/cli_call_test.cc @@ -37,11 +37,9 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include <gtest/gtest.h> #include "test/core/util/port.h" diff --git a/test/cpp/util/create_test_channel.cc b/test/cpp/util/create_test_channel.cc index e993d14e71..f0d5bfc7eb 100644 --- a/test/cpp/util/create_test_channel.cc +++ b/test/cpp/util/create_test_channel.cc @@ -34,7 +34,7 @@ #include "test/cpp/util/create_test_channel.h" #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> #include "test/core/end2end/data/ssl_test_data.h" diff --git a/test/cpp/util/create_test_channel.h b/test/cpp/util/create_test_channel.h index 1263d4ed68..a4750689a0 100644 --- a/test/cpp/util/create_test_channel.h +++ b/test/cpp/util/create_test_channel.h @@ -36,7 +36,7 @@ #include <memory> -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> namespace grpc { class Channel; diff --git a/test/cpp/util/grpc_cli.cc b/test/cpp/util/grpc_cli.cc index 22cac21f77..334b6efb6a 100644 --- a/test/cpp/util/grpc_cli.cc +++ b/test/cpp/util/grpc_cli.cc @@ -1,5 +1,5 @@ /* - * + * Copyright 2015, Google Inc. * All rights reserved. * @@ -67,7 +67,7 @@ #include <grpc/grpc.h> #include <grpc++/channel.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> #include <grpc++/support/string_ref.h> #include "test/cpp/util/cli_call.h" diff --git a/test/cpp/util/messages.proto b/test/cpp/util/messages.proto index 359d1db74f..a022707be9 100644 --- a/test/cpp/util/messages.proto +++ b/test/cpp/util/messages.proto @@ -40,6 +40,7 @@ message RequestParams { bool check_auth_context = 5; int32 response_message_length = 6; bool echo_peer = 7; + string expected_client_identity = 8; // will force check_auth_context. } message EchoRequest { |