From 358cc81d8338b9199dfebd66fb0fdbab4f2ab296 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 20 Nov 2007 22:28:04 +0000 Subject: [PATCH] Plug these two test-scripts in for the night, until some day where I find out where to put ad-hoc stuff like this in the tree. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2283 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/c.sh | 15 ++++++ varnish-cache/bin/varnishd/s.sh | 82 +++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 varnish-cache/bin/varnishd/c.sh create mode 100644 varnish-cache/bin/varnishd/s.sh diff --git a/varnish-cache/bin/varnishd/c.sh b/varnish-cache/bin/varnishd/c.sh new file mode 100644 index 00000000..8bab7722 --- /dev/null +++ b/varnish-cache/bin/varnishd/c.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# A client side script to test the ESI parsing, see s.sh for serverside + +set -e + +echo "" +while true +do + sleep 1 + echo "" + fetch -o - -q http://localhost:8080/ | hexdump -C | + sed 's/$//' + echo "" +done diff --git a/varnish-cache/bin/varnishd/s.sh b/varnish-cache/bin/varnishd/s.sh new file mode 100644 index 00000000..469cfb58 --- /dev/null +++ b/varnish-cache/bin/varnishd/s.sh @@ -0,0 +1,82 @@ +#!/bin/sh + +# A server side test-script for pushing the ESI XML parser over a +# storage boundary. +# The crucial trick here is that we send these objects HTTP/0.9 style +# so that cache_fetch puts the first 128k in one storage object and +# the rest in another, thus by putting around 128K space in our test +# data we can put it right before, over and after the storage boundary. +# +# Use c.sh as the client side, and run varnish with this vcl: +# +# backend b1 { +# set backend.host = "Localhost"; +# set backend.port = "8081"; +# } +# +# sub vcl_recv { +# pass; +# } +# +# sub vcl_fetch { +# esi; +# } + +serve () ( + ( + echo 'HTTP/1.0 200 OK' + echo '' + echo "$1" + dd if=/dev/zero bs=$2 count=1 2>/dev/null | tr '\0' ' ' + cat + sleep .1 + ) | nc -l 8081 +) + + + +if false ; then + echo -n " foo bar" | serve Test01 1 + echo -n " foo bar" | serve Test02 2 + # Unterminated CDATA + echo -n " foo { foo bar" | serve Test04::$i $i + done + + for i in `jot 40 131036` + do + echo -n " bar" | serve Test05::$i $i + done + + for i in `jot 22 131040` + do + echo -n "" | serve Test06::$i $i + done + + echo -n " " | serve Test07 10 + + echo -n "