aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/venti/srv
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-04-21 22:32:46 +0000
committerrsc <devnull@localhost>2007-04-21 22:32:46 +0000
commit3cbbc79a05fd6cf43e31d94585d3195f29705ed8 (patch)
treef58a1db184a90f1b05740edbea0edc047c4e3b04 /src/cmd/venti/srv
parent30df15f9ec349740fa51ae81da33950aff4b794e (diff)
downloadplan9port-3cbbc79a05fd6cf43e31d94585d3195f29705ed8.tar.gz
plan9port-3cbbc79a05fd6cf43e31d94585d3195f29705ed8.tar.bz2
plan9port-3cbbc79a05fd6cf43e31d94585d3195f29705ed8.zip
test scripts
Diffstat (limited to 'src/cmd/venti/srv')
-rwxr-xr-xsrc/cmd/venti/srv/tester76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/cmd/venti/srv/tester b/src/cmd/venti/srv/tester
new file mode 100755
index 00000000..8e63a20b
--- /dev/null
+++ b/src/cmd/venti/srv/tester
@@ -0,0 +1,76 @@
+#!/usr/local/plan9/bin/rc
+
+vtmp=/home/tmp
+venti=tcp!127.1!17034
+url=127.1:8901
+
+fn reformat {
+ if(! test -f $vtmp/arena)
+ dd bs'='1048576 count'='100 if'='/dev/zero of'='$vtmp/arena
+ if(! test -f $vtmp/bloom)
+ dd bs'='1048576 count'='10 if'='/dev/zero of'='$vtmp/bloom
+ if(! test -f $vtmp/isect)
+ dd bs'='1048576 count'='10 if'='/dev/zero of'='$vtmp/isect
+ if(! test -f $vtmp/check)
+ dd bs'='1048576 count'='20 if'='/dev/zero of'='$vtmp/check
+
+ echo '
+ index main
+ isect '$vtmp'/isect
+ arenas '$vtmp'/arena
+ bloom '$vtmp'/bloom
+ webroot '$PLAN9'/src/cmd/venti/srv/www
+ mem 64M
+ icmem 64M
+ bcmem 64M
+ queuewrites
+ addr tcp!*!17034
+ httpaddr tcp!*!8901
+ ' >$vtmp/vtmp.conf
+
+ ./o.fmtarenas -a 40M -b 8k arenas $vtmp/arena
+ ./o.fmtbloom -s 10M $vtmp/bloom
+ ./o.fmtisect -b 8k isect $vtmp/isect
+ ./o.fmtindex vtmp.conf
+}
+
+fn venti {
+ ./o.venti -c $vtmp/vtmp.conf >$vtmp/venti.log >[2=1]
+}
+
+fn killventi {
+ killall -9 o.venti
+}
+
+fn die {
+ echo $*
+ # no killventi - leave for debugging
+ echo '(leaving venti running)'
+ exit 1
+}
+
+fn testdcachesync {
+ echo '>>>' testdcachesync...
+ echo '*' reformat
+ reformat
+ echo '*' venti
+ venti
+ sleep 2
+ echo '*' vac
+ 9 time vac $PLAN9/src/cmd/venti >$vtmp/a.vac
+ echo '*' flushdcache
+ hget http://$url/flushdcache
+ echo '*' kill venti
+ killventi
+ echo '*' venti
+ venti
+ sleep 2
+ echo '*' read
+ if(venti/read `{cat $vtmp/a.vac} >/dev/null >[2=1])
+ echo worked
+ if not
+ die 'could not find block!'
+}
+
+testdcachesync
+killventi