Unverified Commit b21a771e authored by Willy Tarreau's avatar Willy Tarreau Committed by Nils Goroll

vtc_haproxy: support passing extra arguments via HAPROXY_ARGS

We're missing the ability to easily pass some extra debugging options,
typically memory poisonning or memory limitations, while executing tests.
Let's add the consideration for the HAPROXY_ARGS environment variable, to
optionally prepend a series of arguments.
parent 6a77c5e7
......@@ -49,6 +49,7 @@
#include "vtim.h"
#define HAPROXY_PROGRAM_ENV_VAR "HAPROXY_PROGRAM"
#define HAPROXY_ARGS_ENV_VAR "HAPROXY_ARGS"
#define HAPROXY_OPT_WORKER "-W"
#define HAPROXY_OPT_MCLI "-S"
#define HAPROXY_OPT_DAEMON "-D"
......@@ -566,6 +567,7 @@ haproxy_new(const char *name)
int closed_sock;
char addr[128], port[128];
const char *err;
const char *env_args;
char vsabuf[vsa_suckaddr_len];
struct suckaddr *sua;
......@@ -574,6 +576,11 @@ haproxy_new(const char *name)
REPLACE(h->name, name);
h->args = VSB_new_auto();
env_args = getenv(HAPROXY_ARGS_ENV_VAR);
if (env_args) {
VSB_cat(h->args, env_args);
VSB_cat(h->args, " ");
}
h->vl = vtc_logopen("%s", name);
vtc_log_set_cmd(h->vl, haproxy_cli_cmds);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment