aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/httpcli/httpcli_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/httpcli/httpcli_test.c')
-rw-r--r--test/core/httpcli/httpcli_test.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/test/core/httpcli/httpcli_test.c b/test/core/httpcli/httpcli_test.c
index da1463329d..fbc5d4abe7 100644
--- a/test/core/httpcli/httpcli_test.c
+++ b/test/core/httpcli/httpcli_test.c
@@ -144,31 +144,35 @@ int main(int argc, char **argv) {
char *lslash = strrchr(me, '/');
char *args[4];
int port = grpc_pick_unused_port_or_die();
+ int arg_shift = 0;
+ /* figure out where we are */
+ char *root;
+ if (lslash) {
+ root = gpr_malloc((size_t)(lslash - me + 1));
+ memcpy(root, me, (size_t)(lslash - me));
+ root[lslash - me] = 0;
+ } else {
+ root = gpr_strdup(".");
+ }
GPR_ASSERT(argc <= 2);
if (argc == 2) {
args[0] = gpr_strdup(argv[1]);
} else {
- /* figure out where we are */
- char *root;
- if (lslash) {
- root = gpr_malloc((size_t)(lslash - me + 1));
- memcpy(root, me, (size_t)(lslash - me));
- root[lslash - me] = 0;
- } else {
- root = gpr_strdup(".");
- }
- gpr_asprintf(&args[0], "%s/../../test/core/httpcli/test_server.py", root);
- gpr_free(root);
+ arg_shift = 1;
+ gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root);
+ gpr_asprintf(&args[1], "%s/../../test/core/httpcli/test_server.py", root);
}
/* start the server */
- args[1] = "--port";
- gpr_asprintf(&args[2], "%d", port);
- server = gpr_subprocess_create(3, (const char **)args);
+ args[1 + arg_shift] = "--port";
+ gpr_asprintf(&args[2 + arg_shift], "%d", port);
+ server = gpr_subprocess_create(3 + arg_shift, (const char **)args);
GPR_ASSERT(server);
gpr_free(args[0]);
- gpr_free(args[2]);
+ if (arg_shift) gpr_free(args[1]);
+ gpr_free(args[2 + arg_shift]);
+ gpr_free(root);
gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_seconds(5, GPR_TIMESPAN)));