aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/client_config
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/client_config')
-rw-r--r--test/core/client_config/lb_policies_test.c52
-rw-r--r--test/core/client_config/resolvers/dns_resolver_connectivity_test.c39
-rw-r--r--test/core/client_config/resolvers/dns_resolver_test.c36
-rw-r--r--test/core/client_config/resolvers/sockaddr_resolver_test.c39
-rw-r--r--test/core/client_config/set_initial_connect_string_test.c10
-rw-r--r--test/core/client_config/uri_corpus/02d156dc5e6f2c11c90c2e06fcee04adf036a3422
-rw-r--r--test/core/client_config/uri_corpus/042dc4512fa3d391c5170cf3aa61e6a638f843421
-rw-r--r--test/core/client_config/uri_corpus/0e9bbe975f2027e8c39c89f85f667530368e7d111
-rw-r--r--test/core/client_config/uri_corpus/1155aa6ea7ef262a81a63692513ea395f84dad6f2
-rw-r--r--test/core/client_config/uri_corpus/13856a5569ffd085a4d5c07af5f8e9310835a1181
-rw-r--r--test/core/client_config/uri_corpus/14b57bcbf1e17b1db1de491ef2ba3768f704b7dc1
-rw-r--r--test/core/client_config/uri_corpus/1794310671a060eead6e5ee66ac978a18ec7e84f2
-rw-r--r--test/core/client_config/uri_corpus/1d30b2a79afbaf2828ff42b9a9647e942ba1ab801
-rw-r--r--test/core/client_config/uri_corpus/1fcf5d9c333b70596cf5ba04d1f7affdf445b9713
-rw-r--r--test/core/client_config/uri_corpus/23162c8a8936e20b195404c21337ee734d02a6bc1
-rw-r--r--test/core/client_config/uri_corpus/23f3198b815ca60bdadcaae682b9f965dda387f11
-rw-r--r--test/core/client_config/uri_corpus/2ef3893b43f1f60b77b59ce06a6bce9815d78eaf2
-rw-r--r--test/core/client_config/uri_corpus/356c3c129e203b5c74550b4209764d74b9caefce1
-rw-r--r--test/core/client_config/uri_corpus/396568fc41c8ccb31ec925b4a862e4d29ead13271
-rw-r--r--test/core/client_config/uri_corpus/3b1e7526a99918006b87e499d2beb6c4ac9c3c0c1
-rw-r--r--test/core/client_config/uri_corpus/3b58860f3451d3e7aad99690a8d39782ca5116fc4
-rw-r--r--test/core/client_config/uri_corpus/41963cc10752f70c3af7e3d85868efb097a0ea9c1
-rw-r--r--test/core/client_config/uri_corpus/47b5228404451fc9d4071fa69192514bb4ce33c11
-rw-r--r--test/core/client_config/uri_corpus/56a2da4b2e6fb795243901023ed8d0aa083d1aab1
-rw-r--r--test/core/client_config/uri_corpus/574c2f13858a9a6d724654bd913ede9ae3abf8222
-rw-r--r--test/core/client_config/uri_corpus/582f789c19033a152094cbf8565f14154a778ddb1
-rw-r--r--test/core/client_config/uri_corpus/636c5606fc23713a1bae88c8899c0541cfad4fd84
-rw-r--r--test/core/client_config/uri_corpus/63fe493b270b17426d77a27cbf3abac5b2c2794a1
-rw-r--r--test/core/client_config/uri_corpus/655300a902b62662296a8e46bfb04fbcb07182cb1
-rw-r--r--test/core/client_config/uri_corpus/6ae3acd9d8507b61bf235748026080a4138dba581
-rw-r--r--test/core/client_config/uri_corpus/6b70979a70a038ff6607d6cf85485ee95baf58e61
-rw-r--r--test/core/client_config/uri_corpus/7314ab3545a7535a26e0e8aad67caea5534d68b12
-rw-r--r--test/core/client_config/uri_corpus/7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb1
-rw-r--r--test/core/client_config/uri_corpus/87daa131e0973b77a232a870ed749ef29cf58e6d2
-rw-r--r--test/core/client_config/uri_corpus/884dcaee2908ffe5f12b65b8eba81016099c42661
-rw-r--r--test/core/client_config/uri_corpus/8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb1
-rw-r--r--test/core/client_config/uri_corpus/9671149af0b444f59bbdf71340d3441dadd8a7b41
-rw-r--r--test/core/client_config/uri_corpus/96c8d266b7dc037288ef305c996608270f72e7fb2
-rw-r--r--test/core/client_config/uri_corpus/975536c71ade4800415a7e9c2f1b45c35a6d5ea81
-rw-r--r--test/core/client_config/uri_corpus/99750aa67d30beaea8af565c829d4999aa8cb91b1
-rw-r--r--test/core/client_config/uri_corpus/a1140f3f8b5cffc1010221b9a4084a25fb75c1f61
-rw-r--r--test/core/client_config/uri_corpus/a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de1
-rw-r--r--test/core/client_config/uri_corpus/a296eb3d1d436ed7df7195b10aa3c4de3896f98d1
-rw-r--r--test/core/client_config/uri_corpus/a8b8e66050b424f1b8c07d46f868199fb7f60e381
-rw-r--r--test/core/client_config/uri_corpus/aba1472880406a318ce207ee79815b7acf0877571
-rw-r--r--test/core/client_config/uri_corpus/af55baf8c8855e563befdf1eefbcbd46c5ddb8d21
-rw-r--r--test/core/client_config/uri_corpus/b3c0bf66c2bf5d24ef1daf4cc5a9d6d5bd0e8bfd1
-rw-r--r--test/core/client_config/uri_corpus/c28a47409cf5d95bb372238d01e73d8b831408e41
-rw-r--r--test/core/client_config/uri_corpus/c3ef1d41888063a08700c3add1e4465aabcf88072
-rw-r--r--test/core/client_config/uri_corpus/c550a76af21f9b9cc92a386d5c8998b26f8f2e4d1
-rw-r--r--test/core/client_config/uri_corpus/c79721406d0ab80495f186fd88e37fba98637ae91
-rw-r--r--test/core/client_config/uri_corpus/ceb4e2264ba7a8d5be47d276b37ec09489e002451
-rw-r--r--test/core/client_config/uri_corpus/cf4395958f5bfb46fd6f535a39657d016c75114c1
-rw-r--r--test/core/client_config/uri_corpus/d46668372b7e20154a89409a7430a28e642afdca1
-rw-r--r--test/core/client_config/uri_corpus/d6fe7412a0a1d1c733160246f3fa425f4f97682a1
-rw-r--r--test/core/client_config/uri_corpus/dns.txt1
-rw-r--r--test/core/client_config/uri_corpus/e241f29957b0e30ec11aaaf91b2339f7015fa5fd1
-rw-r--r--test/core/client_config/uri_corpus/ea02d9fea9bad5b89cf353a0169238f584177e714
-rw-r--r--test/core/client_config/uri_corpus/ec4731dddf94ed3ea92ae4d5a71f145ab6e3f6ee1
-rw-r--r--test/core/client_config/uri_corpus/ed2f78646f19fc47dd85ff0877c232b71913ece21
-rw-r--r--test/core/client_config/uri_corpus/f6889f4a6350fea1596a3adea5cdac02bd5d1ff32
-rw-r--r--test/core/client_config/uri_corpus/f6f3bd030f0d321efe7c51ca3f057de23509af671
-rw-r--r--test/core/client_config/uri_corpus/f97598cff03306af3c70400608fec47268b5075d2
-rw-r--r--test/core/client_config/uri_corpus/f9e1ec1fc642b575bc9955618b7065747f56b1011
-rw-r--r--test/core/client_config/uri_corpus/fe0630a3aeed2ec6f474f362e4c839478290d5c41
-rw-r--r--test/core/client_config/uri_corpus/ipv4.txt1
-rw-r--r--test/core/client_config/uri_corpus/ipv6.txt1
-rw-r--r--test/core/client_config/uri_corpus/unix.txt1
-rw-r--r--test/core/client_config/uri_fuzzer_test.c52
-rw-r--r--test/core/client_config/uri_parser_test.c70
70 files changed, 309 insertions, 74 deletions
diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c
index cb99b3da3e..e766672cf5 100644
--- a/test/core/client_config/lb_policies_test.c
+++ b/test/core/client_config/lb_policies_test.c
@@ -41,17 +41,18 @@
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
-#include "src/core/channel/channel_stack.h"
-#include "src/core/channel/client_channel.h"
-#include "src/core/client_config/lb_policies/round_robin.h"
-#include "src/core/client_config/lb_policy_registry.h"
-#include "src/core/support/string.h"
-#include "src/core/surface/channel.h"
-#include "src/core/surface/server.h"
+#include "src/core/ext/client_config/client_channel.h"
+#include "src/core/ext/client_config/lb_policy_registry.h"
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
#include "test/core/end2end/cq_verifier.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
+#define RETRY_TIMEOUT 300
+
typedef struct servers_fixture {
size_t num_servers;
grpc_server **servers;
@@ -137,8 +138,9 @@ static void kill_server(const servers_fixture *f, size_t i) {
gpr_log(GPR_INFO, "KILLING SERVER %d", i);
GPR_ASSERT(f->servers[i] != NULL);
grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000),
- NULL).type == GRPC_OP_COMPLETE);
+ GPR_ASSERT(
+ grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000), NULL)
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->servers[i]);
f->servers[i] = NULL;
}
@@ -204,8 +206,8 @@ static void teardown_servers(servers_fixture *f) {
if (f->servers[i] == NULL) continue;
grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000));
GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000),
- n_millis_time(5000),
- NULL).type == GRPC_OP_COMPLETE);
+ n_millis_time(5000), NULL)
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->servers[i]);
}
grpc_completion_queue_shutdown(f->cq);
@@ -302,9 +304,10 @@ static int *perform_request(servers_fixture *f, grpc_channel *client,
grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL));
s_idx = -1;
- while ((ev = grpc_completion_queue_next(
- f->cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), NULL)).type !=
- GRPC_QUEUE_TIMEOUT) {
+ while (
+ (ev = grpc_completion_queue_next(
+ f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10 * RETRY_TIMEOUT), NULL))
+ .type != GRPC_QUEUE_TIMEOUT) {
GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
read_tag = ((int)(intptr_t)ev.tag);
gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%d",
@@ -376,9 +379,10 @@ static int *perform_request(servers_fixture *f, grpc_channel *client,
}
}
- GPR_ASSERT(grpc_completion_queue_next(f->cq,
- GRPC_TIMEOUT_MILLIS_TO_DEADLINE(200),
- NULL).type == GRPC_QUEUE_TIMEOUT);
+ GPR_ASSERT(
+ grpc_completion_queue_next(
+ f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(2 * RETRY_TIMEOUT), NULL)
+ .type == GRPC_QUEUE_TIMEOUT);
grpc_metadata_array_destroy(&rdata->initial_metadata_recv);
grpc_metadata_array_destroy(&rdata->trailing_metadata_recv);
@@ -506,7 +510,7 @@ void run_spec(const test_spec *spec) {
arg.type = GRPC_ARG_INTEGER;
arg.key = "grpc.testing.fixed_reconnect_backoff";
- arg.value.integer = 100;
+ arg.value.integer = RETRY_TIMEOUT;
args.num_args = 1;
args.args = &arg;
@@ -542,7 +546,7 @@ static grpc_channel *create_client(const servers_fixture *f) {
arg.type = GRPC_ARG_INTEGER;
arg.key = "grpc.testing.fixed_reconnect_backoff";
- arg.value.integer = 100;
+ arg.value.integer = RETRY_TIMEOUT;
args.num_args = 1;
args.args = &arg;
@@ -868,6 +872,7 @@ static void verify_rebirth_round_robin(const servers_fixture *f,
}
int main(int argc, char **argv) {
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
test_spec *spec;
size_t i;
const size_t NUM_ITERS = 10;
@@ -875,11 +880,11 @@ int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_init();
- grpc_lb_round_robin_trace = 1;
+ grpc_tracer_set_enabled("round_robin", 1);
- GPR_ASSERT(grpc_lb_policy_create("this-lb-policy-does-not-exist", NULL) ==
- NULL);
- GPR_ASSERT(grpc_lb_policy_create(NULL, NULL) == NULL);
+ GPR_ASSERT(grpc_lb_policy_create(&exec_ctx, "this-lb-policy-does-not-exist",
+ NULL) == NULL);
+ GPR_ASSERT(grpc_lb_policy_create(&exec_ctx, NULL, NULL) == NULL);
spec = test_spec_create(NUM_ITERS, NUM_SERVERS);
/* everything is fine, all servers stay up the whole time and life's peachy */
@@ -931,6 +936,7 @@ int main(int argc, char **argv) {
test_pending_calls(4);
test_ping();
+ grpc_exec_ctx_finish(&exec_ctx);
grpc_shutdown();
return 0;
}
diff --git a/test/core/client_config/resolvers/dns_resolver_connectivity_test.c b/test/core/client_config/resolvers/dns_resolver_connectivity_test.c
index 75d1eb674f..2322aa688a 100644
--- a/test/core/client_config/resolvers/dns_resolver_connectivity_test.c
+++ b/test/core/client_config/resolvers/dns_resolver_connectivity_test.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,31 +31,38 @@
*
*/
-#include "src/core/client_config/resolvers/dns_resolver.h"
-
#include <string.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
-#include "src/core/iomgr/resolve_address.h"
-#include "src/core/iomgr/timer.h"
+#include "src/core/ext/client_config/resolver_registry.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/timer.h"
#include "test/core/util/test_config.h"
-static void subchannel_factory_ref(grpc_subchannel_factory *scv) {}
-static void subchannel_factory_unref(grpc_exec_ctx *exec_ctx,
- grpc_subchannel_factory *scv) {}
-static grpc_subchannel *subchannel_factory_create_subchannel(
- grpc_exec_ctx *exec_ctx, grpc_subchannel_factory *factory,
+static void client_channel_factory_ref(grpc_client_channel_factory *scv) {}
+static void client_channel_factory_unref(grpc_exec_ctx *exec_ctx,
+ grpc_client_channel_factory *scv) {}
+static grpc_subchannel *client_channel_factory_create_subchannel(
+ grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory,
grpc_subchannel_args *args) {
return NULL;
}
-static const grpc_subchannel_factory_vtable sc_vtable = {
- subchannel_factory_ref, subchannel_factory_unref,
- subchannel_factory_create_subchannel};
+static grpc_channel *client_channel_factory_create_channel(
+ grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
+ const char *target, grpc_client_channel_type type,
+ grpc_channel_args *args) {
+ GPR_UNREACHABLE_CODE(return NULL);
+}
+
+static const grpc_client_channel_factory_vtable sc_vtable = {
+ client_channel_factory_ref, client_channel_factory_unref,
+ client_channel_factory_create_subchannel,
+ client_channel_factory_create_channel};
-static grpc_subchannel_factory sc_factory = {&sc_vtable};
+static grpc_client_channel_factory cc_factory = {&sc_vtable};
static gpr_mu g_mu;
static bool g_fail_resolution = true;
@@ -79,13 +86,13 @@ static grpc_resolved_addresses *my_resolve_address(const char *name,
}
static grpc_resolver *create_resolver(const char *name) {
- grpc_resolver_factory *factory = grpc_dns_resolver_factory_create();
+ grpc_resolver_factory *factory = grpc_resolver_factory_lookup("dns");
grpc_uri *uri = grpc_uri_parse(name, 0);
GPR_ASSERT(uri);
grpc_resolver_args args;
memset(&args, 0, sizeof(args));
args.uri = uri;
- args.subchannel_factory = &sc_factory;
+ args.client_channel_factory = &cc_factory;
grpc_resolver *resolver =
grpc_resolver_factory_create_resolver(factory, &args);
grpc_resolver_factory_unref(factory);
diff --git a/test/core/client_config/resolvers/dns_resolver_test.c b/test/core/client_config/resolvers/dns_resolver_test.c
index 38e76d5342..21dc99cadd 100644
--- a/test/core/client_config/resolvers/dns_resolver_test.c
+++ b/test/core/client_config/resolvers/dns_resolver_test.c
@@ -31,29 +31,35 @@
*
*/
-#include "src/core/client_config/resolvers/dns_resolver.h"
-
#include <string.h>
#include <grpc/support/log.h>
-#include "src/core/client_config/resolver.h"
+#include "src/core/ext/client_config/resolver_registry.h"
#include "test/core/util/test_config.h"
-static void subchannel_factory_ref(grpc_subchannel_factory *scv) {}
-static void subchannel_factory_unref(grpc_exec_ctx *exec_ctx,
- grpc_subchannel_factory *scv) {}
-static grpc_subchannel *subchannel_factory_create_subchannel(
- grpc_exec_ctx *exec_ctx, grpc_subchannel_factory *factory,
+static void client_channel_factory_ref(grpc_client_channel_factory *scv) {}
+static void client_channel_factory_unref(grpc_exec_ctx *exec_ctx,
+ grpc_client_channel_factory *scv) {}
+static grpc_subchannel *client_channel_factory_create_subchannel(
+ grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory,
grpc_subchannel_args *args) {
GPR_UNREACHABLE_CODE(return NULL);
}
-static const grpc_subchannel_factory_vtable sc_vtable = {
- subchannel_factory_ref, subchannel_factory_unref,
- subchannel_factory_create_subchannel};
+static grpc_channel *client_channel_factory_create_channel(
+ grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
+ const char *target, grpc_client_channel_type type,
+ grpc_channel_args *args) {
+ GPR_UNREACHABLE_CODE(return NULL);
+}
+
+static const grpc_client_channel_factory_vtable sc_vtable = {
+ client_channel_factory_ref, client_channel_factory_unref,
+ client_channel_factory_create_subchannel,
+ client_channel_factory_create_channel};
-static grpc_subchannel_factory sc_factory = {&sc_vtable};
+static grpc_client_channel_factory cc_factory = {&sc_vtable};
static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -65,7 +71,7 @@ static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
GPR_ASSERT(uri);
memset(&args, 0, sizeof(args));
args.uri = uri;
- args.subchannel_factory = &sc_factory;
+ args.client_channel_factory = &cc_factory;
resolver = grpc_resolver_factory_create_resolver(factory, &args);
GPR_ASSERT(resolver != NULL);
GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds");
@@ -92,8 +98,9 @@ static void test_fails(grpc_resolver_factory *factory, const char *string) {
int main(int argc, char **argv) {
grpc_resolver_factory *dns;
grpc_test_init(argc, argv);
+ grpc_init();
- dns = grpc_dns_resolver_factory_create();
+ dns = grpc_resolver_factory_lookup("dns");
test_succeeds(dns, "dns:10.2.1.1");
test_succeeds(dns, "dns:10.2.1.1:1234");
@@ -101,6 +108,7 @@ int main(int argc, char **argv) {
test_fails(dns, "ipv4://8.8.8.8/8.8.8.8:8888");
grpc_resolver_factory_unref(dns);
+ grpc_shutdown();
return 0;
}
diff --git a/test/core/client_config/resolvers/sockaddr_resolver_test.c b/test/core/client_config/resolvers/sockaddr_resolver_test.c
index 8856c85449..b11546b6b1 100644
--- a/test/core/client_config/resolvers/sockaddr_resolver_test.c
+++ b/test/core/client_config/resolvers/sockaddr_resolver_test.c
@@ -31,29 +31,35 @@
*
*/
-#include "src/core/client_config/resolvers/sockaddr_resolver.h"
-
#include <string.h>
#include <grpc/support/log.h>
-#include "src/core/client_config/resolver.h"
+#include "src/core/ext/client_config/resolver_registry.h"
#include "test/core/util/test_config.h"
-static void subchannel_factory_ref(grpc_subchannel_factory *scv) {}
-static void subchannel_factory_unref(grpc_exec_ctx *exec_ctx,
- grpc_subchannel_factory *scv) {}
-static grpc_subchannel *subchannel_factory_create_subchannel(
- grpc_exec_ctx *exec_ctx, grpc_subchannel_factory *factory,
+static void client_channel_factory_ref(grpc_client_channel_factory *scv) {}
+static void client_channel_factory_unref(grpc_exec_ctx *exec_ctx,
+ grpc_client_channel_factory *scv) {}
+static grpc_subchannel *client_channel_factory_create_subchannel(
+ grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory,
grpc_subchannel_args *args) {
GPR_UNREACHABLE_CODE(return NULL);
}
-static const grpc_subchannel_factory_vtable sc_vtable = {
- subchannel_factory_ref, subchannel_factory_unref,
- subchannel_factory_create_subchannel};
+static grpc_channel *client_channel_factory_create_channel(
+ grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
+ const char *target, grpc_client_channel_type type,
+ grpc_channel_args *args) {
+ GPR_UNREACHABLE_CODE(return NULL);
+}
+
+static const grpc_client_channel_factory_vtable sc_vtable = {
+ client_channel_factory_ref, client_channel_factory_unref,
+ client_channel_factory_create_subchannel,
+ client_channel_factory_create_channel};
-static grpc_subchannel_factory sc_factory = {&sc_vtable};
+static grpc_client_channel_factory cc_factory = {&sc_vtable};
static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -65,7 +71,7 @@ static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
GPR_ASSERT(uri);
memset(&args, 0, sizeof(args));
args.uri = uri;
- args.subchannel_factory = &sc_factory;
+ args.client_channel_factory = &cc_factory;
resolver = grpc_resolver_factory_create_resolver(factory, &args);
GPR_ASSERT(resolver != NULL);
GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds");
@@ -92,12 +98,14 @@ static void test_fails(grpc_resolver_factory *factory, const char *string) {
int main(int argc, char **argv) {
grpc_resolver_factory *ipv4, *ipv6;
grpc_test_init(argc, argv);
+ grpc_init();
- ipv4 = grpc_ipv4_resolver_factory_create();
- ipv6 = grpc_ipv6_resolver_factory_create();
+ ipv4 = grpc_resolver_factory_lookup("ipv4");
+ ipv6 = grpc_resolver_factory_lookup("ipv6");
test_fails(ipv4, "ipv4:10.2.1.1");
test_succeeds(ipv4, "ipv4:10.2.1.1:1234");
+ test_succeeds(ipv4, "ipv4:10.2.1.1:1234,127.0.0.1:4321");
test_fails(ipv4, "ipv4:10.2.1.1:123456");
test_fails(ipv4, "ipv4:www.google.com");
test_fails(ipv4, "ipv4:[");
@@ -111,6 +119,7 @@ int main(int argc, char **argv) {
grpc_resolver_factory_unref(ipv4);
grpc_resolver_factory_unref(ipv6);
+ grpc_shutdown();
return 0;
}
diff --git a/test/core/client_config/set_initial_connect_string_test.c b/test/core/client_config/set_initial_connect_string_test.c
index 3cf267fb3b..83058d9b2c 100644
--- a/test/core/client_config/set_initial_connect_string_test.c
+++ b/test/core/client_config/set_initial_connect_string_test.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,10 +38,10 @@
#include <grpc/support/log.h>
#include <grpc/support/slice.h>
-#include "src/core/client_config/initial_connect_string.h"
-#include "src/core/iomgr/sockaddr.h"
-#include "src/core/security/credentials.h"
-#include "src/core/support/string.h"
+#include "src/core/ext/client_config/initial_connect_string.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/security/credentials.h"
+#include "src/core/lib/support/string.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/core/util/test_tcp_server.h"
diff --git a/test/core/client_config/uri_corpus/02d156dc5e6f2c11c90c2e06fcee04adf036a342 b/test/core/client_config/uri_corpus/02d156dc5e6f2c11c90c2e06fcee04adf036a342
new file mode 100644
index 0000000000..a85e7a8c21
--- /dev/null
+++ b/test/core/client_config/uri_corpus/02d156dc5e6f2c11c90c2e06fcee04adf036a342
@@ -0,0 +1,2 @@
+::nix::ii///ii/\a‡?=n;iI_!';&b.cii??nn!%i!*%
+*; \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/042dc4512fa3d391c5170cf3aa61e6a638f84342 b/test/core/client_config/uri_corpus/042dc4512fa3d391c5170cf3aa61e6a638f84342
new file mode 100644
index 0000000000..597a6db294
--- /dev/null
+++ b/test/core/client_config/uri_corpus/042dc4512fa3d391c5170cf3aa61e6a638f84342
@@ -0,0 +1 @@
+i \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/0e9bbe975f2027e8c39c89f85f667530368e7d11 b/test/core/client_config/uri_corpus/0e9bbe975f2027e8c39c89f85f667530368e7d11
new file mode 100644
index 0000000000..d56b8fc6c8
--- /dev/null
+++ b/test/core/client_config/uri_corpus/0e9bbe975f2027e8c39c89f85f667530368e7d11
@@ -0,0 +1 @@
+:iiiÐ?+n!ij \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/1155aa6ea7ef262a81a63692513ea395f84dad6f b/test/core/client_config/uri_corpus/1155aa6ea7ef262a81a63692513ea395f84dad6f
new file mode 100644
index 0000000000..5b913f1bb8
--- /dev/null
+++ b/test/core/client_config/uri_corpus/1155aa6ea7ef262a81a63692513ea395f84dad6f
@@ -0,0 +1,2 @@
+:ipip~6:‡i:::1
+v:miP/ii:::/iu?n?n)i!= \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/13856a5569ffd085a4d5c07af5f8e9310835a118 b/test/core/client_config/uri_corpus/13856a5569ffd085a4d5c07af5f8e9310835a118
new file mode 100644
index 0000000000..76f157cda5
--- /dev/null
+++ b/test/core/client_config/uri_corpus/13856a5569ffd085a4d5c07af5f8e9310835a118
@@ -0,0 +1 @@
+i:i:‡ii:i?nip~??ni=niI&6.u/n_!'p~ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/14b57bcbf1e17b1db1de491ef2ba3768f704b7dc b/test/core/client_config/uri_corpus/14b57bcbf1e17b1db1de491ef2ba3768f704b7dc
new file mode 100644
index 0000000000..3936e8964c
--- /dev/null
+++ b/test/core/client_config/uri_corpus/14b57bcbf1e17b1db1de491ef2ba3768f704b7dc
@@ -0,0 +1 @@
+:‡i?=niI_!';ñ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/1794310671a060eead6e5ee66ac978a18ec7e84f b/test/core/client_config/uri_corpus/1794310671a060eead6e5ee66ac978a18ec7e84f
new file mode 100644
index 0000000000..a94c4cf58d
--- /dev/null
+++ b/test/core/client_config/uri_corpus/1794310671a060eead6e5ee66ac978a18ec7e84f
@@ -0,0 +1,2 @@
+~ipip~6::1
+v:Ð:1
diff --git a/test/core/client_config/uri_corpus/1d30b2a79afbaf2828ff42b9a9647e942ba1ab80 b/test/core/client_config/uri_corpus/1d30b2a79afbaf2828ff42b9a9647e942ba1ab80
new file mode 100644
index 0000000000..875ac2a4f9
--- /dev/null
+++ b/test/core/client_config/uri_corpus/1d30b2a79afbaf2828ff42b9a9647e942ba1ab80
@@ -0,0 +1 @@
+:il0P/8?n!$i: \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/1fcf5d9c333b70596cf5ba04d1f7affdf445b971 b/test/core/client_config/uri_corpus/1fcf5d9c333b70596cf5ba04d1f7affdf445b971
new file mode 100644
index 0000000000..59469af528
--- /dev/null
+++ b/test/core/client_config/uri_corpus/1fcf5d9c333b70596cf5ba04d1f7affdf445b971
@@ -0,0 +1,3 @@
+iiP*v:::pip~6:::0
+v:::11
+
diff --git a/test/core/client_config/uri_corpus/23162c8a8936e20b195404c21337ee734d02a6bc b/test/core/client_config/uri_corpus/23162c8a8936e20b195404c21337ee734d02a6bc
new file mode 100644
index 0000000000..2f902351bd
--- /dev/null
+++ b/test/core/client_config/uri_corpus/23162c8a8936e20b195404c21337ee734d02a6bc
@@ -0,0 +1 @@
+:ii/i?n!%i* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/23f3198b815ca60bdadcaae682b9f965dda387f1 b/test/core/client_config/uri_corpus/23f3198b815ca60bdadcaae682b9f965dda387f1
new file mode 100644
index 0000000000..4bdc3f60c0
--- /dev/null
+++ b/test/core/client_config/uri_corpus/23f3198b815ca60bdadcaae682b9f965dda387f1
@@ -0,0 +1 @@
+uni::.i?n(!ipR6/ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/2ef3893b43f1f60b77b59ce06a6bce9815d78eaf b/test/core/client_config/uri_corpus/2ef3893b43f1f60b77b59ce06a6bce9815d78eaf
new file mode 100644
index 0000000000..fb7665d0cc
--- /dev/null
+++ b/test/core/client_config/uri_corpus/2ef3893b43f1f60b77b59ce06a6bce9815d78eaf
@@ -0,0 +1,2 @@
+:/i?n!ipv6:./::abc.*
+
diff --git a/test/core/client_config/uri_corpus/356c3c129e203b5c74550b4209764d74b9caefce b/test/core/client_config/uri_corpus/356c3c129e203b5c74550b4209764d74b9caefce
new file mode 100644
index 0000000000..6c1e22fa32
--- /dev/null
+++ b/test/core/client_config/uri_corpus/356c3c129e203b5c74550b4209764d74b9caefce
@@ -0,0 +1 @@
+unix://ii:#v6i?n! \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/396568fc41c8ccb31ec925b4a862e4d29ead1327 b/test/core/client_config/uri_corpus/396568fc41c8ccb31ec925b4a862e4d29ead1327
new file mode 100644
index 0000000000..694d51dc9a
--- /dev/null
+++ b/test/core/client_config/uri_corpus/396568fc41c8ccb31ec925b4a862e4d29ead1327
@@ -0,0 +1 @@
+uni:/i:i:‡i:i:‡i??ni=niIi??ni=niI__!!i?n!i'p'pR2p~~ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/3b1e7526a99918006b87e499d2beb6c4ac9c3c0c b/test/core/client_config/uri_corpus/3b1e7526a99918006b87e499d2beb6c4ac9c3c0c
new file mode 100644
index 0000000000..af80f07d19
--- /dev/null
+++ b/test/core/client_config/uri_corpus/3b1e7526a99918006b87e499d2beb6c4ac9c3c0c
@@ -0,0 +1 @@
+i:i:‡i??ni=niI_!'p~ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/3b58860f3451d3e7aad99690a8d39782ca5116fc b/test/core/client_config/uri_corpus/3b58860f3451d3e7aad99690a8d39782ca5116fc
new file mode 100644
index 0000000000..725b2086c5
--- /dev/null
+++ b/test/core/client_config/uri_corpus/3b58860f3451d3e7aad99690a8d39782ca5116fc
@@ -0,0 +1,4 @@
+i:i?nip~&2./:::abipip~6c.*
+
+::1
+v:Ð:1
diff --git a/test/core/client_config/uri_corpus/41963cc10752f70c3af7e3d85868efb097a0ea9c b/test/core/client_config/uri_corpus/41963cc10752f70c3af7e3d85868efb097a0ea9c
new file mode 100644
index 0000000000..7f0f2ea6ea
--- /dev/null
+++ b/test/core/client_config/uri_corpus/41963cc10752f70c3af7e3d85868efb097a0ea9c
@@ -0,0 +1 @@
+:‡i?=niI_!';; \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/47b5228404451fc9d4071fa69192514bb4ce33c1 b/test/core/client_config/uri_corpus/47b5228404451fc9d4071fa69192514bb4ce33c1
new file mode 100644
index 0000000000..23d52e19a8
--- /dev/null
+++ b/test/core/client_config/uri_corpus/47b5228404451fc9d4071fa69192514bb4ce33c1
@@ -0,0 +1 @@
+:iiP/i?n!'i* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/56a2da4b2e6fb795243901023ed8d0aa083d1aab b/test/core/client_config/uri_corpus/56a2da4b2e6fb795243901023ed8d0aa083d1aab
new file mode 100644
index 0000000000..f975f97059
--- /dev/null
+++ b/test/core/client_config/uri_corpus/56a2da4b2e6fb795243901023ed8d0aa083d1aab
@@ -0,0 +1 @@
+i:i?nip~&6.u/n \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/574c2f13858a9a6d724654bd913ede9ae3abf822 b/test/core/client_config/uri_corpus/574c2f13858a9a6d724654bd913ede9ae3abf822
new file mode 100644
index 0000000000..d5fb7ba274
--- /dev/null
+++ b/test/core/client_config/uri_corpus/574c2f13858a9a6d724654bd913ede9ae3abf822
@@ -0,0 +1,2 @@
+:unix://ii//a.b.ci?n!%
+* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/582f789c19033a152094cbf8565f14154a778ddb b/test/core/client_config/uri_corpus/582f789c19033a152094cbf8565f14154a778ddb
new file mode 100644
index 0000000000..1860e1c5b4
--- /dev/null
+++ b/test/core/client_config/uri_corpus/582f789c19033a152094cbf8565f14154a778ddb
@@ -0,0 +1 @@
+:‡i?P=niIii-i?%n'!%*i= \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/636c5606fc23713a1bae88c8899c0541cfad4fd8 b/test/core/client_config/uri_corpus/636c5606fc23713a1bae88c8899c0541cfad4fd8
new file mode 100644
index 0000000000..1dc4931ac6
--- /dev/null
+++ b/test/core/client_config/uri_corpus/636c5606fc23713a1bae88c8899c0541cfad4fd8
@@ -0,0 +1,4 @@
+:i?n!ip~f2:./::abipip~6c.*
+
+::1
+v:Ð:1
diff --git a/test/core/client_config/uri_corpus/63fe493b270b17426d77a27cbf3abac5b2c2794a b/test/core/client_config/uri_corpus/63fe493b270b17426d77a27cbf3abac5b2c2794a
new file mode 100644
index 0000000000..7b9532914e
--- /dev/null
+++ b/test/core/client_config/uri_corpus/63fe493b270b17426d77a27cbf3abac5b2c2794a
@@ -0,0 +1 @@
+:‡i?=niI!';ñ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/655300a902b62662296a8e46bfb04fbcb07182cb b/test/core/client_config/uri_corpus/655300a902b62662296a8e46bfb04fbcb07182cb
new file mode 100644
index 0000000000..4eaca39265
--- /dev/null
+++ b/test/core/client_config/uri_corpus/655300a902b62662296a8e46bfb04fbcb07182cb
@@ -0,0 +1 @@
+unix://ii:pv6i?n! \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/6ae3acd9d8507b61bf235748026080a4138dba58 b/test/core/client_config/uri_corpus/6ae3acd9d8507b61bf235748026080a4138dba58
new file mode 100644
index 0000000000..fe908d213a
--- /dev/null
+++ b/test/core/client_config/uri_corpus/6ae3acd9d8507b61bf235748026080a4138dba58
@@ -0,0 +1 @@
+uni::.ilP:%:%i:i‡i:‡i?=nii?n(!ipRI_&/.i;;!?=ii/?n#lniiI_!*Kii!/?ni* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/6b70979a70a038ff6607d6cf85485ee95baf58e6 b/test/core/client_config/uri_corpus/6b70979a70a038ff6607d6cf85485ee95baf58e6
new file mode 100644
index 0000000000..57cbd72dbc
--- /dev/null
+++ b/test/core/client_config/uri_corpus/6b70979a70a038ff6607d6cf85485ee95baf58e6
@@ -0,0 +1 @@
+uni::/i?n!ipR6/ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/7314ab3545a7535a26e0e8aad67caea5534d68b1 b/test/core/client_config/uri_corpus/7314ab3545a7535a26e0e8aad67caea5534d68b1
new file mode 100644
index 0000000000..e13cf5a8e6
--- /dev/null
+++ b/test/core/client_config/uri_corpus/7314ab3545a7535a26e0e8aad67caea5534d68b1
@@ -0,0 +1,2 @@
+ipip~6:::1
+v:::1
diff --git a/test/core/client_config/uri_corpus/7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb b/test/core/client_config/uri_corpus/7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb
new file mode 100644
index 0000000000..0e7f44caf2
--- /dev/null
+++ b/test/core/client_config/uri_corpus/7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb
@@ -0,0 +1 @@
+i:i:‡i:i:‡i??ni=niIi??ni=niI__!!'p'p~~ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/87daa131e0973b77a232a870ed749ef29cf58e6d b/test/core/client_config/uri_corpus/87daa131e0973b77a232a870ed749ef29cf58e6d
new file mode 100644
index 0000000000..679f13e307
--- /dev/null
+++ b/test/core/client_config/uri_corpus/87daa131e0973b77a232a870ed749ef29cf58e6d
@@ -0,0 +1,2 @@
+unix:///a/:.:ii/i?nc!%
+i* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/884dcaee2908ffe5f12b65b8eba81016099c4266 b/test/core/client_config/uri_corpus/884dcaee2908ffe5f12b65b8eba81016099c4266
new file mode 100644
index 0000000000..58ecc7e2af
--- /dev/null
+++ b/test/core/client_config/uri_corpus/884dcaee2908ffe5f12b65b8eba81016099c4266
@@ -0,0 +1 @@
+ip*v:::1
diff --git a/test/core/client_config/uri_corpus/8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb b/test/core/client_config/uri_corpus/8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb
new file mode 100644
index 0000000000..ffd807b39e
--- /dev/null
+++ b/test/core/client_config/uri_corpus/8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb
@@ -0,0 +1 @@
+ilP:%i:‡i?=niI_.i;;!ii/?nni*! \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/9671149af0b444f59bbdf71340d3441dadd8a7b4 b/test/core/client_config/uri_corpus/9671149af0b444f59bbdf71340d3441dadd8a7b4
new file mode 100644
index 0000000000..8ad79f9eb9
--- /dev/null
+++ b/test/core/client_config/uri_corpus/9671149af0b444f59bbdf71340d3441dadd8a7b4
@@ -0,0 +1 @@
+:‡i?P-niI%'i= \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/96c8d266b7dc037288ef305c996608270f72e7fb b/test/core/client_config/uri_corpus/96c8d266b7dc037288ef305c996608270f72e7fb
new file mode 100644
index 0000000000..efb392b7d9
--- /dev/null
+++ b/test/core/client_config/uri_corpus/96c8d266b7dc037288ef305c996608270f72e7fb
@@ -0,0 +1,2 @@
+:/i/n!ipv6:::/a.b.c1
+
diff --git a/test/core/client_config/uri_corpus/975536c71ade4800415a7e9c2f1b45c35a6d5ea8 b/test/core/client_config/uri_corpus/975536c71ade4800415a7e9c2f1b45c35a6d5ea8
new file mode 100644
index 0000000000..7155222547
--- /dev/null
+++ b/test/core/client_config/uri_corpus/975536c71ade4800415a7e9c2f1b45c35a6d5ea8
@@ -0,0 +1 @@
+ilP.i;?n!#i!; \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/99750aa67d30beaea8af565c829d4999aa8cb91b b/test/core/client_config/uri_corpus/99750aa67d30beaea8af565c829d4999aa8cb91b
new file mode 100644
index 0000000000..4061e02189
--- /dev/null
+++ b/test/core/client_config/uri_corpus/99750aa67d30beaea8af565c829d4999aa8cb91b
@@ -0,0 +1 @@
+unix::/i?n!ipv6/ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/a1140f3f8b5cffc1010221b9a4084a25fb75c1f6 b/test/core/client_config/uri_corpus/a1140f3f8b5cffc1010221b9a4084a25fb75c1f6
new file mode 100644
index 0000000000..facb11c5ed
--- /dev/null
+++ b/test/core/client_config/uri_corpus/a1140f3f8b5cffc1010221b9a4084a25fb75c1f6
@@ -0,0 +1 @@
+:%i:‡i?=niI_!ii/?ni*! \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de b/test/core/client_config/uri_corpus/a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de
new file mode 100644
index 0000000000..736e63e7e7
--- /dev/null
+++ b/test/core/client_config/uri_corpus/a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de
@@ -0,0 +1 @@
+:¢ilP/i;n!#i: \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/a296eb3d1d436ed7df7195b10aa3c4de3896f98d b/test/core/client_config/uri_corpus/a296eb3d1d436ed7df7195b10aa3c4de3896f98d
new file mode 100644
index 0000000000..dff2f8920d
--- /dev/null
+++ b/test/core/client_config/uri_corpus/a296eb3d1d436ed7df7195b10aa3c4de3896f98d
@@ -0,0 +1 @@
+u+ni::/i?n!ipR3/ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/a8b8e66050b424f1b8c07d46f868199fb7f60e38 b/test/core/client_config/uri_corpus/a8b8e66050b424f1b8c07d46f868199fb7f60e38
new file mode 100644
index 0000000000..13a115481d
--- /dev/null
+++ b/test/core/client_config/uri_corpus/a8b8e66050b424f1b8c07d46f868199fb7f60e38
@@ -0,0 +1 @@
+uni::pi:miP/?ni.!(Ri?)8/n!'i* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/aba1472880406a318ce207ee79815b7acf087757 b/test/core/client_config/uri_corpus/aba1472880406a318ce207ee79815b7acf087757
new file mode 100644
index 0000000000..b7e7e970f8
--- /dev/null
+++ b/test/core/client_config/uri_corpus/aba1472880406a318ce207ee79815b7acf087757
@@ -0,0 +1 @@
+:iI/i?n!%š* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/af55baf8c8855e563befdf1eefbcbd46c5ddb8d2 b/test/core/client_config/uri_corpus/af55baf8c8855e563befdf1eefbcbd46c5ddb8d2
new file mode 100644
index 0000000000..fe019fc409
--- /dev/null
+++ b/test/core/client_config/uri_corpus/af55baf8c8855e563befdf1eefbcbd46c5ddb8d2
@@ -0,0 +1 @@
+uni::.i!in:/i/n!ipv6ž:?(pR;::/a.2b \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/b3c0bf66c2bf5d24ef1daf4cc5a9d6d5bd0e8bfd b/test/core/client_config/uri_corpus/b3c0bf66c2bf5d24ef1daf4cc5a9d6d5bd0e8bfd
new file mode 100644
index 0000000000..6e12167b52
--- /dev/null
+++ b/test/core/client_config/uri_corpus/b3c0bf66c2bf5d24ef1daf4cc5a9d6d5bd0e8bfd
@@ -0,0 +1 @@
+:ii/iilP.i;?n?n!#i!;!%* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/c28a47409cf5d95bb372238d01e73d8b831408e4 b/test/core/client_config/uri_corpus/c28a47409cf5d95bb372238d01e73d8b831408e4
new file mode 100644
index 0000000000..119b0808c9
--- /dev/null
+++ b/test/core/client_config/uri_corpus/c28a47409cf5d95bb372238d01e73d8b831408e4
@@ -0,0 +1 @@
+:%i:i‡?=#liI_!Kii/?ni* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/c3ef1d41888063a08700c3add1e4465aabcf8807 b/test/core/client_config/uri_corpus/c3ef1d41888063a08700c3add1e4465aabcf8807
new file mode 100644
index 0000000000..01db5d8aa4
--- /dev/null
+++ b/test/core/client_config/uri_corpus/c3ef1d41888063a08700c3add1e4465aabcf8807
@@ -0,0 +1,2 @@
+::unix://ii//a‡?=niI_!';.b.ci?n!%
+*; \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/c550a76af21f9b9cc92a386d5c8998b26f8f2e4d b/test/core/client_config/uri_corpus/c550a76af21f9b9cc92a386d5c8998b26f8f2e4d
new file mode 100644
index 0000000000..2ccb535449
--- /dev/null
+++ b/test/core/client_config/uri_corpus/c550a76af21f9b9cc92a386d5c8998b26f8f2e4d
@@ -0,0 +1 @@
+uni::.i?n(!ipR&/ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/c79721406d0ab80495f186fd88e37fba98637ae9 b/test/core/client_config/uri_corpus/c79721406d0ab80495f186fd88e37fba98637ae9
new file mode 100644
index 0000000000..f3c0404be7
--- /dev/null
+++ b/test/core/client_config/uri_corpus/c79721406d0ab80495f186fd88e37fba98637ae9
@@ -0,0 +1 @@
+::nix::ii///ii/\a:‡?=n;iI_!';&b.ciii \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/ceb4e2264ba7a8d5be47d276b37ec09489e00245 b/test/core/client_config/uri_corpus/ceb4e2264ba7a8d5be47d276b37ec09489e00245
new file mode 100644
index 0000000000..b5655220d7
--- /dev/null
+++ b/test/core/client_config/uri_corpus/ceb4e2264ba7a8d5be47d276b37ec09489e00245
@@ -0,0 +1 @@
+:‡i?P-niI!'iñ \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/cf4395958f5bfb46fd6f535a39657d016c75114c b/test/core/client_config/uri_corpus/cf4395958f5bfb46fd6f535a39657d016c75114c
new file mode 100644
index 0000000000..a7656724f5
--- /dev/null
+++ b/test/core/client_config/uri_corpus/cf4395958f5bfb46fd6f535a39657d016c75114c
@@ -0,0 +1 @@
+unix://ipv6::: \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/d46668372b7e20154a89409a7430a28e642afdca b/test/core/client_config/uri_corpus/d46668372b7e20154a89409a7430a28e642afdca
new file mode 100644
index 0000000000..d658fb8ee0
--- /dev/null
+++ b/test/core/client_config/uri_corpus/d46668372b7e20154a89409a7430a28e642afdca
@@ -0,0 +1 @@
+:ilP/i?n!#i: \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/d6fe7412a0a1d1c733160246f3fa425f4f97682a b/test/core/client_config/uri_corpus/d6fe7412a0a1d1c733160246f3fa425f4f97682a
new file mode 100644
index 0000000000..6d37b5fd45
--- /dev/null
+++ b/test/core/client_config/uri_corpus/d6fe7412a0a1d1c733160246f3fa425f4f97682a
@@ -0,0 +1 @@
+:ilP/i?n,!#i: \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/dns.txt b/test/core/client_config/uri_corpus/dns.txt
new file mode 100644
index 0000000000..577e1054e4
--- /dev/null
+++ b/test/core/client_config/uri_corpus/dns.txt
@@ -0,0 +1 @@
+dns:10.2.1.1
diff --git a/test/core/client_config/uri_corpus/e241f29957b0e30ec11aaaf91b2339f7015fa5fd b/test/core/client_config/uri_corpus/e241f29957b0e30ec11aaaf91b2339f7015fa5fd
new file mode 100644
index 0000000000..497bfd37ee
--- /dev/null
+++ b/test/core/client_config/uri_corpus/e241f29957b0e30ec11aaaf91b2339f7015fa5fd
@@ -0,0 +1 @@
+ilP:%:%i:i‡i:‡i?=niI_.i;;!?=ii/?n#lniiI_!*Kii!/?ni* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/ea02d9fea9bad5b89cf353a0169238f584177e71 b/test/core/client_config/uri_corpus/ea02d9fea9bad5b89cf353a0169238f584177e71
new file mode 100644
index 0000000000..52f5a2382a
--- /dev/null
+++ b/test/core/client_config/uri_corpus/ea02d9fea9bad5b89cf353a0169238f584177e71
@@ -0,0 +1,4 @@
+i:i?n!ip~f2.:/::abipip~6c.*
+
+::1
+v:Ð:1
diff --git a/test/core/client_config/uri_corpus/ec4731dddf94ed3ea92ae4d5a71f145ab6e3f6ee b/test/core/client_config/uri_corpus/ec4731dddf94ed3ea92ae4d5a71f145ab6e3f6ee
new file mode 100644
index 0000000000..c3c93fed6a
--- /dev/null
+++ b/test/core/client_config/uri_corpus/ec4731dddf94ed3ea92ae4d5a71f145ab6e3f6ee
@@ -0,0 +1 @@
+ii-i?n!%* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/ed2f78646f19fc47dd85ff0877c232b71913ece2 b/test/core/client_config/uri_corpus/ed2f78646f19fc47dd85ff0877c232b71913ece2
new file mode 100644
index 0000000000..45065e2f00
--- /dev/null
+++ b/test/core/client_config/uri_corpus/ed2f78646f19fc47dd85ff0877c232b71913ece2
@@ -0,0 +1 @@
+:ii/i?n!%* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/f6889f4a6350fea1596a3adea5cdac02bd5d1ff3 b/test/core/client_config/uri_corpus/f6889f4a6350fea1596a3adea5cdac02bd5d1ff3
new file mode 100644
index 0000000000..02151c8b6a
--- /dev/null
+++ b/test/core/client_config/uri_corpus/f6889f4a6350fea1596a3adea5cdac02bd5d1ff3
@@ -0,0 +1,2 @@
+:ipip~6:::1
+vii/:::iunix:?n/1/ipv6!% \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/f6f3bd030f0d321efe7c51ca3f057de23509af67 b/test/core/client_config/uri_corpus/f6f3bd030f0d321efe7c51ca3f057de23509af67
new file mode 100644
index 0000000000..8034e133d7
--- /dev/null
+++ b/test/core/client_config/uri_corpus/f6f3bd030f0d321efe7c51ca3f057de23509af67
@@ -0,0 +1 @@
+:iiP/i?n!i* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/f97598cff03306af3c70400608fec47268b5075d b/test/core/client_config/uri_corpus/f97598cff03306af3c70400608fec47268b5075d
new file mode 100644
index 0000000000..240946dbaa
--- /dev/null
+++ b/test/core/client_config/uri_corpus/f97598cff03306af3c70400608fec47268b5075d
@@ -0,0 +1,2 @@
+unix://ipv6:::/a.b.c1
+
diff --git a/test/core/client_config/uri_corpus/f9e1ec1fc642b575bc9955618b7065747f56b101 b/test/core/client_config/uri_corpus/f9e1ec1fc642b575bc9955618b7065747f56b101
new file mode 100644
index 0000000000..d089a59346
--- /dev/null
+++ b/test/core/client_config/uri_corpus/f9e1ec1fc642b575bc9955618b7065747f56b101
@@ -0,0 +1 @@
+:ilP.i;?n!#i; \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/fe0630a3aeed2ec6f474f362e4c839478290d5c4 b/test/core/client_config/uri_corpus/fe0630a3aeed2ec6f474f362e4c839478290d5c4
new file mode 100644
index 0000000000..66eefbcc14
--- /dev/null
+++ b/test/core/client_config/uri_corpus/fe0630a3aeed2ec6f474f362e4c839478290d5c4
@@ -0,0 +1 @@
+:miP/i?)n!'i* \ No newline at end of file
diff --git a/test/core/client_config/uri_corpus/ipv4.txt b/test/core/client_config/uri_corpus/ipv4.txt
new file mode 100644
index 0000000000..fe29486b6e
--- /dev/null
+++ b/test/core/client_config/uri_corpus/ipv4.txt
@@ -0,0 +1 @@
+ipv4:10.2.1.1
diff --git a/test/core/client_config/uri_corpus/ipv6.txt b/test/core/client_config/uri_corpus/ipv6.txt
new file mode 100644
index 0000000000..7b6932be00
--- /dev/null
+++ b/test/core/client_config/uri_corpus/ipv6.txt
@@ -0,0 +1 @@
+ipv6:::1
diff --git a/test/core/client_config/uri_corpus/unix.txt b/test/core/client_config/uri_corpus/unix.txt
new file mode 100644
index 0000000000..7a0997ec9a
--- /dev/null
+++ b/test/core/client_config/uri_corpus/unix.txt
@@ -0,0 +1 @@
+unix:///a.b.c
diff --git a/test/core/client_config/uri_fuzzer_test.c b/test/core/client_config/uri_fuzzer_test.c
new file mode 100644
index 0000000000..eb976fc9f5
--- /dev/null
+++ b/test/core/client_config/uri_fuzzer_test.c
@@ -0,0 +1,52 @@
+/*
+ *
+ * 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 <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/ext/client_config/uri_parser.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ char *s = gpr_malloc(size + 1);
+ memcpy(s, data, size);
+ s[size] = 0;
+
+ grpc_uri *x;
+ if ((x = grpc_uri_parse(s, 1))) {
+ grpc_uri_destroy(x);
+ }
+ gpr_free(s);
+ return 0;
+}
diff --git a/test/core/client_config/uri_parser_test.c b/test/core/client_config/uri_parser_test.c
index df12d6b4cb..323e8b6f70 100644
--- a/test/core/client_config/uri_parser_test.c
+++ b/test/core/client_config/uri_parser_test.c
@@ -31,7 +31,7 @@
*
*/
-#include "src/core/client_config/uri_parser.h"
+#include "src/core/ext/client_config/uri_parser.h"
#include <string.h>
@@ -56,6 +56,73 @@ static void test_fails(const char *uri_text) {
GPR_ASSERT(NULL == grpc_uri_parse(uri_text, 0));
}
+static void test_query_parts() {
+ {
+ const char *uri_text = "http://foo/path?a&b=B&c=&#frag";
+ grpc_uri *uri = grpc_uri_parse(uri_text, 0);
+ GPR_ASSERT(uri);
+
+ GPR_ASSERT(0 == strcmp("http", uri->scheme));
+ GPR_ASSERT(0 == strcmp("foo", uri->authority));
+ GPR_ASSERT(0 == strcmp("/path", uri->path));
+ GPR_ASSERT(0 == strcmp("a&b=B&c=&", uri->query));
+ GPR_ASSERT(4 == uri->num_query_parts);
+
+ GPR_ASSERT(0 == strcmp("a", uri->query_parts[0]));
+ GPR_ASSERT(NULL == uri->query_parts_values[0]);
+
+ GPR_ASSERT(0 == strcmp("b", uri->query_parts[1]));
+ GPR_ASSERT(0 == strcmp("B", uri->query_parts_values[1]));
+
+ GPR_ASSERT(0 == strcmp("c", uri->query_parts[2]));
+ GPR_ASSERT(0 == strcmp("", uri->query_parts_values[2]));
+
+ GPR_ASSERT(0 == strcmp("", uri->query_parts[3]));
+ GPR_ASSERT(NULL == uri->query_parts_values[3]);
+
+ GPR_ASSERT(NULL == grpc_uri_get_query_arg(uri, "a"));
+ GPR_ASSERT(0 == strcmp("B", grpc_uri_get_query_arg(uri, "b")));
+ GPR_ASSERT(0 == strcmp("", grpc_uri_get_query_arg(uri, "c")));
+ GPR_ASSERT(NULL == grpc_uri_get_query_arg(uri, ""));
+
+ GPR_ASSERT(0 == strcmp("frag", uri->fragment));
+ grpc_uri_destroy(uri);
+ }
+ {
+ /* test the current behavior of multiple query part values */
+ const char *uri_text = "http://auth/path?foo=bar=baz&foobar==";
+ grpc_uri *uri = grpc_uri_parse(uri_text, 0);
+ GPR_ASSERT(uri);
+
+ GPR_ASSERT(0 == strcmp("http", uri->scheme));
+ GPR_ASSERT(0 == strcmp("auth", uri->authority));
+ GPR_ASSERT(0 == strcmp("/path", uri->path));
+ GPR_ASSERT(0 == strcmp("foo=bar=baz&foobar==", uri->query));
+ GPR_ASSERT(2 == uri->num_query_parts);
+
+ GPR_ASSERT(0 == strcmp("bar", grpc_uri_get_query_arg(uri, "foo")));
+ GPR_ASSERT(0 == strcmp("", grpc_uri_get_query_arg(uri, "foobar")));
+
+ grpc_uri_destroy(uri);
+ }
+ {
+ /* empty query */
+ const char *uri_text = "http://foo/path";
+ grpc_uri *uri = grpc_uri_parse(uri_text, 0);
+ GPR_ASSERT(uri);
+
+ GPR_ASSERT(0 == strcmp("http", uri->scheme));
+ GPR_ASSERT(0 == strcmp("foo", uri->authority));
+ GPR_ASSERT(0 == strcmp("/path", uri->path));
+ GPR_ASSERT(0 == strcmp("", uri->query));
+ GPR_ASSERT(0 == uri->num_query_parts);
+ GPR_ASSERT(NULL == uri->query_parts);
+ GPR_ASSERT(NULL == uri->query_parts_values);
+ GPR_ASSERT(0 == strcmp("", uri->fragment));
+ grpc_uri_destroy(uri);
+ }
+}
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
test_succeeds("http://www.google.com", "http", "www.google.com", "", "", "");
@@ -82,5 +149,6 @@ int main(int argc, char **argv) {
test_fails("http://foo?x[bar]");
test_fails("http://foo?bar#lol#");
+ test_query_parts();
return 0;
}