From 09a5e0ca41686e7aae4d516d961d7d39a6a1d1c4 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 26 Jun 2008 12:32:06 +0000 Subject: [PATCH] Two slow testcases to test object expiry git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2834 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishtest/tests/README | 4 +-- .../bin/varnishtest/tests/s00000.vtc | 33 +++++++++++++++++++ .../bin/varnishtest/tests/s00001.vtc | 33 +++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 varnish-cache/bin/varnishtest/tests/s00000.vtc create mode 100644 varnish-cache/bin/varnishtest/tests/s00001.vtc diff --git a/varnish-cache/bin/varnishtest/tests/README b/varnish-cache/bin/varnishtest/tests/README index c318a1b5..0e6a110f 100644 --- a/varnish-cache/bin/varnishtest/tests/README +++ b/varnish-cache/bin/varnishtest/tests/README @@ -19,5 +19,5 @@ Naming scheme id ~ [b] --> Basic functionality tests id ~ [c] --> Complex functionality tests id ~ [e] --> ESI tests - id ~ [r] --> Regression tests. - id ~ [t] --> Ticket regression tests, number same as ticket. + id ~ [r] --> Regression tests, same number as ticket + id ~ [s] --> Slow tests, expiry, grace etc. diff --git a/varnish-cache/bin/varnishtest/tests/s00000.vtc b/varnish-cache/bin/varnishtest/tests/s00000.vtc new file mode 100644 index 00000000..a0184cea --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/s00000.vtc @@ -0,0 +1,33 @@ +# $Id$ + +test "Simple expiry test" + +server s1 { + rxreq + expect req.url == "/" + txresp -hdr "Cache-control: max-age = 1" -body "1111\n" + delay 3 + rxreq + expect req.url == "/" + txresp -hdr "Cache-control: max-age = 1" -body "22222\n" +} -start + +varnish v1 -vcl+backend { } -start + +client c1 { + txreq -url "/" + rxresp + expect resp.http.content-length == 5 + expect resp.http.x-varnish == "1001" + expect resp.status == 200 +} -run + +delay 3 + +client c2 { + txreq -url "/" + rxresp + expect resp.status == 200 + expect resp.http.x-varnish == "1002" + expect resp.http.content-length == 6 +} -run diff --git a/varnish-cache/bin/varnishtest/tests/s00001.vtc b/varnish-cache/bin/varnishtest/tests/s00001.vtc new file mode 100644 index 00000000..f352f5ee --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/s00001.vtc @@ -0,0 +1,33 @@ +# $Id$ + +test "Simple expiry test (fully reaped object)" + +server s1 { + rxreq + expect req.url == "/" + txresp -hdr "Cache-control: max-age = 1" -body "1111\n" + delay 20 + rxreq + expect req.url == "/" + txresp -hdr "Cache-control: max-age = 1" -body "22222\n" +} -start + +varnish v1 -vcl+backend { } -start + +client c1 { + txreq -url "/" + rxresp + expect resp.http.content-length == 5 + expect resp.http.x-varnish == "1001" + expect resp.status == 200 +} -run + +delay 20 + +client c2 { + txreq -url "/" + rxresp + expect resp.status == 200 + expect resp.http.x-varnish == "1002" + expect resp.http.content-length == 6 +} -run -- 2.39.5