Merge branch 'master' of https://github.com/grpc/grpc into zookeeper

pull/2882/head
Hongwei Wang 9 years ago
commit 72538b9103
  1. 3
      .gitignore
  2. 12
      BUILD
  3. 243
      Makefile
  4. 4
      build.json
  5. 6
      gRPC.podspec
  6. 6
      include/grpc++/client_context.h
  7. 6
      include/grpc++/server_context.h
  8. 10
      include/grpc/grpc.h
  9. 8
      src/compiler/generator_helpers.h
  10. 44
      src/core/channel/http_client_filter.c
  11. 10
      src/core/channel/http_server_filter.c
  12. 16
      src/core/client_config/resolvers/dns_resolver.c
  13. 43
      src/core/client_config/subchannel_factory_decorators/add_channel_arg.c
  14. 45
      src/core/client_config/subchannel_factory_decorators/add_channel_arg.h
  15. 84
      src/core/client_config/subchannel_factory_decorators/merge_channel_args.c
  16. 45
      src/core/client_config/subchannel_factory_decorators/merge_channel_args.h
  17. 18
      src/core/surface/channel.c
  18. 8
      src/core/surface/channel_connectivity.c
  19. 6
      src/core/surface/server.c
  20. 3
      src/core/transport/chttp2/alpn.c
  21. 11
      src/cpp/client/client_context.cc
  22. 11
      src/cpp/server/server_context.cc
  23. 2
      src/node/examples/math_server.js
  24. 2
      src/node/examples/route_guide_server.js
  25. 2
      src/node/examples/stock_server.js
  26. 44
      src/node/ext/server.cc
  27. 1
      src/node/ext/server.h
  28. 18
      src/node/ext/server_credentials.cc
  29. 1
      src/node/ext/server_credentials.h
  30. 4
      src/node/interop/interop_server.js
  31. 6
      src/node/src/server.js
  32. 3
      src/node/test/call_test.js
  33. 3
      src/node/test/end_to_end_test.js
  34. 3
      src/node/test/health_test.js
  35. 3
      src/node/test/math_client_test.js
  36. 19
      src/node/test/server_test.js
  37. 12
      src/node/test/surface_test.js
  38. 14
      src/objective-c/GRPCClient/GRPCCall.m
  39. 18
      src/objective-c/GRPCClient/private/GRPCCompletionQueue.h
  40. 2
      src/python/grpcio/.gitignore
  41. 1
      src/python/grpcio/MANIFEST.in
  42. 0
      src/python/grpcio/requirements.txt
  43. 4
      src/python/grpcio/setup.py
  44. 10
      src/python/grpcio_test/.gitignore
  45. 4
      src/python/grpcio_test/MANIFEST.in
  46. 57
      src/python/grpcio_test/commands.py
  47. 5
      src/python/grpcio_test/requirements.txt
  48. 3
      src/python/grpcio_test/setup.cfg
  49. 30
      src/python/grpcio_test/setup.py
  50. 30
      test/core/end2end/gen_build_json.py
  51. 25
      test/core/end2end/tests/channel_connectivity.c
  52. 220
      test/core/end2end/tests/default_host.c
  53. 4
      test/core/transport/chttp2/alpn_test.c
  54. 29
      test/cpp/end2end/end2end_test.cc
  55. 2
      test/cpp/util/messages.proto
  56. 4
      tools/doxygen/Doxyfile.core.internal
  57. 62
      tools/gce_setup/grpc_docker.sh
  58. 21
      tools/run_tests/build_python.sh
  59. 122
      tools/run_tests/python_tests.json
  60. 9
      tools/run_tests/run_python.sh
  61. 40
      tools/run_tests/run_tests.py
  62. 178
      tools/run_tests/sources_and_headers.json
  63. 103
      tools/run_tests/tests.json
  64. 65
      vsprojects/Grpc.mak
  65. 6
      vsprojects/grpc/grpc.vcxproj
  66. 15
      vsprojects/grpc/grpc.vcxproj.filters
  67. 6
      vsprojects/grpc_unsecure/grpc_unsecure.vcxproj
  68. 15
      vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters

3
.gitignore vendored

@ -33,3 +33,6 @@ coverage
# Makefile's cache
cache.mk
# Temporary test reports
report.xml

12
BUILD

@ -170,6 +170,8 @@ cc_library(
"src/core/client_config/resolvers/sockaddr_resolver.h",
"src/core/client_config/subchannel.h",
"src/core/client_config/subchannel_factory.h",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.h",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.h",
"src/core/client_config/uri_parser.h",
"src/core/compression/message_compress.h",
"src/core/debug/trace.h",
@ -290,6 +292,8 @@ cc_library(
"src/core/client_config/resolvers/sockaddr_resolver.c",
"src/core/client_config/subchannel.c",
"src/core/client_config/subchannel_factory.c",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.c",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.c",
"src/core/client_config/uri_parser.c",
"src/core/compression/algorithm.c",
"src/core/compression/message_compress.c",
@ -428,6 +432,8 @@ cc_library(
"src/core/client_config/resolvers/sockaddr_resolver.h",
"src/core/client_config/subchannel.h",
"src/core/client_config/subchannel_factory.h",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.h",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.h",
"src/core/client_config/uri_parser.h",
"src/core/compression/message_compress.h",
"src/core/debug/trace.h",
@ -525,6 +531,8 @@ cc_library(
"src/core/client_config/resolvers/sockaddr_resolver.c",
"src/core/client_config/subchannel.c",
"src/core/client_config/subchannel_factory.c",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.c",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.c",
"src/core/client_config/uri_parser.c",
"src/core/compression/algorithm.c",
"src/core/compression/message_compress.c",
@ -1029,6 +1037,8 @@ objc_library(
"src/core/client_config/resolvers/sockaddr_resolver.c",
"src/core/client_config/subchannel.c",
"src/core/client_config/subchannel_factory.c",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.c",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.c",
"src/core/client_config/uri_parser.c",
"src/core/compression/algorithm.c",
"src/core/compression/message_compress.c",
@ -1169,6 +1179,8 @@ objc_library(
"src/core/client_config/resolvers/sockaddr_resolver.h",
"src/core/client_config/subchannel.h",
"src/core/client_config/subchannel_factory.h",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.h",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.h",
"src/core/client_config/uri_parser.h",
"src/core/compression/message_compress.h",
"src/core/debug/trace.h",

File diff suppressed because one or more lines are too long

@ -135,6 +135,8 @@
"src/core/client_config/resolvers/sockaddr_resolver.h",
"src/core/client_config/subchannel.h",
"src/core/client_config/subchannel_factory.h",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.h",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.h",
"src/core/client_config/uri_parser.h",
"src/core/compression/message_compress.h",
"src/core/debug/trace.h",
@ -231,6 +233,8 @@
"src/core/client_config/resolvers/sockaddr_resolver.c",
"src/core/client_config/subchannel.c",
"src/core/client_config/subchannel_factory.c",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.c",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.c",
"src/core/client_config/uri_parser.c",
"src/core/compression/algorithm.c",
"src/core/compression/message_compress.c",

@ -172,6 +172,8 @@ Pod::Spec.new do |s|
'src/core/client_config/resolvers/sockaddr_resolver.h',
'src/core/client_config/subchannel.h',
'src/core/client_config/subchannel_factory.h',
'src/core/client_config/subchannel_factory_decorators/add_channel_arg.h',
'src/core/client_config/subchannel_factory_decorators/merge_channel_args.h',
'src/core/client_config/uri_parser.h',
'src/core/compression/message_compress.h',
'src/core/debug/trace.h',
@ -299,6 +301,8 @@ Pod::Spec.new do |s|
'src/core/client_config/resolvers/sockaddr_resolver.c',
'src/core/client_config/subchannel.c',
'src/core/client_config/subchannel_factory.c',
'src/core/client_config/subchannel_factory_decorators/add_channel_arg.c',
'src/core/client_config/subchannel_factory_decorators/merge_channel_args.c',
'src/core/client_config/uri_parser.c',
'src/core/compression/algorithm.c',
'src/core/compression/message_compress.c',
@ -438,6 +442,8 @@ Pod::Spec.new do |s|
'src/core/client_config/resolvers/sockaddr_resolver.h',
'src/core/client_config/subchannel.h',
'src/core/client_config/subchannel_factory.h',
'src/core/client_config/subchannel_factory_decorators/add_channel_arg.h',
'src/core/client_config/subchannel_factory_decorators/merge_channel_args.h',
'src/core/client_config/uri_parser.h',
'src/core/compression/message_compress.h',
'src/core/debug/trace.h',

@ -118,6 +118,12 @@ class ClientContext {
std::shared_ptr<const AuthContext> auth_context() const;
// Return the peer uri in a string.
// WARNING: this value is never authenticated or subject to any security
// related code. It must not be used for any authentication related
// functionality. Instead, use auth_context.
grpc::string peer() const;
// Get and set census context
void set_census_context(struct census_context* ccp) { census_context_ = ccp; }
struct census_context* census_context() const { return census_context_; }

@ -117,6 +117,12 @@ class ServerContext {
std::shared_ptr<const AuthContext> auth_context() const;
// Return the peer uri in a string.
// WARNING: this value is never authenticated or subject to any security
// related code. It must not be used for any authentication related
// functionality. Instead, use auth_context.
grpc::string peer() const;
const struct census_context* census_context() const;
private:

@ -126,6 +126,8 @@ typedef struct {
/** Initial sequence number for http2 transports */
#define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \
"grpc.http2.initial_sequence_number"
/** Default authority to pass if none specified on call construction */
#define GRPC_ARG_DEFAULT_AUTHORITY "grpc.default_authority"
/** Primary user agent: goes at the start of the user-agent metadata
sent on each request */
#define GRPC_ARG_PRIMARY_USER_AGENT_STRING "grpc.primary_user_agent"
@ -420,14 +422,10 @@ grpc_connectivity_state grpc_channel_check_connectivity_state(
Once the channel connectivity state is different from last_observed_state,
tag will be enqueued on cq with success=1.
If deadline expires BEFORE the state is changed, tag will be enqueued on cq
with success=0.
If optional_new_state is non-NULL, it will be set to the newly observed
connectivity state of the channel at the same point as tag is enqueued onto
the completion queue. */
with success=0. */
void grpc_channel_watch_connectivity_state(
grpc_channel *channel, grpc_connectivity_state last_observed_state,
grpc_connectivity_state *optional_new_state, gpr_timespec deadline,
grpc_completion_queue *cq, void *tag);
gpr_timespec deadline, grpc_completion_queue *cq, void *tag);
/** Create a call given a grpc_channel, in order to call 'method'. All
completions are sent to 'completion_queue'. 'method' and 'host' need only

@ -126,7 +126,13 @@ inline grpc::string LowerUnderscoreToUpperCamel(grpc::string str) {
}
inline grpc::string FileNameInUpperCamel(const grpc::protobuf::FileDescriptor *file) {
return LowerUnderscoreToUpperCamel(StripProto(file->name()));
std::vector<grpc::string> tokens = tokenize(StripProto(file->name()), "/");
grpc::string result = "";
for (unsigned int i = 0; i < tokens.size() - 1; i++) {
result += tokens[i] + "/";
}
result += LowerUnderscoreToUpperCamel(tokens.back());
return result;
}
enum MethodType {

@ -40,10 +40,12 @@
typedef struct call_data {
grpc_linked_mdelem method;
grpc_linked_mdelem scheme;
grpc_linked_mdelem authority;
grpc_linked_mdelem te_trailers;
grpc_linked_mdelem content_type;
grpc_linked_mdelem user_agent;
int sent_initial_metadata;
int sent_authority;
int got_initial_metadata;
grpc_stream_op_buffer *recv_ops;
@ -62,6 +64,7 @@ typedef struct channel_data {
grpc_mdelem *scheme;
grpc_mdelem *content_type;
grpc_mdelem *status;
grpc_mdelem *default_authority;
/** complete user agent mdelem */
grpc_mdelem *user_agent;
} channel_data;
@ -100,6 +103,7 @@ static void hc_on_recv(void *user_data, int success) {
static grpc_mdelem *client_strip_filter(void *user_data, grpc_mdelem *md) {
grpc_call_element *elem = user_data;
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
/* eat the things we'd like to set ourselves */
if (md->key == channeld->method->key) return NULL;
@ -107,6 +111,10 @@ static grpc_mdelem *client_strip_filter(void *user_data, grpc_mdelem *md) {
if (md->key == channeld->te_trailers->key) return NULL;
if (md->key == channeld->content_type->key) return NULL;
if (md->key == channeld->user_agent->key) return NULL;
if (channeld->default_authority &&
channeld->default_authority->key == md->key) {
calld->sent_authority = 1;
}
return md;
}
@ -130,6 +138,11 @@ static void hc_mutate_op(grpc_call_element *elem,
GRPC_MDELEM_REF(channeld->method));
grpc_metadata_batch_add_head(&op->data.metadata, &calld->scheme,
GRPC_MDELEM_REF(channeld->scheme));
if (channeld->default_authority && !calld->sent_authority) {
grpc_metadata_batch_add_head(
&op->data.metadata, &calld->authority,
GRPC_MDELEM_REF(channeld->default_authority));
}
grpc_metadata_batch_add_tail(&op->data.metadata, &calld->te_trailers,
GRPC_MDELEM_REF(channeld->te_trailers));
grpc_metadata_batch_add_tail(&op->data.metadata, &calld->content_type,
@ -162,6 +175,7 @@ static void init_call_elem(grpc_call_element *elem,
call_data *calld = elem->call_data;
calld->sent_initial_metadata = 0;
calld->got_initial_metadata = 0;
calld->sent_authority = 0;
calld->on_done_recv = NULL;
grpc_iomgr_closure_init(&calld->hc_on_recv, hc_on_recv, elem);
if (initial_op) hc_mutate_op(elem, initial_op);
@ -241,8 +255,10 @@ static grpc_mdstr *user_agent_from_args(grpc_mdctx *mdctx,
/* Constructor for channel_data */
static void init_channel_elem(grpc_channel_element *elem, grpc_channel *master,
const grpc_channel_args *args, grpc_mdctx *mdctx,
int is_first, int is_last) {
const grpc_channel_args *channel_args,
grpc_mdctx *mdctx, int is_first, int is_last) {
size_t i;
/* grab pointers to our data from the channel element */
channel_data *channeld = elem->channel_data;
@ -251,17 +267,32 @@ static void init_channel_elem(grpc_channel_element *elem, grpc_channel *master,
path */
GPR_ASSERT(!is_last);
channeld->default_authority = NULL;
if (channel_args) {
for (i = 0; i < channel_args->num_args; i++) {
if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_DEFAULT_AUTHORITY)) {
if (channel_args->args[i].type != GRPC_ARG_STRING) {
gpr_log(GPR_ERROR, "%s: must be an string",
GRPC_ARG_DEFAULT_AUTHORITY);
} else {
channeld->default_authority = grpc_mdelem_from_strings(
mdctx, ":authority", channel_args->args[i].value.string);
}
}
}
}
/* initialize members */
channeld->te_trailers = grpc_mdelem_from_strings(mdctx, "te", "trailers");
channeld->method = grpc_mdelem_from_strings(mdctx, ":method", "POST");
channeld->scheme =
grpc_mdelem_from_strings(mdctx, ":scheme", scheme_from_args(args));
channeld->scheme = grpc_mdelem_from_strings(mdctx, ":scheme",
scheme_from_args(channel_args));
channeld->content_type =
grpc_mdelem_from_strings(mdctx, "content-type", "application/grpc");
channeld->status = grpc_mdelem_from_strings(mdctx, ":status", "200");
channeld->user_agent = grpc_mdelem_from_metadata_strings(
mdctx, grpc_mdstr_from_string(mdctx, "user-agent", 0),
user_agent_from_args(mdctx, args));
user_agent_from_args(mdctx, channel_args));
}
/* Destructor for channel data */
@ -275,6 +306,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
GRPC_MDELEM_UNREF(channeld->content_type);
GRPC_MDELEM_UNREF(channeld->status);
GRPC_MDELEM_UNREF(channeld->user_agent);
if (channeld->default_authority) {
GRPC_MDELEM_UNREF(channeld->default_authority);
}
}
const grpc_channel_filter grpc_http_client_filter = {

@ -44,6 +44,7 @@ typedef struct call_data {
gpr_uint8 sent_status;
gpr_uint8 seen_scheme;
gpr_uint8 seen_te_trailers;
gpr_uint8 seen_authority;
grpc_linked_mdelem status;
grpc_stream_op_buffer *recv_ops;
@ -125,6 +126,9 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) {
}
calld->seen_path = 1;
return md;
} else if (md->key == channeld->authority_key) {
calld->seen_authority = 1;
return md;
} else if (md->key == channeld->host_key) {
/* translate host to :authority since :authority may be
omitted */
@ -132,6 +136,7 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) {
channeld->mdctx, GRPC_MDSTR_REF(channeld->authority_key),
GRPC_MDSTR_REF(md->value));
GRPC_MDELEM_UNREF(md);
calld->seen_authority = 1;
return authority;
} else {
return md;
@ -154,12 +159,15 @@ static void hs_on_recv(void *user_data, int success) {
(:method, :scheme, content-type, with :path and :authority covered
at the channel level right now) */
if (calld->seen_post && calld->seen_scheme && calld->seen_te_trailers &&
calld->seen_path) {
calld->seen_path && calld->seen_authority) {
/* do nothing */
} else {
if (!calld->seen_path) {
gpr_log(GPR_ERROR, "Missing :path header");
}
if (!calld->seen_authority) {
gpr_log(GPR_ERROR, "Missing :authority header");
}
if (!calld->seen_post) {
gpr_log(GPR_ERROR, "Missing :method header");
}

@ -36,9 +36,11 @@
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/string_util.h>
#include "src/core/client_config/lb_policies/pick_first.h"
#include "src/core/client_config/subchannel_factory_decorators/add_channel_arg.h"
#include "src/core/iomgr/resolve_address.h"
#include "src/core/support/string.h"
@ -201,6 +203,9 @@ static grpc_resolver *dns_create(
grpc_subchannel_factory *subchannel_factory) {
dns_resolver *r;
const char *path = uri->path;
grpc_arg default_host_arg;
char *host;
char *port;
if (0 != strcmp(uri->authority, "")) {
gpr_log(GPR_ERROR, "authority based uri's not supported");
@ -209,6 +214,16 @@ static grpc_resolver *dns_create(
if (path[0] == '/') ++path;
gpr_split_host_port(path, &host, &port);
default_host_arg.type = GRPC_ARG_STRING;
default_host_arg.key = GRPC_ARG_DEFAULT_AUTHORITY;
default_host_arg.value.string = host;
subchannel_factory = grpc_subchannel_factory_add_channel_arg(subchannel_factory, &default_host_arg);
gpr_free(host);
gpr_free(port);
r = gpr_malloc(sizeof(dns_resolver));
memset(r, 0, sizeof(*r));
gpr_ref_init(&r->refs, 1);
@ -218,7 +233,6 @@ static grpc_resolver *dns_create(
r->default_port = gpr_strdup(default_port);
r->subchannel_factory = subchannel_factory;
r->lb_policy_factory = lb_policy_factory;
grpc_subchannel_factory_ref(subchannel_factory);
return &r->base;
}

@ -0,0 +1,43 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "src/core/client_config/subchannel_factory_decorators/add_channel_arg.h"
#include "src/core/client_config/subchannel_factory_decorators/merge_channel_args.h"
grpc_subchannel_factory *grpc_subchannel_factory_add_channel_arg(
grpc_subchannel_factory *input, const grpc_arg *arg) {
grpc_channel_args args;
args.num_args = 1;
args.args = (grpc_arg *)arg;
return grpc_subchannel_factory_merge_channel_args(input, &args);
}

@ -0,0 +1,45 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_ADD_CHANNEL_ARG_H
#define GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_ADD_CHANNEL_ARG_H
#include "src/core/client_config/subchannel_factory.h"
/** Takes a subchannel factory, returns a new one that mutates incoming
channel_args by adding a new argument; ownership of input, arg is retained
by the caller. */
grpc_subchannel_factory *grpc_subchannel_factory_add_channel_arg(
grpc_subchannel_factory *input, const grpc_arg *arg);
#endif /* GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_ADD_CHANNEL_ARG_H */

@ -0,0 +1,84 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "src/core/client_config/subchannel_factory_decorators/merge_channel_args.h"
#include <grpc/support/alloc.h>
#include "src/core/channel/channel_args.h"
typedef struct {
grpc_subchannel_factory base;
gpr_refcount refs;
grpc_subchannel_factory *wrapped;
grpc_channel_args *merge_args;
} merge_args_factory;
static void merge_args_factory_ref(grpc_subchannel_factory *scf) {
merge_args_factory *f = (merge_args_factory *)scf;
gpr_ref(&f->refs);
}
static void merge_args_factory_unref(grpc_subchannel_factory *scf) {
merge_args_factory *f = (merge_args_factory *)scf;
if (gpr_unref(&f->refs)) {
grpc_subchannel_factory_unref(f->wrapped);
grpc_channel_args_destroy(f->merge_args);
gpr_free(f);
}
}
static grpc_subchannel *merge_args_factory_create_subchannel(
grpc_subchannel_factory *scf, grpc_subchannel_args *args) {
merge_args_factory *f = (merge_args_factory *)scf;
grpc_channel_args *final_args =
grpc_channel_args_merge(args->args, f->merge_args);
grpc_subchannel *s;
args->args = final_args;
s = grpc_subchannel_factory_create_subchannel(f->wrapped, args);
grpc_channel_args_destroy(final_args);
return s;
}
static const grpc_subchannel_factory_vtable merge_args_factory_vtable = {
merge_args_factory_ref, merge_args_factory_unref,
merge_args_factory_create_subchannel};
grpc_subchannel_factory *grpc_subchannel_factory_merge_channel_args(
grpc_subchannel_factory *input, const grpc_channel_args *args) {
merge_args_factory *f = gpr_malloc(sizeof(*f));
f->base.vtable = &merge_args_factory_vtable;
gpr_ref_init(&f->refs, 1);
grpc_subchannel_factory_ref(input);
f->wrapped = input;
f->merge_args = grpc_channel_args_copy(args);
return &f->base;
}

@ -0,0 +1,45 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_MERGE_CHANNEL_ARGS_H
#define GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_MERGE_CHANNEL_ARGS_H
#include "src/core/client_config/subchannel_factory.h"
/** Takes a subchannel factory, returns a new one that mutates incoming
channel_args by adding a new argument; ownership of input, args is retained
by the caller. */
grpc_subchannel_factory *grpc_subchannel_factory_merge_channel_args(
grpc_subchannel_factory *input, const grpc_channel_args *args);
#endif /* GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_MERGE_CHANNEL_ARGS_H */

@ -150,14 +150,17 @@ static grpc_call *grpc_channel_create_call_internal(
grpc_channel *channel, grpc_completion_queue *cq, grpc_mdelem *path_mdelem,
grpc_mdelem *authority_mdelem, gpr_timespec deadline) {
grpc_mdelem *send_metadata[2];
int num_metadata = 0;
GPR_ASSERT(channel->is_client);
send_metadata[0] = path_mdelem;
send_metadata[1] = authority_mdelem;
send_metadata[num_metadata++] = path_mdelem;
if (authority_mdelem != NULL) {
send_metadata[num_metadata++] = authority_mdelem;
}
return grpc_call_create(channel, cq, NULL, send_metadata,
GPR_ARRAY_SIZE(send_metadata), deadline);
num_metadata, deadline);
}
grpc_call *grpc_channel_create_call(grpc_channel *channel,
@ -169,9 +172,10 @@ grpc_call *grpc_channel_create_call(grpc_channel *channel,
grpc_mdelem_from_metadata_strings(
channel->metadata_context, GRPC_MDSTR_REF(channel->path_string),
grpc_mdstr_from_string(channel->metadata_context, method, 0)),
host ?
grpc_mdelem_from_metadata_strings(
channel->metadata_context, GRPC_MDSTR_REF(channel->authority_string),
grpc_mdstr_from_string(channel->metadata_context, host, 0)),
grpc_mdstr_from_string(channel->metadata_context, host, 0)) : NULL,
deadline);
}
@ -181,9 +185,9 @@ void *grpc_channel_register_call(grpc_channel *channel, const char *method,
rc->path = grpc_mdelem_from_metadata_strings(
channel->metadata_context, GRPC_MDSTR_REF(channel->path_string),
grpc_mdstr_from_string(channel->metadata_context, method, 0));
rc->authority = grpc_mdelem_from_metadata_strings(
rc->authority = host ? grpc_mdelem_from_metadata_strings(
channel->metadata_context, GRPC_MDSTR_REF(channel->authority_string),
grpc_mdstr_from_string(channel->metadata_context, host, 0));
grpc_mdstr_from_string(channel->metadata_context, host, 0)) : NULL;
gpr_mu_lock(&channel->registered_call_mu);
rc->next = channel->registered_calls;
channel->registered_calls = rc;
@ -197,7 +201,7 @@ grpc_call *grpc_channel_create_registered_call(
registered_call *rc = registered_call_handle;
return grpc_channel_create_call_internal(
channel, completion_queue, GRPC_MDELEM_REF(rc->path),
GRPC_MDELEM_REF(rc->authority), deadline);
rc->authority ? GRPC_MDELEM_REF(rc->authority) : NULL, deadline);
}
#ifdef GRPC_CHANNEL_REF_COUNT_DEBUG

@ -70,7 +70,6 @@ typedef struct {
grpc_iomgr_closure on_complete;
grpc_alarm alarm;
grpc_connectivity_state state;
grpc_connectivity_state *optional_new_state;
grpc_completion_queue *cq;
grpc_cq_completion completion_storage;
grpc_channel *channel;
@ -124,9 +123,6 @@ static void partly_done(state_watcher *w, int due_to_completion) {
switch (w->phase) {
case WAITING:
w->phase = CALLING_BACK;
if (w->optional_new_state) {
*w->optional_new_state = w->state;
}
grpc_cq_end_op(w->cq, w->tag, w->success, finished_completion, w,
&w->completion_storage);
break;
@ -154,8 +150,7 @@ static void timeout_complete(void *pw, int success) { partly_done(pw, 0); }
void grpc_channel_watch_connectivity_state(
grpc_channel *channel, grpc_connectivity_state last_observed_state,
grpc_connectivity_state *optional_new_state, gpr_timespec deadline,
grpc_completion_queue *cq, void *tag) {
gpr_timespec deadline, grpc_completion_queue *cq, void *tag) {
grpc_channel_element *client_channel_elem =
grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
state_watcher *w = gpr_malloc(sizeof(*w));
@ -167,7 +162,6 @@ void grpc_channel_watch_connectivity_state(
w->phase = WAITING;
w->state = last_observed_state;
w->success = 0;
w->optional_new_state = optional_new_state;
w->cq = cq;
w->tag = tag;
w->channel = channel;

@ -554,8 +554,10 @@ static void server_on_recv(void *ptr, int success) {
gpr_time_cmp(op_deadline, gpr_inf_future(op_deadline.clock_type))) {
calld->deadline = op->data.metadata.deadline;
}
calld->got_initial_metadata = 1;
start_new_rpc(elem);
if (calld->host && calld->path) {
calld->got_initial_metadata = 1;
start_new_rpc(elem);
}
break;
}
}

@ -36,8 +36,7 @@
#include <grpc/support/useful.h>
/* in order of preference */
static const char *const supported_versions[] = {"h2", "h2-17", "h2-16",
"h2-15", "h2-14"};
static const char *const supported_versions[] = {"h2"};
int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size) {
size_t i;

@ -34,6 +34,7 @@
#include <grpc++/client_context.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc++/credentials.h>
#include <grpc++/time.h>
@ -104,4 +105,14 @@ void ClientContext::TryCancel() {
}
}
grpc::string ClientContext::peer() const {
grpc::string peer;
if (call_) {
char* c_peer = grpc_call_get_peer(call_);
peer = c_peer;
gpr_free(c_peer);
}
return peer;
}
} // namespace grpc

@ -34,6 +34,7 @@
#include <grpc++/server_context.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc++/impl/call.h>
#include <grpc++/impl/sync.h>
@ -179,6 +180,16 @@ std::shared_ptr<const AuthContext> ServerContext::auth_context() const {
return auth_context_;
}
grpc::string ServerContext::peer() const {
grpc::string peer;
if (call_) {
char* c_peer = grpc_call_get_peer(call_);
peer = c_peer;
gpr_free(c_peer);
}
return peer;
}
const struct census_context* ServerContext::census_context() const {
return grpc_census_call_get_context(call_);
}

@ -115,7 +115,7 @@ server.addProtoService(math.Math.service, {
});
if (require.main === module) {
server.bind('0.0.0.0:50051');
server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
server.start();
}

@ -239,7 +239,7 @@ function getServer() {
if (require.main === module) {
// If this is run as a script, start a server on an unused port
var routeServer = getServer();
routeServer.bind('0.0.0.0:50051');
routeServer.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
var argv = parseArgs(process.argv, {
string: 'db_path'
});

@ -80,7 +80,7 @@ stockServer.addProtoService(examples.Stock.service, {
});
if (require.main === module) {
stockServer.bind('0.0.0.0:50051');
stockServer.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
stockServer.listen();
}

@ -136,10 +136,6 @@ void Server::Init(Handle<Object> exports) {
tpl, "addHttp2Port",
NanNew<FunctionTemplate>(AddHttp2Port)->GetFunction());
NanSetPrototypeTemplate(
tpl, "addSecureHttp2Port",
NanNew<FunctionTemplate>(AddSecureHttp2Port)->GetFunction());
NanSetPrototypeTemplate(tpl, "start",
NanNew<FunctionTemplate>(Start)->GetFunction());
@ -246,45 +242,37 @@ NAN_METHOD(Server::RequestCall) {
}
NAN_METHOD(Server::AddHttp2Port) {
NanScope();
if (!HasInstance(args.This())) {
return NanThrowTypeError("addHttp2Port can only be called on a Server");
}
if (!args[0]->IsString()) {
return NanThrowTypeError("addHttp2Port's argument must be a String");
}
Server *server = ObjectWrap::Unwrap<Server>(args.This());
if (server->wrapped_server == NULL) {
return NanThrowError("addHttp2Port cannot be called on a shut down Server");
}
NanReturnValue(NanNew<Number>(grpc_server_add_http2_port(
server->wrapped_server, *NanUtf8String(args[0]))));
}
NAN_METHOD(Server::AddSecureHttp2Port) {
NanScope();
if (!HasInstance(args.This())) {
return NanThrowTypeError(
"addSecureHttp2Port can only be called on a Server");
"addHttp2Port can only be called on a Server");
}
if (!args[0]->IsString()) {
return NanThrowTypeError(
"addSecureHttp2Port's first argument must be a String");
"addHttp2Port's first argument must be a String");
}
if (!ServerCredentials::HasInstance(args[1])) {
return NanThrowTypeError(
"addSecureHttp2Port's second argument must be ServerCredentials");
"addHttp2Port's second argument must be ServerCredentials");
}
Server *server = ObjectWrap::Unwrap<Server>(args.This());
if (server->wrapped_server == NULL) {
return NanThrowError(
"addSecureHttp2Port cannot be called on a shut down Server");
"addHttp2Port cannot be called on a shut down Server");
}
ServerCredentials *creds = ObjectWrap::Unwrap<ServerCredentials>(
ServerCredentials *creds_object = ObjectWrap::Unwrap<ServerCredentials>(
args[1]->ToObject());
NanReturnValue(NanNew<Number>(grpc_server_add_secure_http2_port(
server->wrapped_server, *NanUtf8String(args[0]),
creds->GetWrappedServerCredentials())));
grpc_server_credentials *creds = creds_object->GetWrappedServerCredentials();
int port;
if (creds == NULL) {
port = grpc_server_add_http2_port(server->wrapped_server,
*NanUtf8String(args[0]));
} else {
port = grpc_server_add_secure_http2_port(server->wrapped_server,
*NanUtf8String(args[0]),
creds);
}
NanReturnValue(NanNew<Number>(port));
}
NAN_METHOD(Server::Start) {

@ -66,7 +66,6 @@ class Server : public ::node::ObjectWrap {
static NAN_METHOD(New);
static NAN_METHOD(RequestCall);
static NAN_METHOD(AddHttp2Port);
static NAN_METHOD(AddSecureHttp2Port);
static NAN_METHOD(Start);
static NAN_METHOD(Shutdown);
static NanCallback *constructor;

@ -73,6 +73,8 @@ void ServerCredentials::Init(Handle<Object> exports) {
Handle<Function> ctr = tpl->GetFunction();
ctr->Set(NanNew("createSsl"),
NanNew<FunctionTemplate>(CreateSsl)->GetFunction());
ctr->Set(NanNew("createInsecure"),
NanNew<FunctionTemplate>(CreateInsecure)->GetFunction());
constructor = new NanCallback(ctr);
exports->Set(NanNew("ServerCredentials"), ctr);
}
@ -85,9 +87,6 @@ bool ServerCredentials::HasInstance(Handle<Value> val) {
Handle<Value> ServerCredentials::WrapStruct(
grpc_server_credentials *credentials) {
NanEscapableScope();
if (credentials == NULL) {
return NanEscapeScope(NanNull());
}
const int argc = 1;
Handle<Value> argv[argc] = {
NanNew<External>(reinterpret_cast<void *>(credentials))};
@ -140,8 +139,17 @@ NAN_METHOD(ServerCredentials::CreateSsl) {
key_cert_pair.cert_chain = ::node::Buffer::Data(args[2]);
// TODO Add a force_client_auth parameter and pass it as the last parameter
// here.
NanReturnValue(WrapStruct(
grpc_ssl_server_credentials_create(root_certs, &key_cert_pair, 1, 0)));
grpc_server_credentials *creds =
grpc_ssl_server_credentials_create(root_certs, &key_cert_pair, 1, 0);
if (creds == NULL) {
NanReturnNull();
}
NanReturnValue(WrapStruct(creds));
}
NAN_METHOD(ServerCredentials::CreateInsecure) {
NanScope();
NanReturnValue(WrapStruct(NULL));
}
} // namespace node

@ -63,6 +63,7 @@ class ServerCredentials : public ::node::ObjectWrap {
static NAN_METHOD(New);
static NAN_METHOD(CreateSsl);
static NAN_METHOD(CreateInsecure);
static NanCallback *constructor;
// Used for typechecking instances of this javascript class
static v8::Persistent<v8::FunctionTemplate> fun_tpl;

@ -161,7 +161,7 @@ function handleHalfDuplex(call) {
function getServer(port, tls) {
// TODO(mlumish): enable TLS functionality
var options = {};
var server_creds = null;
var server_creds;
if (tls) {
var key_path = path.join(__dirname, '../test/data/server1.key');
var pem_path = path.join(__dirname, '../test/data/server1.pem');
@ -171,6 +171,8 @@ function getServer(port, tls) {
server_creds = grpc.ServerCredentials.createSsl(null,
key_data,
pem_data);
} else {
server_creds = grpc.ServerCredentials.createInsecure();
}
var server = new grpc.Server(options);
server.addProtoService(testProto.TestService.service, {

@ -714,11 +714,7 @@ Server.prototype.bind = function(port, creds) {
if (this.started) {
throw new Error('Can\'t bind an already running server to an address');
}
if (creds) {
return this._server.addSecureHttp2Port(port, creds);
} else {
return this._server.addHttp2Port(port);
}
return this._server.addHttp2Port(port, creds);
};
/**

@ -55,7 +55,8 @@ describe('call', function() {
var server;
before(function() {
server = new grpc.Server();
var port = server.addHttp2Port('localhost:0');
var port = server.addHttp2Port('localhost:0',
grpc.ServerCredentials.createInsecure());
server.start();
channel = new grpc.Channel('localhost:' + port, insecureCreds);
});

@ -64,7 +64,8 @@ describe('end-to-end', function() {
var channel;
before(function() {
server = new grpc.Server();
var port_num = server.addHttp2Port('0.0.0.0:0');
var port_num = server.addHttp2Port('0.0.0.0:0',
grpc.ServerCredentials.createInsecure());
server.start();
channel = new grpc.Channel('localhost:' + port_num, insecureCreds);
});

@ -54,7 +54,8 @@ describe('Health Checking', function() {
new health.Implementation(statusMap));
var healthClient;
before(function() {
var port_num = healthServer.bind('0.0.0.0:0');
var port_num = healthServer.bind('0.0.0.0:0',
grpc.ServerCredentials.createInsecure());
healthServer.start();
healthClient = new health.Client('localhost:' + port_num,
grpc.Credentials.createInsecure());

@ -51,7 +51,8 @@ var server = require('../examples/math_server.js');
describe('Math client', function() {
before(function(done) {
var port_num = server.bind('0.0.0.0:0');
var port_num = server.bind('0.0.0.0:0',
grpc.ServerCredentials.createInsecure());
server.start();
math_client = new math.Math('localhost:' + port_num,
grpc.Credentials.createInsecure());

@ -59,16 +59,11 @@ describe('server', function() {
it('should bind to an unused port', function() {
var port;
assert.doesNotThrow(function() {
port = server.addHttp2Port('0.0.0.0:0');
port = server.addHttp2Port('0.0.0.0:0',
grpc.ServerCredentials.createInsecure());
});
assert(port > 0);
});
});
describe('addSecureHttp2Port', function() {
var server;
before(function() {
server = new grpc.Server();
});
it('should bind to an unused port with ssl credentials', function() {
var port;
var key_path = path.join(__dirname, '../test/data/server1.key');
@ -77,16 +72,22 @@ describe('server', function() {
var pem_data = fs.readFileSync(pem_path);
var creds = grpc.ServerCredentials.createSsl(null, key_data, pem_data);
assert.doesNotThrow(function() {
port = server.addSecureHttp2Port('0.0.0.0:0', creds);
port = server.addHttp2Port('0.0.0.0:0', creds);
});
assert(port > 0);
});
});
describe('addSecureHttp2Port', function() {
var server;
before(function() {
server = new grpc.Server();
});
});
describe('listen', function() {
var server;
before(function() {
server = new grpc.Server();
server.addHttp2Port('0.0.0.0:0');
server.addHttp2Port('0.0.0.0:0', grpc.ServerCredentials.createInsecure());
});
after(function() {
server.shutdown();

@ -47,6 +47,8 @@ var mathService = math_proto.lookup('math.Math');
var _ = require('lodash');
var server_insecure_creds = grpc.ServerCredentials.createInsecure();
describe('File loader', function() {
it('Should load a proto file by default', function() {
assert.doesNotThrow(function() {
@ -122,7 +124,7 @@ describe('Echo service', function() {
callback(null, call.request);
}
});
var port = server.bind('localhost:0');
var port = server.bind('localhost:0', server_insecure_creds);
var Client = surface_client.makeProtobufClientConstructor(echo_service);
client = new Client('localhost:' + port, grpc.Credentials.createInsecure());
server.start();
@ -166,7 +168,7 @@ describe('Generic client and server', function() {
callback(null, _.capitalize(call.request));
}
});
var port = server.bind('localhost:0');
var port = server.bind('localhost:0', server_insecure_creds);
server.start();
var Client = grpc.makeGenericClientConstructor(string_service_attrs);
client = new Client('localhost:' + port,
@ -215,7 +217,7 @@ describe('Echo metadata', function() {
});
}
});
var port = server.bind('localhost:0');
var port = server.bind('localhost:0', server_insecure_creds);
var Client = surface_client.makeProtobufClientConstructor(test_service);
client = new Client('localhost:' + port, grpc.Credentials.createInsecure());
server.start();
@ -336,7 +338,7 @@ describe('Other conditions', function() {
});
}
});
port = server.bind('localhost:0');
port = server.bind('localhost:0', server_insecure_creds);
var Client = surface_client.makeProtobufClientConstructor(test_service);
client = new Client('localhost:' + port, grpc.Credentials.createInsecure());
server.start();
@ -602,7 +604,7 @@ describe('Cancelling surface client', function() {
'fib': function(stream) {},
'sum': function(stream) {}
});
var port = server.bind('localhost:0');
var port = server.bind('localhost:0', server_insecure_creds);
var Client = surface_client.makeProtobufClientConstructor(mathService);
client = new Client('localhost:' + port, grpc.Credentials.createInsecure());
server.start();

@ -38,7 +38,6 @@
#import <RxLibrary/GRXConcurrentWriteable.h>
#import "private/GRPCChannel.h"
#import "private/GRPCCompletionQueue.h"
#import "private/GRPCWrappedCall.h"
#import "private/NSData+GRPC.h"
#import "private/NSDictionary+GRPC.h"
@ -72,7 +71,6 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
dispatch_once_t _callAlreadyInvoked;
GRPCChannel *_channel;
GRPCCompletionQueue *_completionQueue;
// The C gRPC library has less guarantees on the ordering of events than we
// do. Particularly, in the face of errors, there's no ordering guarantee at
@ -100,19 +98,13 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
path:(NSString *)path
requestsWriter:(GRXWriter *)requestWriter {
if (!host || !path) {
[NSException raise:NSInvalidArgumentException format:@"Neither host nor method can be nil."];
[NSException raise:NSInvalidArgumentException format:@"Neither host nor path can be nil."];
}
if (requestWriter.state != GRXWriterStateNotStarted) {
[NSException raise:NSInvalidArgumentException format:@"The requests writer can't be already started."];
[NSException raise:NSInvalidArgumentException
format:@"The requests writer can't be already started."];
}
if ((self = [super init])) {
static dispatch_once_t initialization;
dispatch_once(&initialization, ^{
grpc_init();
});
_completionQueue = [GRPCCompletionQueue completionQueue];
_channel = [GRPCChannel channelToHost:host];
_wrappedCall = [[GRPCWrappedCall alloc] initWithChannel:_channel

@ -36,15 +36,15 @@
typedef void(^GRPCQueueCompletionHandler)(bool success);
// This class lets one more easily use grpc_completion_queue. To use it, pass
// the value of the unmanagedQueue property of an instance of this class to
// grpc_call_start_invoke. Then for every grpc_call_* method that accepts a tag,
// you can pass a block of type GRPCEventHandler (remembering to cast it using
// __bridge_retained). The block is guaranteed to eventually be called, by a
// concurrent queue, and then released. Each such block is passed a pointer to
// the grpc_event that carried it (in event->tag).
// Release the GRPCCompletionQueue object only after you are not going to pass
// any more blocks to the grpc_call that's using it.
// This class lets one more easily use |grpc_completion_queue|. To use it, pass the value of the
// |unmanagedQueue| property of an instance of this class to |grpc_channel_create_call|. Then for
// every |grpc_call_*| method that accepts a tag, you can pass a block of type
// |GRPCQueueCompletionHandler| (remembering to cast it using |__bridge_retained|). The block is
// guaranteed to eventually be called, by a concurrent queue, and then released. Each such block is
// passed a |bool| that tells if the operation was successful.
//
// Release the GRPCCompletionQueue object only after you are not going to pass any more blocks to
// the |grpc_call| that's using it.
@interface GRPCCompletionQueue : NSObject
@property(nonatomic, readonly) grpc_completion_queue *unmanagedQueue;

@ -1,5 +1,5 @@
MANIFEST
grpcio.egg-info/
*.egg-info/
build/
dist/
*.egg

@ -1,2 +1,3 @@
graft grpc
include commands.py
include requirements.txt

@ -89,7 +89,7 @@ _PACKAGE_DIRECTORIES = {
_INSTALL_REQUIRES = (
'enum34==1.0.4',
'futures==2.2.0',
'protobuf==3.0.0a3'
'protobuf==3.0.0a3',
)
_SETUP_REQUIRES = (
@ -97,7 +97,7 @@ _SETUP_REQUIRES = (
) + _INSTALL_REQUIRES
_COMMAND_CLASS = {
'doc': commands.SphinxDocumentation
'doc': commands.SphinxDocumentation,
}
setuptools.setup(

@ -0,0 +1,10 @@
MANIFEST
*.egg-info/
build/
dist/
*.egg
*.egg/
*.eggs/
.coverage
.coverage.*
nosetests.xml

@ -0,0 +1,4 @@
graft grpc_interop
graft grpc_test
include commands.py
include requirements.txt

@ -0,0 +1,57 @@
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Provides distutils command classes for the GRPC Python test setup process."""
import os
import os.path
import sys
import setuptools
class RunTests(setuptools.Command):
"""Command to run all tests via py.test."""
description = ''
user_options = [('pytest-args=', 'a', 'arguments to pass to py.test')]
def initialize_options(self):
self.pytest_args = []
def finalize_options(self):
pass
def run(self):
# We import here to ensure that setup.py has had a chance to install the
# relevant package eggs first.
import pytest
result = pytest.main(self.pytest_args)
if result != 0:
raise SystemExit(result)

@ -0,0 +1,5 @@
pytest>=2.6
pytest-cov>=2.0
pytest-xdist>=1.11
oauth2client>=1.4.7
grpcio>=0.10.0a0

@ -0,0 +1,3 @@
[pytest]
norecursedirs = _cython
python_files = *_test.py

@ -29,8 +29,17 @@
"""A setup module for the GRPC Python interop testing package."""
import os
import os.path
import setuptools
# Ensure we're in the proper directory whether or not we're being used by pip.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import-style to ensure we can actually find our commands module.
import commands
_PACKAGES = setuptools.find_packages('.', exclude=['*._cython', '*._cython.*'])
_PACKAGE_DIRECTORIES = {
@ -43,13 +52,28 @@ _PACKAGE_DATA = {
'credentials/server1.pem',]
}
_INSTALL_REQUIRES = ['oauth2client>=1.4.7', 'grpcio>=0.10.0a0']
_SETUP_REQUIRES = (
'pytest>=2.6',
'pytest-cov>=2.0',
'pytest-xdist>=1.11',
)
_INSTALL_REQUIRES = (
'oauth2client>=1.4.7',
'grpcio>=0.10.0a0',
)
_COMMAND_CLASS = {
'test': commands.RunTests
}
setuptools.setup(
name='grpcio_test',
version='0.0.1',
version='0.10.0a0',
packages=_PACKAGES,
package_dir=_PACKAGE_DIRECTORIES,
package_data=_PACKAGE_DATA,
install_requires=_INSTALL_REQUIRES
install_requires=_INSTALL_REQUIRES + _SETUP_REQUIRES,
setup_requires=_SETUP_REQUIRES,
cmdclass=_COMMAND_CLASS
)

@ -36,30 +36,30 @@ import simplejson
import collections
FixtureOptions = collections.namedtuple('FixtureOptions', 'fullstack secure platforms')
default_unsecure_fixture_options = FixtureOptions(True, False, ['windows', 'posix'])
socketpair_unsecure_fixture_options = FixtureOptions(False, False, ['windows', 'posix'])
default_secure_fixture_options = FixtureOptions(True, True, ['windows', 'posix'])
FixtureOptions = collections.namedtuple('FixtureOptions', 'fullstack dns_resolver secure platforms')
default_unsecure_fixture_options = FixtureOptions(True, True, False, ['windows', 'posix'])
socketpair_unsecure_fixture_options = FixtureOptions(False, False, False, ['windows', 'posix'])
default_secure_fixture_options = FixtureOptions(True, True, True, ['windows', 'posix'])
# maps fixture name to whether it requires the security library
END2END_FIXTURES = {
'chttp2_fake_security': default_secure_fixture_options,
'chttp2_fullstack_compression': default_unsecure_fixture_options,
'chttp2_fullstack': default_unsecure_fixture_options,
'chttp2_fullstack_uds_posix': FixtureOptions(True, False, ['posix']),
'chttp2_fullstack_uds_posix_with_poll': FixtureOptions(True, False, ['posix']),
'chttp2_fullstack_with_poll': FixtureOptions(True, False, ['posix']),
'chttp2_fullstack_uds_posix': FixtureOptions(True, False, False, ['posix']),
'chttp2_fullstack_uds_posix_with_poll': FixtureOptions(True, False, False, ['posix']),
'chttp2_fullstack_with_poll': FixtureOptions(True, True, False, ['posix']),
'chttp2_simple_ssl_fullstack': default_secure_fixture_options,
'chttp2_simple_ssl_fullstack_with_poll': FixtureOptions(True, True, ['posix']),
'chttp2_simple_ssl_fullstack_with_poll': FixtureOptions(True, True, True, ['posix']),
'chttp2_simple_ssl_with_oauth2_fullstack': default_secure_fixture_options,
'chttp2_socket_pair_one_byte_at_a_time': socketpair_unsecure_fixture_options,
'chttp2_socket_pair': socketpair_unsecure_fixture_options,
'chttp2_socket_pair_with_grpc_trace': socketpair_unsecure_fixture_options,
}
TestOptions = collections.namedtuple('TestOptions', 'needs_fullstack flaky secure')
default_test_options = TestOptions(False, False, False)
connectivity_test_options = TestOptions(True, False, False)
TestOptions = collections.namedtuple('TestOptions', 'needs_fullstack needs_dns flaky secure')
default_test_options = TestOptions(False, False, False, False)
connectivity_test_options = TestOptions(True, False, False, False)
# maps test names to options
END2END_TESTS = {
@ -71,6 +71,7 @@ END2END_TESTS = {
'cancel_in_a_vacuum': default_test_options,
'census_simple_request': default_test_options,
'channel_connectivity': connectivity_test_options,
'default_host': TestOptions(True, True, False, False),
'disappearing_server': connectivity_test_options,
'early_server_shutdown_finishes_inflight_calls': default_test_options,
'early_server_shutdown_finishes_tags': default_test_options,
@ -84,7 +85,7 @@ END2END_TESTS = {
'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': TestOptions(needs_fullstack=False, flaky=False, secure=True),
'request_response_with_payload_and_call_creds': TestOptions(needs_fullstack=False, needs_dns=False, flaky=False, 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,
@ -102,6 +103,9 @@ def compatible(f, t):
if END2END_TESTS[t].needs_fullstack:
if not END2END_FIXTURES[f].fullstack:
return False
if END2END_TESTS[t].needs_dns:
if not END2END_FIXTURES[f].dns_resolver:
return False
return True
@ -176,7 +180,7 @@ def main():
'language': 'c',
'secure': 'no',
'src': [],
'flaky': 'invoke_large_request' in t,
'flaky': END2END_TESTS[t].flaky,
'platforms': END2END_FIXTURES[f].platforms,
'deps': [
'end2end_fixture_%s' % f,

@ -54,7 +54,7 @@ static void test_connectivity(grpc_end2end_test_config config) {
/* start watching for a change */
grpc_channel_watch_connectivity_state(
f.client, GRPC_CHANNEL_IDLE, &state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(1));
f.client, GRPC_CHANNEL_IDLE, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(1));
/* nothing should happen */
cq_verify_empty(cqv);
@ -64,14 +64,18 @@ static void test_connectivity(grpc_end2end_test_config config) {
/* and now the watch should trigger */
cq_expect_completion(cqv, tag(1), 1);
cq_verify(cqv);
GPR_ASSERT(state == GRPC_CHANNEL_CONNECTING);
state = grpc_channel_check_connectivity_state(f.client, 0);
GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
state == GRPC_CHANNEL_CONNECTING);
/* quickly followed by a transition to TRANSIENT_FAILURE */
grpc_channel_watch_connectivity_state(
f.client, GRPC_CHANNEL_CONNECTING, &state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(2));
f.client, GRPC_CHANNEL_CONNECTING, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(2));
cq_expect_completion(cqv, tag(2), 1);
cq_verify(cqv);
GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE);
state = grpc_channel_check_connectivity_state(f.client, 0);
GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
state == GRPC_CHANNEL_CONNECTING);
gpr_log(GPR_DEBUG, "*** STARTING SERVER ***");
@ -84,10 +88,13 @@ static void test_connectivity(grpc_end2end_test_config config) {
READY is reached */
while (state != GRPC_CHANNEL_READY) {
grpc_channel_watch_connectivity_state(
f.client, state, &state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(3));
f.client, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(3));
cq_expect_completion(cqv, tag(3), 1);
cq_verify(cqv);
GPR_ASSERT(state == GRPC_CHANNEL_READY || state == GRPC_CHANNEL_CONNECTING || state == GRPC_CHANNEL_TRANSIENT_FAILURE);
state = grpc_channel_check_connectivity_state(f.client, 0);
GPR_ASSERT(state == GRPC_CHANNEL_READY ||
state == GRPC_CHANNEL_CONNECTING ||
state == GRPC_CHANNEL_TRANSIENT_FAILURE);
}
/* bring down the server again */
@ -95,14 +102,16 @@ static void test_connectivity(grpc_end2end_test_config config) {
gpr_log(GPR_DEBUG, "*** SHUTTING DOWN SERVER ***");
grpc_channel_watch_connectivity_state(
f.client, GRPC_CHANNEL_READY, &state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(4));
f.client, GRPC_CHANNEL_READY, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(4));
grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
cq_expect_completion(cqv, tag(4), 1);
cq_expect_completion(cqv, tag(0xdead), 1);
cq_verify(cqv);
GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE);
state = grpc_channel_check_connectivity_state(f.client, 0);
GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
state == GRPC_CHANNEL_CONNECTING);
/* cleanup server */
grpc_server_destroy(f.server);

@ -0,0 +1,220 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "test/core/end2end/end2end_tests.h"
#include <stdio.h>
#include <string.h>
#include "src/core/support/string.h"
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(gpr_intptr t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
const char *test_name,
grpc_channel_args *client_args,
grpc_channel_args *server_args) {
grpc_end2end_test_fixture f;
gpr_log(GPR_INFO, "%s/%s", test_name, config.name);
f = config.create_fixture(client_args, server_args);
config.init_client(&f, client_args);
config.init_server(&f, server_args);
return f;
}
static gpr_timespec n_seconds_time(int n) {
return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n);
}
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event ev;
do {
ev = grpc_completion_queue_next(cq, five_seconds_time());
} while (ev.type != GRPC_QUEUE_SHUTDOWN);
}
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
.type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
static void shutdown_client(grpc_end2end_test_fixture *f) {
if (!f->client) return;
grpc_channel_destroy(f->client);
f->client = NULL;
}
static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq);
}
static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
grpc_metadata_array trailing_metadata_recv;
grpc_metadata_array request_metadata_recv;
grpc_call_details call_details;
grpc_status_code status;
char *details = NULL;
size_t details_capacity = 0;
int was_cancelled = 2;
char *peer;
c = grpc_channel_create_call(f.client, f.cq, "/foo", NULL, deadline);
GPR_ASSERT(c);
peer = grpc_call_get_peer(c);
GPR_ASSERT(peer != NULL);
gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
gpr_free(peer);
grpc_metadata_array_init(&initial_metadata_recv);
grpc_metadata_array_init(&trailing_metadata_recv);
grpc_metadata_array_init(&request_metadata_recv);
grpc_call_details_init(&call_details);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
op++;
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
op->flags = 0;
op++;
op->op = GRPC_OP_RECV_INITIAL_METADATA;
op->data.recv_initial_metadata = &initial_metadata_recv;
op->flags = 0;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
op->data.recv_status_on_client.status = &status;
op->data.recv_status_on_client.status_details = &details;
op->data.recv_status_on_client.status_details_capacity = &details_capacity;
op->flags = 0;
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
f.server, &s, &call_details,
&request_metadata_recv, f.cq, f.cq, tag(101)));
cq_expect_completion(cqv, tag(101), 1);
cq_verify(cqv);
peer = grpc_call_get_peer(s);
GPR_ASSERT(peer != NULL);
gpr_log(GPR_DEBUG, "server_peer=%s", peer);
gpr_free(peer);
peer = grpc_call_get_peer(c);
GPR_ASSERT(peer != NULL);
gpr_log(GPR_DEBUG, "client_peer=%s", peer);
gpr_free(peer);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
op++;
op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
op->data.send_status_from_server.trailing_metadata_count = 0;
op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
op->data.send_status_from_server.status_details = "xyz";
op->flags = 0;
op++;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
op->data.recv_close_on_server.cancelled = &was_cancelled;
op->flags = 0;
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
cq_expect_completion(cqv, tag(102), 1);
cq_expect_completion(cqv, tag(1), 1);
cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "localhost"));
GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
grpc_metadata_array_destroy(&trailing_metadata_recv);
grpc_metadata_array_destroy(&request_metadata_recv);
grpc_call_details_destroy(&call_details);
grpc_call_destroy(c);
grpc_call_destroy(s);
cq_verifier_destroy(cqv);
}
static void test_invoke_simple_request(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f;
f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
simple_request_body(f);
end_test(&f);
config.tear_down_data(&f);
}
void grpc_end2end_tests(grpc_end2end_test_config config) {
if ((config.feature_mask & FEATURE_MASK_SUPPORTS_HOSTNAME_VERIFICATION) != 0) return;
if ((config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION) == 0) return;
test_invoke_simple_request(config);
}

@ -37,9 +37,7 @@
#include "test/core/util/test_config.h"
static void test_alpn_success(void) {
GPR_ASSERT(grpc_chttp2_is_alpn_version_supported("h2-16", 5));
GPR_ASSERT(grpc_chttp2_is_alpn_version_supported("h2-15", 5));
GPR_ASSERT(grpc_chttp2_is_alpn_version_supported("h2-14", 5));
GPR_ASSERT(grpc_chttp2_is_alpn_version_supported("h2", 2));
}
static void test_alpn_failure(void) {

@ -93,6 +93,15 @@ void CheckServerAuthContext(const ServerContext* context) {
EXPECT_TRUE(auth_ctx->GetPeerIdentity().empty());
}
bool CheckIsLocalhost(const grpc::string& addr) {
const grpc::string kIpv6("ipv6:[::1]:");
const grpc::string kIpv4MappedIpv6("ipv6:[::ffff:127.0.0.1]:");
const grpc::string kIpv4("ipv4:127.0.0.1:");
return addr.substr(0, kIpv4.size()) == kIpv4 ||
addr.substr(0, kIpv4MappedIpv6.size()) == kIpv4MappedIpv6 ||
addr.substr(0, kIpv6.size()) == kIpv6;
}
} // namespace
class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service {
@ -148,6 +157,9 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service {
response->set_message(
grpc::string(request->param().response_message_length(), '\0'));
}
if (request->has_param() && request->param().echo_peer()) {
response->mutable_param()->set_peer(context->peer());
}
return Status::OK;
}
@ -236,7 +248,7 @@ class End2endTest : public ::testing::Test {
void SetUp() GRPC_OVERRIDE {
int port = grpc_pick_unused_port_or_die();
server_address_ << "localhost:" << port;
server_address_ << "127.0.0.1:" << port;
// Setup server
ServerBuilder builder;
SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key,
@ -818,6 +830,21 @@ TEST_F(End2endTest, HugeResponse) {
EXPECT_TRUE(s.ok());
}
TEST_F(End2endTest, Peer) {
ResetStub();
EchoRequest request;
EchoResponse response;
request.set_message("hello");
request.mutable_param()->set_echo_peer(true);
ClientContext context;
Status s = stub_->Echo(&context, request, &response);
EXPECT_EQ(response.message(), request.message());
EXPECT_TRUE(s.ok());
EXPECT_TRUE(CheckIsLocalhost(response.param().peer()));
EXPECT_TRUE(CheckIsLocalhost(context.peer()));
}
} // namespace testing
} // namespace grpc

@ -39,6 +39,7 @@ message RequestParams {
optional bool echo_metadata = 4;
optional bool check_auth_context = 5;
optional int32 response_message_length = 6;
optional bool echo_peer = 7;
}
message EchoRequest {
@ -49,6 +50,7 @@ message EchoRequest {
message ResponseParams {
optional int64 request_deadline = 1;
optional string host = 2;
optional string peer = 3;
}
message EchoResponse {

@ -805,6 +805,8 @@ src/core/client_config/resolvers/dns_resolver.h \
src/core/client_config/resolvers/sockaddr_resolver.h \
src/core/client_config/subchannel.h \
src/core/client_config/subchannel_factory.h \
src/core/client_config/subchannel_factory_decorators/add_channel_arg.h \
src/core/client_config/subchannel_factory_decorators/merge_channel_args.h \
src/core/client_config/uri_parser.h \
src/core/compression/message_compress.h \
src/core/debug/trace.h \
@ -925,6 +927,8 @@ src/core/client_config/resolvers/dns_resolver.c \
src/core/client_config/resolvers/sockaddr_resolver.c \
src/core/client_config/subchannel.c \
src/core/client_config/subchannel_factory.c \
src/core/client_config/subchannel_factory_decorators/add_channel_arg.c \
src/core/client_config/subchannel_factory_decorators/merge_channel_args.c \
src/core/client_config/uri_parser.c \
src/core/compression/algorithm.c \
src/core/compression/message_compress.c \

@ -1638,6 +1638,68 @@ grpc_cloud_prod_auth_compute_engine_creds_gen_csharp_dotnet_cmd() {
echo $the_cmd
}
# constructs the full dockerized csharp-mono oauth2_auth_token auth interop test cmd.
#
# call-seq:
# flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_auth_oauth2_auth_token_gen_csharp_mono_cmd() {
local workdir_flag="-w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug"
local env_flag="-e SSL_CERT_FILE=/cacerts/roots.pem "
env_flag+="-e GOOGLE_APPLICATION_CREDENTIALS=/service_account/stubbyCloudTestingTest-7dd63462c60c.json "
local cmd_prefix="sudo docker run $workdir_flag $env_flag grpc/csharp_mono";
local test_script="mono Grpc.IntegrationTesting.Client.exe --use_tls=true";
local gfe_flags=$(_grpc_prod_gfe_flags);
local the_cmd="$cmd_prefix $test_script $gfe_flags $@";
echo $the_cmd
}
# constructs the csharp-dotnet oauth2_auth_token auth interop test cmd.
#
# call-seq:
# flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_auth_oauth2_auth_token_gen_csharp_dotnet_cmd() {
local set_workdir="cd /cygdrive/c/github/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug &&"
local test_script="./Grpc.IntegrationTesting.Client.exe --use_tls=true";
local set_certfile="SSL_CERT_FILE=/cacerts/roots.pem "
local set_creds="GOOGLE_APPLICATION_CREDENTIALS=/service_account/stubbyCloudTestingTest-7dd63462c60c.json "
local gfe_flags=$(_grpc_prod_gfe_flags);
local the_cmd="$set_workdir $set_certfile $set_creds $test_script $gfe_flags $@";
echo $the_cmd
}
# constructs the full dockerized csharp-mono per_rpc_creds auth interop test cmd.
#
# call-seq:
# flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_auth_per_rpc_creds_gen_csharp_mono_cmd() {
local workdir_flag="-w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug"
local env_flag="-e SSL_CERT_FILE=/cacerts/roots.pem "
env_flag+="-e GOOGLE_APPLICATION_CREDENTIALS=/service_account/stubbyCloudTestingTest-7dd63462c60c.json "
local cmd_prefix="sudo docker run $workdir_flag $env_flag grpc/csharp_mono";
local test_script="mono Grpc.IntegrationTesting.Client.exe --use_tls=true";
local gfe_flags=$(_grpc_prod_gfe_flags);
local the_cmd="$cmd_prefix $test_script $gfe_flags $@";
echo $the_cmd
}
# constructs the csharp-dotnet per_rpc_creds auth interop test cmd.
#
# call-seq:
# flags= .... # generic flags to include the command
# cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_auth_per_rpc_creds_gen_csharp_dotnet_cmd() {
local set_workdir="cd /cygdrive/c/github/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug &&"
local test_script="./Grpc.IntegrationTesting.Client.exe --use_tls=true";
local set_certfile="SSL_CERT_FILE=/cacerts/roots.pem "
local set_creds="GOOGLE_APPLICATION_CREDENTIALS=/service_account/stubbyCloudTestingTest-7dd63462c60c.json "
local gfe_flags=$(_grpc_prod_gfe_flags);
local the_cmd="$set_workdir $set_certfile $set_creds $test_script $gfe_flags $@";
echo $the_cmd
}
# outputs the flags passed to gfe tests
_grpc_prod_gfe_flags() {
echo " --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com"

@ -33,7 +33,9 @@ set -ex
# change to grpc repo root
cd $(dirname $0)/../..
root=`pwd`
ROOT=`pwd`
GRPCIO=$ROOT/src/python/grpcio
GRPCIO_TEST=$ROOT/src/python/grpcio_test
make_virtualenv() {
virtualenv_name="python"$1"_virtual_environment"
@ -42,9 +44,16 @@ make_virtualenv() {
# Build the entire virtual environment
virtualenv -p `which "python"$1` $virtualenv_name
source $virtualenv_name/bin/activate
pip install -r src/python/requirements.txt
CFLAGS="-I$root/include -std=c89" LDFLAGS=-L$root/libs/$CONFIG GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install src/python/grpcio
pip install src/python/grpcio_test
# Install grpcio
cd $GRPCIO
pip install -r requirements.txt
CFLAGS="-I$ROOT/include -std=c89" LDFLAGS=-L$ROOT/libs/$CONFIG GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install $GRPCIO
# Install grpcio_test
cd $GRPCIO_TEST
pip install -r requirements.txt
pip install $GRPCIO_TEST
else
source $virtualenv_name/bin/activate
# Uninstall and re-install the packages we care about. Don't use
@ -53,12 +62,12 @@ make_virtualenv() {
# dependency upgrades.
(yes | pip uninstall grpcio) || true
(yes | pip uninstall grpcio_test) || true
(CFLAGS="-I$root/include -std=c89" LDFLAGS=-L$root/libs/$CONFIG GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install src/python/grpcio) || (
(CFLAGS="-I$ROOT/include -std=c89" LDFLAGS=-L$ROOT/libs/$CONFIG GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install $GRPCIO) || (
# Fall back to rebuilding the entire environment
rm -rf $virtualenv_name
make_virtualenv $1
)
pip install src/python/grpcio_test
pip install $GRPCIO_TEST
fi
}

@ -1,122 +0,0 @@
[
{
"module": "grpc_test._adapter._c_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test._adapter._low_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test._adapter._intermediary_low_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test._adapter._links_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test._adapter._lonely_rear_link_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test._adapter._blocking_invocation_inline_service_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test._adapter._event_invocation_synchronous_event_service_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test._adapter._future_invocation_asynchronous_event_service_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test._links._lonely_invocation_link_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test._links._transmission_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test.early_adopter.implementations_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test.framework.base.implementations_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test.framework.face.blocking_invocation_inline_service_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test.framework.face.event_invocation_synchronous_event_service_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test.framework.face.future_invocation_asynchronous_event_service_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test.framework.foundation._later_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_test.framework.foundation._logging_pool_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_interop._insecure_interop_test",
"pythonVersions": [
"2.7"
]
},
{
"module": "grpc_interop._secure_interop_test",
"pythonVersions": [
"2.7"
]
},
{
"file": "test/compiler/python_plugin_test.py",
"pythonVersions": [
"2.7"
]
}
]

@ -33,8 +33,9 @@ set -ex
# change to grpc repo root
cd $(dirname $0)/../..
root=`pwd`
export LD_LIBRARY_PATH=$root/libs/$CONFIG
export DYLD_LIBRARY_PATH=$root/libs/$CONFIG
ROOT=`pwd`
GRPCIO_TEST=$ROOT/src/python/grpcio_test
export LD_LIBRARY_PATH=$ROOT/libs/$CONFIG
export DYLD_LIBRARY_PATH=$ROOT/libs/$CONFIG
source "python"$PYVER"_virtual_environment"/bin/activate
"python"$PYVER -B $*
"python"$PYVER $GRPCIO_TEST/setup.py test -a "-n8 --cov=grpc --junitxml=./report.xml"

@ -187,40 +187,18 @@ class PhpLanguage(object):
class PythonLanguage(object):
def __init__(self):
with open('tools/run_tests/python_tests.json') as f:
self._tests = json.load(f)
self._build_python_versions = set([
python_version
for test in self._tests
for python_version in test['pythonVersions']])
self._build_python_versions = ['2.7']
self._has_python_versions = []
def test_specs(self, config, travis):
job_specifications = []
for test in self._tests:
command = None
short_name = None
if 'module' in test:
command = ['tools/run_tests/run_python.sh', '-m', test['module']]
short_name = test['module']
elif 'file' in test:
command = ['tools/run_tests/run_python.sh', test['file']]
short_name = test['file']
else:
raise ValueError('expected input to be a module or file to run '
'unittests from')
for python_version in test['pythonVersions']:
if python_version in self._has_python_versions:
environment = dict(_FORCE_ENVIRON_FOR_WRAPPERS)
environment['PYVER'] = python_version
job_specifications.append(config.job_spec(
command, None, environ=environment, shortname=short_name))
else:
jobset.message(
'WARNING',
'Could not find Python {}; skipping test'.format(python_version),
'{}\n'.format(command), do_newline=True)
return job_specifications
environment = dict(_FORCE_ENVIRON_FOR_WRAPPERS)
environment['PYVER'] = '2.7'
return [config.job_spec(
['tools/run_tests/run_python.sh'],
None,
environ=environment,
shortname='py.test',
)]
def make_targets(self):
return ['static_c', 'grpc_python_plugin', 'shared_c']

@ -1771,6 +1771,21 @@
"name": "chttp2_fake_security_channel_connectivity_test",
"src": []
},
{
"deps": [
"end2end_certs",
"end2end_fixture_chttp2_fake_security",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "chttp2_fake_security_default_host_test",
"src": []
},
{
"deps": [
"end2end_certs",
@ -2251,6 +2266,21 @@
"name": "chttp2_fullstack_channel_connectivity_test",
"src": []
},
{
"deps": [
"end2end_certs",
"end2end_fixture_chttp2_fullstack",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "chttp2_fullstack_default_host_test",
"src": []
},
{
"deps": [
"end2end_certs",
@ -2731,6 +2761,21 @@
"name": "chttp2_fullstack_compression_channel_connectivity_test",
"src": []
},
{
"deps": [
"end2end_certs",
"end2end_fixture_chttp2_fullstack_compression",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "chttp2_fullstack_compression_default_host_test",
"src": []
},
{
"deps": [
"end2end_certs",
@ -4171,6 +4216,21 @@
"name": "chttp2_fullstack_with_poll_channel_connectivity_test",
"src": []
},
{
"deps": [
"end2end_certs",
"end2end_fixture_chttp2_fullstack_with_poll",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "chttp2_fullstack_with_poll_default_host_test",
"src": []
},
{
"deps": [
"end2end_certs",
@ -4651,6 +4711,21 @@
"name": "chttp2_simple_ssl_fullstack_channel_connectivity_test",
"src": []
},
{
"deps": [
"end2end_certs",
"end2end_fixture_chttp2_simple_ssl_fullstack",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "chttp2_simple_ssl_fullstack_default_host_test",
"src": []
},
{
"deps": [
"end2end_certs",
@ -5131,6 +5206,21 @@
"name": "chttp2_simple_ssl_fullstack_with_poll_channel_connectivity_test",
"src": []
},
{
"deps": [
"end2end_certs",
"end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "chttp2_simple_ssl_fullstack_with_poll_default_host_test",
"src": []
},
{
"deps": [
"end2end_certs",
@ -5611,6 +5701,21 @@
"name": "chttp2_simple_ssl_with_oauth2_fullstack_channel_connectivity_test",
"src": []
},
{
"deps": [
"end2end_certs",
"end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "chttp2_simple_ssl_with_oauth2_fullstack_default_host_test",
"src": []
},
{
"deps": [
"end2end_certs",
@ -7388,6 +7493,20 @@
"name": "chttp2_fullstack_channel_connectivity_unsecure_test",
"src": []
},
{
"deps": [
"end2end_fixture_chttp2_fullstack",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc_test_util_unsecure",
"grpc_unsecure"
],
"headers": [],
"language": "c",
"name": "chttp2_fullstack_default_host_unsecure_test",
"src": []
},
{
"deps": [
"end2end_fixture_chttp2_fullstack",
@ -7822,6 +7941,20 @@
"name": "chttp2_fullstack_compression_channel_connectivity_unsecure_test",
"src": []
},
{
"deps": [
"end2end_fixture_chttp2_fullstack_compression",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc_test_util_unsecure",
"grpc_unsecure"
],
"headers": [],
"language": "c",
"name": "chttp2_fullstack_compression_default_host_unsecure_test",
"src": []
},
{
"deps": [
"end2end_fixture_chttp2_fullstack_compression",
@ -9124,6 +9257,20 @@
"name": "chttp2_fullstack_with_poll_channel_connectivity_unsecure_test",
"src": []
},
{
"deps": [
"end2end_fixture_chttp2_fullstack_with_poll",
"end2end_test_default_host",
"gpr",
"gpr_test_util",
"grpc_test_util_unsecure",
"grpc_unsecure"
],
"headers": [],
"language": "c",
"name": "chttp2_fullstack_with_poll_default_host_unsecure_test",
"src": []
},
{
"deps": [
"end2end_fixture_chttp2_fullstack_with_poll",
@ -10818,6 +10965,8 @@
"src/core/client_config/resolvers/sockaddr_resolver.h",
"src/core/client_config/subchannel.h",
"src/core/client_config/subchannel_factory.h",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.h",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.h",
"src/core/client_config/uri_parser.h",
"src/core/compression/message_compress.h",
"src/core/debug/trace.h",
@ -10966,6 +11115,10 @@
"src/core/client_config/subchannel.h",
"src/core/client_config/subchannel_factory.c",
"src/core/client_config/subchannel_factory.h",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.c",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.h",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.c",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.h",
"src/core/client_config/uri_parser.c",
"src/core/client_config/uri_parser.h",
"src/core/compression/algorithm.c",
@ -11282,6 +11435,8 @@
"src/core/client_config/resolvers/sockaddr_resolver.h",
"src/core/client_config/subchannel.h",
"src/core/client_config/subchannel_factory.h",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.h",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.h",
"src/core/client_config/uri_parser.h",
"src/core/compression/message_compress.h",
"src/core/debug/trace.h",
@ -11412,6 +11567,10 @@
"src/core/client_config/subchannel.h",
"src/core/client_config/subchannel_factory.c",
"src/core/client_config/subchannel_factory.h",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.c",
"src/core/client_config/subchannel_factory_decorators/add_channel_arg.h",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.c",
"src/core/client_config/subchannel_factory_decorators/merge_channel_args.h",
"src/core/client_config/uri_parser.c",
"src/core/client_config/uri_parser.h",
"src/core/compression/algorithm.c",
@ -12472,6 +12631,25 @@
"test/core/end2end/tests/channel_connectivity.c"
]
},
{
"deps": [
"gpr",
"gpr_test_util",
"grpc_test_util_unsecure",
"grpc_unsecure"
],
"headers": [
"test/core/end2end/end2end_tests.h",
"test/core/end2end/tests/cancel_test_helpers.h"
],
"language": "c",
"name": "end2end_test_default_host",
"src": [
"test/core/end2end/end2end_tests.h",
"test/core/end2end/tests/cancel_test_helpers.h",
"test/core/end2end/tests/default_host.c"
]
},
{
"deps": [
"gpr",

@ -873,6 +873,15 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_fake_security_default_host_test",
"platforms": [
"windows",
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -1161,6 +1170,15 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_default_host_test",
"platforms": [
"windows",
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -1449,6 +1467,15 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_compression_default_host_test",
"platforms": [
"windows",
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -2241,6 +2268,14 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_with_poll_default_host_test",
"platforms": [
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -2505,6 +2540,15 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_simple_ssl_fullstack_default_host_test",
"platforms": [
"windows",
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -2785,6 +2829,14 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_simple_ssl_fullstack_with_poll_default_host_test",
"platforms": [
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -3049,6 +3101,15 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_simple_ssl_with_oauth2_fullstack_default_host_test",
"platforms": [
"windows",
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -4120,6 +4181,15 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_default_host_unsecure_test",
"platforms": [
"windows",
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -4166,7 +4236,7 @@
]
},
{
"flaky": true,
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_invoke_large_request_unsecure_test",
"platforms": [
@ -4399,6 +4469,15 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_compression_default_host_unsecure_test",
"platforms": [
"windows",
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -4445,7 +4524,7 @@
]
},
{
"flaky": true,
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_compression_invoke_large_request_unsecure_test",
"platforms": [
@ -4711,7 +4790,7 @@
]
},
{
"flaky": true,
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test",
"platforms": [
@ -4959,7 +5038,7 @@
]
},
{
"flaky": true,
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_uds_posix_with_poll_invoke_large_request_unsecure_test",
"platforms": [
@ -5166,6 +5245,14 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_with_poll_default_host_unsecure_test",
"platforms": [
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -5207,7 +5294,7 @@
]
},
{
"flaky": true,
"flaky": false,
"language": "c",
"name": "chttp2_fullstack_with_poll_invoke_large_request_unsecure_test",
"platforms": [
@ -5450,7 +5537,7 @@
]
},
{
"flaky": true,
"flaky": false,
"language": "c",
"name": "chttp2_socket_pair_invoke_large_request_unsecure_test",
"platforms": [
@ -5702,7 +5789,7 @@
]
},
{
"flaky": true,
"flaky": false,
"language": "c",
"name": "chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test",
"platforms": [
@ -5954,7 +6041,7 @@
]
},
{
"flaky": true,
"flaky": false,
"language": "c",
"name": "chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test",
"platforms": [

File diff suppressed because one or more lines are too long

@ -267,6 +267,8 @@
<ClInclude Include="..\..\src\core\client_config\resolvers\sockaddr_resolver.h" />
<ClInclude Include="..\..\src\core\client_config\subchannel.h" />
<ClInclude Include="..\..\src\core\client_config\subchannel_factory.h" />
<ClInclude Include="..\..\src\core\client_config\subchannel_factory_decorators\add_channel_arg.h" />
<ClInclude Include="..\..\src\core\client_config\subchannel_factory_decorators\merge_channel_args.h" />
<ClInclude Include="..\..\src\core\client_config\uri_parser.h" />
<ClInclude Include="..\..\src\core\compression\message_compress.h" />
<ClInclude Include="..\..\src\core\debug\trace.h" />
@ -433,6 +435,10 @@
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory.c">
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory_decorators\add_channel_arg.c">
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory_decorators\merge_channel_args.c">
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\uri_parser.c">
</ClCompile>
<ClCompile Include="..\..\src\core\compression\algorithm.c">

@ -133,6 +133,12 @@
<ClCompile Include="..\..\src\core\client_config\subchannel_factory.c">
<Filter>src\core\client_config</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory_decorators\add_channel_arg.c">
<Filter>src\core\client_config\subchannel_factory_decorators</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory_decorators\merge_channel_args.c">
<Filter>src\core\client_config\subchannel_factory_decorators</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\uri_parser.c">
<Filter>src\core\client_config</Filter>
</ClCompile>
@ -551,6 +557,12 @@
<ClInclude Include="..\..\src\core\client_config\subchannel_factory.h">
<Filter>src\core\client_config</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\client_config\subchannel_factory_decorators\add_channel_arg.h">
<Filter>src\core\client_config\subchannel_factory_decorators</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\client_config\subchannel_factory_decorators\merge_channel_args.h">
<Filter>src\core\client_config\subchannel_factory_decorators</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\client_config\uri_parser.h">
<Filter>src\core\client_config</Filter>
</ClInclude>
@ -809,6 +821,9 @@
<Filter Include="src\core\client_config\resolvers">
<UniqueIdentifier>{6d97b8d9-2c15-927a-892a-709d073c02ab}</UniqueIdentifier>
</Filter>
<Filter Include="src\core\client_config\subchannel_factory_decorators">
<UniqueIdentifier>{428cdbb1-c777-2c64-79b3-43d6ee413061}</UniqueIdentifier>
</Filter>
<Filter Include="src\core\compression">
<UniqueIdentifier>{263cb913-dfe6-42a4-096b-cac231f76305}</UniqueIdentifier>
</Filter>

@ -246,6 +246,8 @@
<ClInclude Include="..\..\src\core\client_config\resolvers\sockaddr_resolver.h" />
<ClInclude Include="..\..\src\core\client_config\subchannel.h" />
<ClInclude Include="..\..\src\core\client_config\subchannel_factory.h" />
<ClInclude Include="..\..\src\core\client_config\subchannel_factory_decorators\add_channel_arg.h" />
<ClInclude Include="..\..\src\core\client_config\subchannel_factory_decorators\merge_channel_args.h" />
<ClInclude Include="..\..\src\core\client_config\uri_parser.h" />
<ClInclude Include="..\..\src\core\compression\message_compress.h" />
<ClInclude Include="..\..\src\core\debug\trace.h" />
@ -366,6 +368,10 @@
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory.c">
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory_decorators\add_channel_arg.c">
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory_decorators\merge_channel_args.c">
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\uri_parser.c">
</ClCompile>
<ClCompile Include="..\..\src\core\compression\algorithm.c">

@ -64,6 +64,12 @@
<ClCompile Include="..\..\src\core\client_config\subchannel_factory.c">
<Filter>src\core\client_config</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory_decorators\add_channel_arg.c">
<Filter>src\core\client_config\subchannel_factory_decorators</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\subchannel_factory_decorators\merge_channel_args.c">
<Filter>src\core\client_config\subchannel_factory_decorators</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\client_config\uri_parser.c">
<Filter>src\core\client_config</Filter>
</ClCompile>
@ -428,6 +434,12 @@
<ClInclude Include="..\..\src\core\client_config\subchannel_factory.h">
<Filter>src\core\client_config</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\client_config\subchannel_factory_decorators\add_channel_arg.h">
<Filter>src\core\client_config\subchannel_factory_decorators</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\client_config\subchannel_factory_decorators\merge_channel_args.h">
<Filter>src\core\client_config\subchannel_factory_decorators</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\client_config\uri_parser.h">
<Filter>src\core\client_config</Filter>
</ClInclude>
@ -686,6 +698,9 @@
<Filter Include="src\core\client_config\resolvers">
<UniqueIdentifier>{dd617c24-6f07-fdff-80d5-c8610d6f815e}</UniqueIdentifier>
</Filter>
<Filter Include="src\core\client_config\subchannel_factory_decorators">
<UniqueIdentifier>{64285d1a-ebd0-7637-ae20-15df5ca6cc83}</UniqueIdentifier>
</Filter>
<Filter Include="src\core\compression">
<UniqueIdentifier>{2e3aca1d-223d-10a1-b282-7f9fc68ee6f5}</UniqueIdentifier>
</Filter>

Loading…
Cancel
Save