Minor end2end test update

pull/8241/head
Muxi Yan 8 years ago
parent 6d68645162
commit caa904486e
  1. 9
      test/core/end2end/tests/binary_metadata.c

@ -43,6 +43,8 @@
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/cq_verifier.h"
static char *authority;
static void *tag(intptr_t t) { return (void *)t; } static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
@ -147,7 +149,7 @@ static void test_request_response_with_metadata_and_payload(
int was_cancelled = 2; int was_cancelled = 2;
c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, 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(c);
grpc_metadata_array_init(&initial_metadata_recv); grpc_metadata_array_init(&initial_metadata_recv);
@ -248,7 +250,9 @@ static void test_request_response_with_metadata_and_payload(
GPR_ASSERT(status == GRPC_STATUS_OK); GPR_ASSERT(status == GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(details, "xyz")); GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo")); 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(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world")); GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you")); GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
@ -286,6 +290,7 @@ static void test_request_response_with_metadata_and_payload(
} }
void binary_metadata(grpc_end2end_test_config config) { void binary_metadata(grpc_end2end_test_config config) {
authority = validate_host_override_string("foo.test.google.fr", config);
test_request_response_with_metadata_and_payload(config); test_request_response_with_metadata_and_payload(config);
} }

Loading…
Cancel
Save