r4153 - in trunk/varnish-cache/bin: varnishd varnishtest/tests

sky at projects.linpro.no sky at projects.linpro.no
Tue Jul 28 17:49:44 CEST 2009


Author: sky
Date: 2009-07-28 17:49:44 +0200 (Tue, 28 Jul 2009)
New Revision: 4153

Added:
   trunk/varnish-cache/bin/varnishtest/tests/c00027.vtc
Modified:
   trunk/varnish-cache/bin/varnishd/cache_expire.c
Log:
fix segfault on eviction -- add testcase that actually tests eviction, without patch the test case segfaults

Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c	2009-07-28 13:54:39 UTC (rev 4152)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c	2009-07-28 15:49:44 UTC (rev 4153)
@@ -302,7 +302,6 @@
 EXP_NukeOne(struct sess *sp, struct objcore_head *lru)
 {
 	struct objcore *oc;
-	struct object *o;
 
 	/*
 	 * Find the first currently unused object on the LRU.
@@ -334,13 +333,8 @@
 	if (oc == NULL)
 		return (-1);
 
-	/* o is never allocated so this shouldn't work
-	 * making a comment so I don't forget
-	 * why does no test case capture this?
-	 * could be my swine flu riddled mind playing games? / Artur
-	 */
-	WSL(sp->wrk, SLT_ExpKill, 0, "%u LRU", o->xid);
-	HSH_Deref(sp->wrk, &o);
+	WSL(sp->wrk, SLT_ExpKill, 0, "%u LRU", oc->obj->xid);
+	HSH_Deref(sp->wrk, &(oc->obj));
 	return (1);
 }
 

Added: trunk/varnish-cache/bin/varnishtest/tests/c00027.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/c00027.vtc	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/c00027.vtc	2009-07-28 15:49:44 UTC (rev 4153)
@@ -0,0 +1,46 @@
+# $Id$
+
+test "Test eviction"
+
+server s1 {
+	rxreq
+	expect req.url == "/1"
+	txresp -body "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
+	rxreq
+	expect req.url == "/2"
+	txresp -body "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
+	rxreq
+	expect req.url == "/3"
+	txresp -body "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
+	rxreq
+	expect req.url == "/4"
+	txresp -body "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
+	rxreq
+	expect req.url == "/5"
+	txresp -body "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
+} -start
+
+varnish v1 -arg "-s malloc,40k" -vcl+backend {
+	sub vcl_fetch { 
+		set beresp.ttl = 10m; 
+	}
+} -start
+
+client c1 {
+	txreq -url "/1"
+	rxresp
+	expect resp.status == 200
+	txreq -url "/2"
+	rxresp
+	expect resp.status == 200
+	txreq -url "/3"
+	rxresp
+	expect resp.status == 200
+	txreq -url "/4"
+	rxresp
+	expect resp.status == 200
+	txreq -url "/5"
+	rxresp
+	expect resp.status == 200
+} -run
+


Property changes on: trunk/varnish-cache/bin/varnishtest/tests/c00027.vtc
___________________________________________________________________
Name: svn:keywords
   + id



More information about the varnish-commit mailing list