Commit 4d446f43 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Don't logexpect partial regular expressions

It turns out some of the tests weren't completely checked.
parent 03f65b10
......@@ -18,10 +18,10 @@ varnish v1 -vcl+backend {
# last header and VCL_return b deliver
logexpect l1 -v v1 -g request {
expect * 1002 Begin
expect * = BerespHeader ^Date:
expect 0 = VCL_call ^BACKEND_RESPONSE
expect 0 = BerespHeader ^x-ttl: 0.000
expect 0 = VCL_return ^deliver
expect * = BerespHeader {^Date:}
expect 0 = VCL_call {^BACKEND_RESPONSE}
expect 0 = BerespHeader {^x-ttl: 0.000}
expect 0 = VCL_return {^deliver}
} -start
client c1 {
......
......@@ -19,15 +19,15 @@ varnish v1 -vcl+backend {
} -start -cliok "param.set debug +syncvsl"
logexpect l1 -v v1 -g session {
expect 0 1000 Begin sess 0 HTTP/1
expect 0 1000 Begin {sess 0 HTTP/1}
expect * = End
expect 0 1001 Begin req 1000 rxreq
expect 0 1001 Begin {req 1000 rxreq}
expect * = End
expect 0 1002 Begin bereq 1001 fetch
expect 0 1002 Begin {bereq 1001 fetch}
expect * = End
expect 0 1003 Begin req 1001 esi
expect 0 1003 Begin {req 1001 esi}
expect * = End
expect 0 1004 Begin bereq 1003 fetch
expect 0 1004 Begin {bereq 1003 fetch}
expect * = End
} -start
......
......@@ -39,7 +39,7 @@ logexpect l1 -v v1 -g request {
expect * = Timestamp {Beresp: \S+ 1\.\d+ [01]\.\d+}
expect * = Timestamp {BerespBody: \S+ 2\.\d+ 1\.\d+}
expect * = End
expect 0 1003 Begin req 1001 restart
expect 0 1003 Begin {req 1001 restart}
expect * = Timestamp {Start: \S+ 2\.\d+ 0\.\d+}
expect * = Timestamp {Process: \S+ 2\.\d+ 0\.\d+}
expect * = Timestamp {Resp: \S+ 2\.\d+ 0\.\d+}
......
......@@ -101,8 +101,10 @@
* Tag to match against
*
* regex:
* regular expression to match against (optional) ('*' is anything, '='
* is the value of the last matched record)
* regular expression to match against (optional)
*
* For skip, vxid and tag, '*' matches anything, '=' expects the value of the
* previous matched record.
*/
#include "config.h"
......@@ -433,6 +435,9 @@ cmd_logexp_expect(CMD_ARGS)
if (av[1] == NULL || av[2] == NULL || av[3] == NULL)
vtc_fatal(vl, "Syntax error");
if (av[4] != NULL && av[5] != NULL)
vtc_fatal(vl, "Syntax error");
if (!strcmp(av[1], "*"))
skip_max = LE_ANY;
else {
......
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