From: phk Date: Sun, 5 Oct 2008 21:55:35 +0000 (+0000) Subject: Coverage testcase for vcc_action.c X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8950b8a24a4ed61d54cf3f4bc7fbe5473261020e;p=varnish Coverage testcase for vcc_action.c git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3255 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishtest/tests/v00018.vtc b/varnish-cache/bin/varnishtest/tests/v00018.vtc new file mode 100644 index 00000000..d7025222 --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/v00018.vtc @@ -0,0 +1,103 @@ +# $Id$ + +test "VCL compiler coverage test: vcc_action.c" + +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + sub vcl_hit { restart ; } + sub vcl_miss { restart rollback; } +} + +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + sub vcl_fetch { error obj.status ; } +} + +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + sub vcl_miss { error req.url ; } + sub vcl_pass { error "the butter please" ; } + sub vcl_fetch { error obj.status req.url; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_miss { set server.port = 1000; } +} + +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + sub vcl_fetch { set obj.ttl /= 2; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_fetch { set obj.ttl >>= 2; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_recv { set req.backend += b; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_recv { set req.url += server.port; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + /* XXX: This should not really be an error */ + sub vcl_recv { set req.url = "foo" 2 "bar"; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_fetch { set obj.cacheable += 1; } +} + +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + sub vcl_fetch { set obj.cacheable = true; } +} + +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + sub vcl_fetch { set obj.cacheable = false; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_fetch { set obj.cacheable = mu; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_fetch { unset obj.cacheable; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_recv { purge_url (3); } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_recv { purge_hash (3); } +} + +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + sub vcl_recv { purge_hash ("foo"); } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_recv { panic 3; } +} + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + sub vcl_recv { kluf ; } +} +