aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-09-06 12:50:42 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-09-06 12:50:42 -0700
commit39b5871d7b1da79945c87f98acc4cbbd499ecfba (patch)
tree69a8bfe3a9e210264ab687376b2032421ff34bf7 /test/core
parent6c3295a5a263d853e3ceb163c7b230c2d87374f6 (diff)
Use http_proxy environment variable instead of URI query param.
Diffstat (limited to 'test/core')
-rw-r--r--test/core/client_config/uri_parser_test.c2
-rw-r--r--test/core/end2end/fixtures/h2_http_proxy.c11
-rw-r--r--test/core/end2end/fixtures/http_proxy.c2
3 files changed, 7 insertions, 8 deletions
diff --git a/test/core/client_config/uri_parser_test.c b/test/core/client_config/uri_parser_test.c
index 4bc3d1e39f..323e8b6f70 100644
--- a/test/core/client_config/uri_parser_test.c
+++ b/test/core/client_config/uri_parser_test.c
@@ -142,8 +142,6 @@ int main(int argc, char **argv) {
test_succeeds("http:?legit#twice", "http", "", "", "legit", "twice");
test_succeeds("http://foo?bar#lol?", "http", "foo", "", "bar", "lol?");
test_succeeds("http://foo?bar#lol?/", "http", "foo", "", "bar", "lol?/");
- test_succeeds("dns:///server:123?http_proxy=proxy:456", "dns", "",
- "/server:123", "http_proxy=proxy:456", "");
test_fails("xyz");
test_fails("http:?dangling-pct-%0");
diff --git a/test/core/end2end/fixtures/h2_http_proxy.c b/test/core/end2end/fixtures/h2_http_proxy.c
index 612a3dbb83..a675a11f66 100644
--- a/test/core/end2end/fixtures/h2_http_proxy.c
+++ b/test/core/end2end/fixtures/h2_http_proxy.c
@@ -46,6 +46,7 @@
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_server_filter.h"
+#include "src/core/lib/support/env.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h"
#include "test/core/end2end/fixtures/http_proxy.h"
@@ -76,12 +77,12 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
grpc_channel_args *client_args) {
fullstack_fixture_data *ffd = f->fixture_data;
- char *target_uri;
- gpr_asprintf(&target_uri, "%s?http_proxy=%s", ffd->server_addr,
+ char *proxy_uri;
+ gpr_asprintf(&proxy_uri, "http://%s",
grpc_end2end_http_proxy_get_proxy_name(ffd->proxy));
- gpr_log(GPR_INFO, "target_uri: %s", target_uri);
- f->client = grpc_insecure_channel_create(target_uri, client_args, NULL);
- gpr_free(target_uri);
+ gpr_setenv("http_proxy", proxy_uri);
+ gpr_free(proxy_uri);
+ f->client = grpc_insecure_channel_create(ffd->server_addr, client_args, NULL);
GPR_ASSERT(f->client);
}
diff --git a/test/core/end2end/fixtures/http_proxy.c b/test/core/end2end/fixtures/http_proxy.c
index b4c0dfba61..c92f869be1 100644
--- a/test/core/end2end/fixtures/http_proxy.c
+++ b/test/core/end2end/fixtures/http_proxy.c
@@ -122,7 +122,7 @@ static void proxy_connection_failed(grpc_exec_ctx* exec_ctx,
proxy_connection* conn, bool is_client,
const char* prefix, grpc_error* error) {
const char* msg = grpc_error_string(error);
- gpr_log(GPR_ERROR, "%s: %s", prefix, msg);
+ gpr_log(GPR_INFO, "%s: %s", prefix, msg);
grpc_error_free_string(msg);
grpc_endpoint_shutdown(exec_ctx, conn->client_endpoint);
if (conn->server_endpoint != NULL)