aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/tests
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-30 11:08:34 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-30 11:08:34 -0700
commita2779c122ec3b2c3b6a475afa2ed18145d1f1b61 (patch)
tree4bb994c4e08e1c1ab30ad1841decbbf863e05548 /test/core/end2end/tests
parent8f17c6c0283aeb78b615580529e98f1a28bf3c77 (diff)
parentd7029e1ee3232fea606ab79b684e24294b7f8836 (diff)
Merge github.com:grpc/grpc into but-maybe-i-want-to-poll
Conflicts: Makefile
Diffstat (limited to 'test/core/end2end/tests')
-rw-r--r--test/core/end2end/tests/request_response_with_payload_and_call_creds.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
index df1e9d7671..08443f19a5 100644
--- a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
+++ b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
@@ -111,6 +111,23 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy(f->client_cq);
}
+static void print_auth_context(int is_client, const grpc_auth_context *ctx) {
+ const grpc_auth_property *p;
+ grpc_auth_property_iterator it;
+ gpr_log(GPR_INFO, "%s peer:", is_client ? "client" : "server");
+ gpr_log(GPR_INFO, "\tauthenticated: %s",
+ grpc_auth_context_peer_is_authenticated(ctx) ? "YES" : "NO");
+ it = grpc_auth_context_peer_identity(ctx);
+ while ((p = grpc_auth_property_iterator_next(&it)) != NULL) {
+ gpr_log(GPR_INFO, "\t\t%s: %s", p->name, p->value);
+ }
+ gpr_log(GPR_INFO, "\tall properties:");
+ it = grpc_auth_context_property_iterator(ctx);
+ while ((p = grpc_auth_property_iterator_next(&it)) != NULL) {
+ gpr_log(GPR_INFO, "\t\t%s: %s", p->name, p->value);
+ }
+}
+
static void test_call_creds_failure(grpc_end2end_test_config config) {
grpc_call *c;
grpc_credentials *creds = NULL;
@@ -160,6 +177,7 @@ static void request_response_with_payload_and_call_creds(
size_t details_capacity = 0;
int was_cancelled = 2;
grpc_credentials *creds = NULL;
+ const grpc_auth_context *s_auth_context = NULL;
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.fr", deadline);
@@ -214,10 +232,13 @@ static void request_response_with_payload_and_call_creds(
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f.server, &s,
&call_details,
&request_metadata_recv,
- f.server_cq, f.server_cq,
+ f.server_cq, f.server_cq,
tag(101)));
cq_expect_completion(v_server, tag(101), 1);
cq_verify(v_server);
+ s_auth_context = grpc_call_auth_context(s);
+ GPR_ASSERT(s_auth_context != NULL);
+ print_auth_context(0, s_auth_context);
/* Cannot set creds on the server call object. */
GPR_ASSERT(grpc_call_set_credentials(s, NULL) != GRPC_CALL_OK);