Skip to content
Snippets Groups Projects
Commit c27a99b0 authored by Nicolas "Pixel" Noble's avatar Nicolas "Pixel" Noble
Browse files

Allows http(s)cli_test's server.py override.

parent b334855a
No related branches found
No related tags found
No related merge requests found
......@@ -142,19 +142,26 @@ int main(int argc, char **argv) {
char *me = argv[0];
char *lslash = strrchr(me, '/');
char *args[4];
char root[1024];
int port = grpc_pick_unused_port_or_die();
/* figure out where we are */
if (lslash) {
memcpy(root, me, (size_t)(lslash - me));
root[lslash - me] = 0;
GPR_ASSERT(argc <= 2);
if (argc == 2) {
args[0] = gpr_strdup(argv[1]);
} else {
strcpy(root, ".");
/* figure out where we are */
char *root;
if (lslash) {
root = gpr_malloc(lslash - me + 1);
memcpy(root, me, (size_t)(lslash - me));
root[lslash - me] = 0;
} else {
root = strdup(".");
}
gpr_asprintf(&args[0], "%s/../../test/core/httpcli/test_server.py", root);
gpr_free(root);
}
/* start the server */
gpr_asprintf(&args[0], "%s/../../test/core/httpcli/test_server.py", root);
args[1] = "--port";
gpr_asprintf(&args[2], "%d", port);
server = gpr_subprocess_create(3, (const char **)args);
......
......@@ -144,19 +144,26 @@ int main(int argc, char **argv) {
char *me = argv[0];
char *lslash = strrchr(me, '/');
char *args[5];
char root[1024];
int port = grpc_pick_unused_port_or_die();
/* figure out where we are */
if (lslash) {
memcpy(root, me, (size_t)(lslash - me));
root[lslash - me] = 0;
GPR_ASSERT(argc <= 2);
if (argc == 2) {
args[0] = gpr_strdup(argv[1]);
} else {
strcpy(root, ".");
/* figure out where we are */
char *root;
if (lslash) {
root = gpr_malloc(lslash - me + 1);
memcpy(root, me, (size_t)(lslash - me));
root[lslash - me] = 0;
} else {
strcpy(root, ".");
}
gpr_asprintf(&args[0], "%s/../../test/core/httpcli/test_server.py", root);
gpr_free(root);
}
/* start the server */
gpr_asprintf(&args[0], "%s/../../test/core/httpcli/test_server.py", root);
args[1] = "--port";
gpr_asprintf(&args[2], "%d", port);
args[3] = "--ssl";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment