aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/client_channel
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-11-04 12:48:57 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-11-04 12:48:57 -0700
commit9a8dbc406e1b6c6612837056bee601d88c910747 (patch)
tree828ec1b3eef76e080e4a202310f31a81440d305c /test/core/client_channel
parent04c5b52668445bef2d0dc96794eb2979e1c0a917 (diff)
parent4736c55e0f923b8f3b8713449500a43ab8686ae3 (diff)
Merge remote-tracking branch 'upstream/master' into channel_info_api
Diffstat (limited to 'test/core/client_channel')
-rw-r--r--test/core/client_channel/lb_policies_test.c38
-rw-r--r--test/core/client_channel/set_initial_connect_string_test.c2
2 files changed, 21 insertions, 19 deletions
diff --git a/test/core/client_channel/lb_policies_test.c b/test/core/client_channel/lb_policies_test.c
index 7c639cbeb9..198aafb91f 100644
--- a/test/core/client_channel/lb_policies_test.c
+++ b/test/core/client_channel/lb_policies_test.c
@@ -48,7 +48,6 @@
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h"
#include "test/core/end2end/cq_verifier.h"
-#include "test/core/end2end/fake_resolver.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
@@ -501,7 +500,7 @@ void run_spec(const test_spec *spec) {
request_data rdata;
servers_fixture *f;
grpc_channel_args args;
- grpc_arg arg;
+ grpc_arg arg_array[2];
rdata.call_details =
gpr_malloc(sizeof(grpc_call_details) * spec->num_servers);
f = setup_servers("127.0.0.1", &rdata, spec->num_servers);
@@ -509,14 +508,16 @@ void run_spec(const test_spec *spec) {
/* Create client. */
servers_hostports_str = gpr_strjoin_sep((const char **)f->servers_hostports,
f->num_servers, ",", NULL);
- gpr_asprintf(&client_hostport, "test:%s?lb_policy=round_robin",
- servers_hostports_str);
+ gpr_asprintf(&client_hostport, "ipv4:%s", servers_hostports_str);
- arg.type = GRPC_ARG_INTEGER;
- arg.key = "grpc.testing.fixed_reconnect_backoff";
- arg.value.integer = RETRY_TIMEOUT;
- args.num_args = 1;
- args.args = &arg;
+ arg_array[0].type = GRPC_ARG_INTEGER;
+ arg_array[0].key = "grpc.testing.fixed_reconnect_backoff";
+ arg_array[0].value.integer = RETRY_TIMEOUT;
+ arg_array[1].type = GRPC_ARG_STRING;
+ arg_array[1].key = GRPC_ARG_LB_POLICY_NAME;
+ arg_array[1].value.string = "round_robin";
+ args.num_args = 2;
+ args.args = arg_array;
client = grpc_insecure_channel_create(client_hostport, &args, NULL);
@@ -540,19 +541,21 @@ static grpc_channel *create_client(const servers_fixture *f) {
grpc_channel *client;
char *client_hostport;
char *servers_hostports_str;
- grpc_arg arg;
+ grpc_arg arg_array[2];
grpc_channel_args args;
servers_hostports_str = gpr_strjoin_sep((const char **)f->servers_hostports,
f->num_servers, ",", NULL);
- gpr_asprintf(&client_hostport, "test:%s?lb_policy=round_robin",
- servers_hostports_str);
+ gpr_asprintf(&client_hostport, "ipv4:%s", servers_hostports_str);
- arg.type = GRPC_ARG_INTEGER;
- arg.key = "grpc.testing.fixed_reconnect_backoff";
- arg.value.integer = RETRY_TIMEOUT;
- args.num_args = 1;
- args.args = &arg;
+ arg_array[0].type = GRPC_ARG_INTEGER;
+ arg_array[0].key = "grpc.testing.fixed_reconnect_backoff";
+ arg_array[0].value.integer = RETRY_TIMEOUT;
+ arg_array[1].type = GRPC_ARG_STRING;
+ arg_array[1].key = GRPC_ARG_LB_POLICY_NAME;
+ arg_array[1].value.string = "round_robin";
+ args.num_args = 2;
+ args.args = arg_array;
client = grpc_insecure_channel_create(client_hostport, &args, NULL);
gpr_free(client_hostport);
@@ -895,7 +898,6 @@ int main(int argc, char **argv) {
const size_t NUM_SERVERS = 4;
grpc_test_init(argc, argv);
- grpc_fake_resolver_init();
grpc_init();
grpc_tracer_set_enabled("round_robin", 1);
diff --git a/test/core/client_channel/set_initial_connect_string_test.c b/test/core/client_channel/set_initial_connect_string_test.c
index 379f30fb9f..d93cad57b4 100644
--- a/test/core/client_channel/set_initial_connect_string_test.c
+++ b/test/core/client_channel/set_initial_connect_string_test.c
@@ -115,8 +115,8 @@ static void reset_addr_and_set_magic_string(grpc_resolved_address **addr,
target.sin_family = AF_INET;
target.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
target.sin_port = htons((uint16_t)server_port);
- (*addr)->len = sizeof(target);
*addr = (grpc_resolved_address *)gpr_malloc(sizeof(grpc_resolved_address));
+ (*addr)->len = sizeof(target);
memcpy((*addr)->addr, &target, sizeof(target));
}