aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbenchmark.bash15
1 files changed, 14 insertions, 1 deletions
diff --git a/benchmark.bash b/benchmark.bash
index 1501adc..4949831 100755
--- a/benchmark.bash
+++ b/benchmark.bash
@@ -12,6 +12,7 @@ function usage {
}
OPT_ENCFS=0
+OPT_LOOPBACK=0
OPT_OPENSSL=""
OPT_DIR=""
DD_ONLY=""
@@ -34,6 +35,9 @@ while [[ $# -gt 0 ]] ; do
-dd)
DD_ONLY=1
;;
+ -loopback)
+ OPT_LOOPBACK=1
+ ;;
-*)
echo "Invalid option: $1"
usage
@@ -69,6 +73,10 @@ if [[ $OPT_ENCFS -eq 1 ]]; then
echo -n "Testing EncFS at $CRYPT: "
encfs --version
/home/jakob.donotbackup/encfs/build/encfs --extpass="echo test" --standard $CRYPT $MNT > /dev/null
+elif [[ $OPT_LOOPBACK -eq 1 ]]; then
+ echo "Testing go-fuse loopback"
+ $HOME/go/src/github.com/hanwen/go-fuse/example/loopback/loopback $MNT $CRYPT &
+ sleep 0.5
else
echo -n "Testing gocryptfs at $CRYPT: "
gocryptfs -version
@@ -76,13 +84,18 @@ else
gocryptfs -q -extpass="echo test" $OPT_OPENSSL $CRYPT $MNT
fi
+# Make sure we have actually mounted something
+if ! mountpoint $MNT ; then
+ exit 1
+fi
+
# Cleanup trap
trap "cd /; fuse-unmount -z $MNT; rm -rf $CRYPT $MNT" EXIT
# Benchmarks
if [[ $DD_ONLY -eq 1 ]]; then
echo -n "WRITE: "
- dd if=/dev/zero of=$MNT/zero bs=131072 count=2000 2>&1 | tail -n 1
+ dd if=/dev/zero of=$MNT/zero bs=131072 count=20000 2>&1 | tail -n 1
rm $MNT/zero
else
./tests/canonical-benchmarks.bash $MNT