port md5 support to TokyoCabinet
[cloudstore.git] / test.sh
diff --git a/test.sh b/test.sh
index 8b6504c..707577f 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1,9 +1,6 @@
 #!/bin/sh -xe
 
-user_dir=/srv/cloudstore/users/test/
-rm -Rvf $user_dir/log/* #$user_dir/blob/*
-
-RSYNC_LOGIN=u2000
+RSYNC_LOGIN=fake
 
 push() {
        file=`shift`
@@ -20,14 +17,18 @@ pull() {
 sudo ./remove-user.sh test@example.com
 sudo ./remove-user.sh test2@example.com
 
-RSYNC_LOGIN=`sudo ./create-user.sh test@example.com secret 200k`
+RSYNC_LOGIN=`sudo ./create-user.sh test@example.com secret 500k`
 RSYNC_LOGIN2=`sudo ./create-user.sh test2@example.com secret 20k`
 
 dir=/tmp/test
 rm -Rf "$dir"
 mkdir /tmp/test
 cd $dir
+
 push . --recursive --delete -v
+
+if true ; then # skip tests if false
+
 ps ax > foo
 push foo -v
 push foo -v
@@ -69,12 +70,40 @@ md5sum clone/* | sed -e 's!  !  _import/foo/bar/baz!' > md5sum
 cat md5sum
 push md5sum -v
 
+# test unused md5 pool quota
+
+ps ax > tmp
+push tmp -v
+rm tmp
+push . -r --delete -v
+
 # test send
 
-ps ax >> sent-to-$RSYNC_LOGIN2
-push sent-to-$RSYNC_LOGIN2 # must be done before first send
+ps ax >> send
+mkdir dir1
+ps ax >> dir1/send
+mkdir dir2
+ps ax >> dir2/send
+
+mkdir -p .sync/send
+cat << __SEND__ > .sync/send/timestamp
+$RSYNC_LOGIN2 send
+$RSYNC_LOGIN2 dir1/send
+$RSYNC_LOGIN2 dir2/send
+__SEND__
+
+# order is important! .sync must be last!
+push send dir1 dir2 .sync -rv
+
+
+fi # skip tests
+
+# test file move
 
-mkdir -p .send/$RSYNC_LOGIN2/received
-ln -s ../../../sent-to-$RSYNC_LOGIN2 .send/$RSYNC_LOGIN2/received/new-name
+pending=/tmp/pending.0610201109464117
+grep ^MOVED $pending | cut -d\# -f2 | xargs -i sh -c "ps ax > {}"
+push . -rv
 
-push .send -rvl
+mkdir -p .sync/pending
+cp $pending .sync/pending/
+push .sync -rv