Skip to content

Commit

Permalink
Generalize varnishd_args to varnishd_args_prepend and varnishd_args_a…
Browse files Browse the repository at this point in the history
…ppend
  • Loading branch information
nigoroll committed Jul 9, 2023
1 parent d93609f commit ea44b0b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions bin/varnishtest/vtc_varnish.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ varnish_launch(struct varnish *v)
VSB_cat(vsb, "cd ${pwd} &&");
VSB_printf(vsb, " exec varnishd %s -d -n %s -i %s",
v->jail, v->workdir, v->name);
if (macro_isdef(NULL, "varnishd_args_prepend")) {
VSB_putc(vsb, ' ');
macro_cat(v->vl, vsb, "varnishd_args_prepend", NULL);
}
VSB_cat(vsb, VSB_data(params_vsb));
if (leave_temp) {
VSB_cat(vsb, " -p debug=+vcl_keep");
Expand All @@ -430,9 +434,9 @@ varnish_launch(struct varnish *v)
if (vmod_path != NULL)
VSB_printf(vsb, " -p vmod_path=%s", vmod_path);
VSB_printf(vsb, " %s", VSB_data(v->args));
if (macro_isdef(NULL, "varnishd_args")) {
if (macro_isdef(NULL, "varnishd_args_append")) {
VSB_putc(vsb, ' ');
macro_cat(v->vl, vsb, "varnishd_args", NULL);
macro_cat(v->vl, vsb, "varnishd_args_append", NULL);
}
AZ(VSB_finish(vsb));
vtc_log(v->vl, 3, "CMD: %s", VSB_data(vsb));
Expand Down Expand Up @@ -1072,11 +1076,12 @@ vsl_catchup(struct varnish *v)
* \-arg STRING
* Pass an argument to varnishd, for example "-h simple_list".
*
* If the ${varnishd_args} macro is defined, it is expanded and
* appended to the varnishd command line, before the command line
* itself is expanded. This enables tweaks to the varnishd command
* line without editing test cases. This macro can be defined using
* the ``-D`` option for varnishtest.
* If the ${varnishd_args_prepend} or ${varnishd_args_append} macros are
* defined, they are expanded and inserted before / appended to the
* varnishd command line as constructed by varnishtest, before the
* command line itself is expanded. This enables tweaks to the varnishd
* command line without editing test cases. This macros can be defined
* using the ``-D`` option for varnishtest.
*
* \-vcl STRING
* Specify the VCL to load on this Varnish instance. You'll probably
Expand Down

0 comments on commit ea44b0b

Please sign in to comment.