Hello all,

Sorry about that empty mail.

While trying to learn to use logexpect, I noticed that for expectations
like these:

expect 0 * FixedTag
expect * = FooTag reg.x*

... it would attempt the regex match for every log entry after the
FixedTag, regardless of whether the entry has the FooTag. It continues
until it hits an entry with a match, which may or may not have the FooTag.

I may have misunderstood the intention here, but the attached patch
ensures that the regex match is only attempted for log entries with the
expected tag.


Best,
Geoff
-- 
** * * UPLEX - Nils Goroll Systemoptimierung

Scheffelstraße 32
22301 Hamburg

Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753

http://uplex.de
From 2a0f64cba1e963fc10f000303513c2b003ddf0aa Mon Sep 17 00:00:00 2001
From: Geoff Simmons <[email protected]>
Date: Thu, 10 Oct 2013 10:58:37 +0200
Subject: [PATCH] varnishtest: logexpect only attempts regex matches for matching tags

---
 bin/varnishtest/vtc_logexp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/bin/varnishtest/vtc_logexp.c b/bin/varnishtest/vtc_logexp.c
index 8a0f384..cbee6c0 100644
--- a/bin/varnishtest/vtc_logexp.c
+++ b/bin/varnishtest/vtc_logexp.c
@@ -217,6 +217,8 @@ logexp_dispatch(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 					ok = 0;
 			}
 			if (le->test->vre &&
+			    le->test->tag >= 0 &&
+			    le->test->tag == tag &&
 			    VRE_ERROR_NOMATCH == VRE_exec(le->test->vre, data,
 				len, 0, 0, NULL, 0, NULL))
 				ok = 0;
-- 
1.7.2.5

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to