use logins from create-user.sh
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 8 Oct 2011 13:53:10 +0000 (15:53 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 8 Oct 2011 13:53:10 +0000 (15:53 +0200)
test.sh

diff --git a/test.sh b/test.sh
index 26d487b..8b6504c 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -3,25 +3,25 @@
 user_dir=/srv/cloudstore/users/test/
 rm -Rvf $user_dir/log/* #$user_dir/blob/*
 
+RSYNC_LOGIN=u2000
+
 push() {
        file=`shift`
-       RSYNC_PASSWORD=secret rsync $* $file rsync://u2000@127.0.0.1:6501/u2000/localhost/$file
+       RSYNC_PASSWORD=secret rsync $* $file rsync://$RSYNC_LOGIN@127.0.0.1:6501/$RSYNC_LOGIN/localhost/$file
 }
 pull() {
        from=$1
        to=$2
        test -z "$to" && to=$1
-       RSYNC_PASSWORD=secret rsync rsync://u2000@127.0.0.1:6501/u2000/localhost/$from $to
+       RSYNC_PASSWORD=secret rsync rsync://$RSYNC_LOGIN@127.0.0.1:6501/$RSYNC_LOGIN/localhost/$from $to
 }
 
 
-#./remove-user.sh test@example.com
-
-sudo ./create-user.sh test@example.com secret 200k
-sudo ./create-user.sh test2@example.com secret 20k
+sudo ./remove-user.sh test@example.com
+sudo ./remove-user.sh test2@example.com
 
-#./remove-user.sh u2001
-#./create-user.sh u2001 secret
+RSYNC_LOGIN=`sudo ./create-user.sh test@example.com secret 200k`
+RSYNC_LOGIN2=`sudo ./create-user.sh test2@example.com secret 20k`
 
 dir=/tmp/test
 rm -Rf "$dir"
@@ -71,17 +71,10 @@ push md5sum -v
 
 # test send
 
-ps ax >> sent-to-test2
-push sent-to-test2 # must be done before first send
+ps ax >> sent-to-$RSYNC_LOGIN2
+push sent-to-$RSYNC_LOGIN2 # must be done before first send
 
-mkdir -p .send/test2/received
-ln -s ../../../sent-to-test2 .send/test2/received/new-name
+mkdir -p .send/$RSYNC_LOGIN2/received
+ln -s ../../../sent-to-$RSYNC_LOGIN2 .send/$RSYNC_LOGIN2/received/new-name
 
 push .send -rvl
-
-tail -20 $user_dir/log/*
-
-#diff -urw $user_dir/blob $dir/
-#diff -urw $user_dir/json $dir/
-
-ls -al $user_dir/blob