From 9b47e96a2e832feff574ea5622d479b12a4675b3 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 3 Feb 2009 18:44:21 +0000 Subject: [PATCH] Add a counter for esi parse errors and test it in all ESI related tests cases. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3573 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_vrt_esi.c | 1 + varnish-cache/bin/varnishtest/tests/e00000.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00001.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00002.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00003.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00004.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00005.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00006.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00007.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00008.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00009.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00010.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00011.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00012.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00013.vtc | 1 + varnish-cache/bin/varnishtest/tests/e00014.vtc | 1 + varnish-cache/include/stat_field.h | 1 + 17 files changed, 17 insertions(+) diff --git a/varnish-cache/bin/varnishd/cache_vrt_esi.c b/varnish-cache/bin/varnishd/cache_vrt_esi.c index 1030bc5b..fc783359 100644 --- a/varnish-cache/bin/varnishd/cache_vrt_esi.c +++ b/varnish-cache/bin/varnishd/cache_vrt_esi.c @@ -95,6 +95,7 @@ esi_error(const struct esi_work *ew, const char *p, int i, const char *err) char buf[256], *q; txt t; + VSL_stats->esi_errors++; if (i == 0) i = p - ew->t.b; if (i > 20) { diff --git a/varnish-cache/bin/varnishtest/tests/e00000.vtc b/varnish-cache/bin/varnishtest/tests/e00000.vtc index 4b7b1c91..f1869767 100644 --- a/varnish-cache/bin/varnishtest/tests/e00000.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00000.vtc @@ -24,3 +24,4 @@ client c1 { } client c1 -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00001.vtc b/varnish-cache/bin/varnishtest/tests/e00001.vtc index db84e6c2..b73ffa76 100644 --- a/varnish-cache/bin/varnishtest/tests/e00001.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00001.vtc @@ -27,3 +27,4 @@ client c1 { } client c1 -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00002.vtc b/varnish-cache/bin/varnishtest/tests/e00002.vtc index eb688a3d..e07b6783 100644 --- a/varnish-cache/bin/varnishtest/tests/e00002.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00002.vtc @@ -28,3 +28,4 @@ client c1 { } client c1 -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00003.vtc b/varnish-cache/bin/varnishtest/tests/e00003.vtc index b0d9b540..935e14fb 100644 --- a/varnish-cache/bin/varnishtest/tests/e00003.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00003.vtc @@ -32,3 +32,4 @@ client c1 { } client c1 -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00004.vtc b/varnish-cache/bin/varnishtest/tests/e00004.vtc index 564a21ea..272a863b 100644 --- a/varnish-cache/bin/varnishtest/tests/e00004.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00004.vtc @@ -32,3 +32,4 @@ client c1 { } client c1 -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00005.vtc b/varnish-cache/bin/varnishtest/tests/e00005.vtc index 361e48b1..94cd12db 100644 --- a/varnish-cache/bin/varnishtest/tests/e00005.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00005.vtc @@ -33,3 +33,4 @@ client c1 { } client c1 -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00006.vtc b/varnish-cache/bin/varnishtest/tests/e00006.vtc index b63f045c..10b7af66 100644 --- a/varnish-cache/bin/varnishtest/tests/e00006.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00006.vtc @@ -44,3 +44,4 @@ client c1 { } client c1 -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00007.vtc b/varnish-cache/bin/varnishtest/tests/e00007.vtc index 5ab87c25..3df52c0a 100644 --- a/varnish-cache/bin/varnishtest/tests/e00007.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00007.vtc @@ -47,3 +47,4 @@ client c1 { } client c1 -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00008.vtc b/varnish-cache/bin/varnishtest/tests/e00008.vtc index a95d0497..4581edbf 100644 --- a/varnish-cache/bin/varnishtest/tests/e00008.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00008.vtc @@ -71,3 +71,4 @@ client c1 { } client c1 -run +varnish v1 -expect esi_errors == 15 diff --git a/varnish-cache/bin/varnishtest/tests/e00009.vtc b/varnish-cache/bin/varnishtest/tests/e00009.vtc index 066edf87..5a2ae988 100644 --- a/varnish-cache/bin/varnishtest/tests/e00009.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00009.vtc @@ -44,3 +44,4 @@ client c1 { expect resp.bodylen == 37 expect resp.http.transfer-encoding == "chunked" } -run +varnish v1 -expect esi_errors == 1 diff --git a/varnish-cache/bin/varnishtest/tests/e00010.vtc b/varnish-cache/bin/varnishtest/tests/e00010.vtc index 22be6959..08207ee7 100644 --- a/varnish-cache/bin/varnishtest/tests/e00010.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00010.vtc @@ -25,3 +25,4 @@ client c1 { expect resp.status == 200 expect resp.bodylen == 21 } -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00011.vtc b/varnish-cache/bin/varnishtest/tests/e00011.vtc index b2584b09..ffa7bdd6 100644 --- a/varnish-cache/bin/varnishtest/tests/e00011.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00011.vtc @@ -34,3 +34,4 @@ client c1 { expect resp.status == 200 expect resp.bodylen == 31 } -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00012.vtc b/varnish-cache/bin/varnishtest/tests/e00012.vtc index bea84628..64fd962f 100644 --- a/varnish-cache/bin/varnishtest/tests/e00012.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00012.vtc @@ -44,3 +44,4 @@ client c1 { expect resp.status == 200 expect resp.bodylen == 151 } -run +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00013.vtc b/varnish-cache/bin/varnishtest/tests/e00013.vtc index d7212ef4..cfdee321 100644 --- a/varnish-cache/bin/varnishtest/tests/e00013.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00013.vtc @@ -23,3 +23,4 @@ client c1 { } -run varnish v1 -expect esi_parse == 0 +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/bin/varnishtest/tests/e00014.vtc b/varnish-cache/bin/varnishtest/tests/e00014.vtc index 16af7f07..bc362b11 100644 --- a/varnish-cache/bin/varnishtest/tests/e00014.vtc +++ b/varnish-cache/bin/varnishtest/tests/e00014.vtc @@ -24,3 +24,4 @@ client c1 { } -run varnish v1 -expect esi_parse == 0 +varnish v1 -expect esi_errors == 0 diff --git a/varnish-cache/include/stat_field.h b/varnish-cache/include/stat_field.h index fa45391a..b7e4e311 100644 --- a/varnish-cache/include/stat_field.h +++ b/varnish-cache/include/stat_field.h @@ -132,3 +132,4 @@ MAC_STAT(hcb_lock, uint64_t, 'a', "HCB Lookups with lock") MAC_STAT(hcb_insert, uint64_t, 'a', "HCB Inserts") MAC_STAT(esi_parse, uint64_t, 'a', "Objects ESI parsed (unlock)") +MAC_STAT(esi_errors, uint64_t, 'a', "ESI parse errors (unlock)") -- 2.39.5