aboutsummaryrefslogtreecommitdiff
path: root/benchmark-reverse.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-01-03 15:16:02 +0100
committerJakob Unterwurzacher2017-01-03 15:16:02 +0100
commit3e4b29634a80b0952d6eaa46fd3dbb9827bc81c4 (patch)
tree02ed8b52584592ae87994f41c79ece8547253b80 /benchmark-reverse.bash
parent94b66ee1b28d0ae25114d316c382158d12f5f2dc (diff)
Add reverse benchmark
Diffstat (limited to 'benchmark-reverse.bash')
-rwxr-xr-xbenchmark-reverse.bash44
1 files changed, 44 insertions, 0 deletions
diff --git a/benchmark-reverse.bash b/benchmark-reverse.bash
new file mode 100755
index 0000000..e5f375d
--- /dev/null
+++ b/benchmark-reverse.bash
@@ -0,0 +1,44 @@
+#!/bin/bash -eu
+
+# Benchmark gocryptfs' reverse mode
+
+cd "$(dirname "$0")"
+MYNAME=$(basename "$0")
+
+# Download /tmp/linux-3.0.tar.gz
+./tests/dl-linux-tarball.bash
+
+cd /tmp
+PLAIN=linux-3.0
+
+SIZE=0
+if [[ -d $PLAIN ]]; then
+ SIZE=$(du -s --apparent-size $PLAIN | cut -f1)
+fi
+
+
+if [[ $SIZE -ne 412334 ]] ; then
+ echo "Extracting linux-3.0.tar.gz"
+ rm -Rf $PLAIN
+ tar xf linux-3.0.tar.gz
+fi
+
+rm -f $PLAIN/.gocryptfs.reverse.conf
+gocryptfs -q -init -reverse -extpass="echo test" -scryptn=10 $PLAIN
+
+MNT=$(mktemp -d /tmp/linux-3.0.reverse.mnt.XXX)
+
+# Cleanup trap
+trap "rm -f $PLAIN/.gocryptfs.reverse.conf ; fusermount -u -z $MNT ; rmdir $MNT" EXIT
+
+# Mount
+gocryptfs -q -reverse -extpass="echo test" $PLAIN $MNT
+
+# Print elapsed wall time only
+function etime {
+ LC_ALL=C /usr/bin/time -f %e 2>&1 $@ > /dev/null
+}
+
+echo -n "LS: "
+etime ls -lR $MNT
+