#!/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`
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
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