use symlinks to transfer /.send/login/file informations
[cloudstore.git] / test.sh
diff --git a/test.sh b/test.sh
index 391a8d5..dafa4a6 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1,7 +1,7 @@
 #!/bin/sh -xe
 
 user_dir=/srv/cloudstore/users/test/
-rm -vf $user_dir/log/*
+rm -Rvf $user_dir/log/* #$user_dir/blob/*
 
 push() {
        file=`shift`
@@ -11,7 +11,7 @@ pull() {
        from=$1
        to=$2
        test -z "$to" && to=$1
-       RSYNC_PASSWORD=secret rsync rsync://test@127.0.0.1:6501/test/$from $to
+       RSYNC_PASSWORD=secret rsync rsync://test+localhost@127.0.0.1:6501/test/$from $to
 }
 
 
@@ -44,15 +44,31 @@ mkdir dir-test
 cp foo bar dir-test/
 uptime > "dir-test/file with spaces"
 push dir-test --recursive -v
+
+find . type -f | xargs -i md5sum {} > /tmp/md5sum
+
 rm foo bar
 push dir-test --recursive --delete -v
 rm -Rf dir-test
 
 pull non-existing || true
 
+cp /tmp/md5sum md5sum
+mkdir clone
+# test md5 import from directory
+mv md5sum clone/
+push clone -r -v
+# client should hardlink or copy files locally to avoid wastefull pull
+# but we test server-side hardlink here
+pull clone -r -v
+
+md5sum clone/* | sed -e 's!  !  _import/foo/bar/baz!' > md5sum
+cat md5sum
+push md5sum -v
+
 tail -20 $user_dir/log/*
 
 #diff -urw $user_dir/blob $dir/
 #diff -urw $user_dir/json $dir/
 
-ls -al $user_dir/blob $user_dir/json
+ls -al $user_dir/blob