aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/tests/request_with_payload.c
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2016-09-19 16:48:36 -0700
committerGravatar Muxi Yan <mxyan@google.com>2016-09-20 10:16:55 -0700
commit6d686451627122eeb5a07da2ede2cebc1c289acd (patch)
tree81ab20d2e2ac76832c3c74befbfdae3a83b0ae29 /test/core/end2end/tests/request_with_payload.c
parenta6a6fa4f12c5634d87d8b4e64fa50c3618586a7c (diff)
Update unit tests and fixtures with AUTHORITY_HEADER support option
Diffstat (limited to 'test/core/end2end/tests/request_with_payload.c')
-rw-r--r--test/core/end2end/tests/request_with_payload.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c
index 67208c050c..a0da85496d 100644
--- a/test/core/end2end/tests/request_with_payload.c
+++ b/test/core/end2end/tests/request_with_payload.c
@@ -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);
}