From: phk Date: Fri, 1 Aug 2008 08:23:30 +0000 (+0000) Subject: Add X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f30e1a2b57b506e0f10464c88b4f7a8368a95f1;p=varnish Add -cliok and -clierr git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3051 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishtest/vtc_varnish.c b/varnish-cache/bin/varnishtest/vtc_varnish.c index b725339d..3a65b520 100644 --- a/varnish-cache/bin/varnishtest/vtc_varnish.c +++ b/varnish-cache/bin/varnishtest/vtc_varnish.c @@ -301,7 +301,7 @@ varnish_wait(struct varnish *v) */ static void -varnish_cli(struct varnish *v, const char *cli) +varnish_cli(struct varnish *v, const char *cli, unsigned exp) { enum cli_status_e u; @@ -309,6 +309,8 @@ varnish_cli(struct varnish *v, const char *cli) varnish_launch(v); u = varnish_ask_cli(v, cli, NULL); vtc_log(v->vl, 2, "CLI %03u <%s>", u, cli); + if (exp != 0 && exp != u) + vtc_log(v->vl, 0, "FAIL CLI response %u expected %u", u, exp); } /********************************************************************** @@ -470,25 +472,42 @@ cmd_varnish(CMD_ARGS) for (; *av != NULL; av++) { if (!strcmp(*av, "-telnet")) { + AN(av[1]); v->telnet = av[1]; av++; continue; } if (!strcmp(*av, "-accept")) { + AN(av[1]); v->accept = av[1]; av++; continue; } if (!strcmp(*av, "-arg")) { + AN(av[1]); v->args = av[1]; av++; continue; } if (!strcmp(*av, "-cli")) { - varnish_cli(v, av[1]); + AN(av[1]); + varnish_cli(v, av[1], 0); av++; continue; } + if (!strcmp(*av, "-cliok")) { + AN(av[1]); + varnish_cli(v, av[1], CLIS_OK); + av++; + continue; + } + if (!strcmp(*av, "-clierr")) { + AN(av[1]); + AN(av[2]); + varnish_cli(v, av[2], atoi(av[1])); + av += 2; + continue; + } if (!strcmp(*av, "-launch")) { varnish_launch(v); continue; @@ -498,16 +517,19 @@ cmd_varnish(CMD_ARGS) continue; } if (!strcmp(*av, "-vcl+backend")) { + AN(av[1]); varnish_vclbackend(v, av[1]); av++; continue; } if (!strcmp(*av, "-badvcl")) { + AN(av[1]); varnish_vcl(v, av[1], CLIS_PARAM); av++; continue; } if (!strcmp(*av, "-vcl")) { + AN(av[1]); varnish_vcl(v, av[1], CLIS_OK); av++; continue;