aboutsummaryrefslogtreecommitdiff
path: root/benchmarks-external.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-01-23 19:33:03 +0100
committerJakob Unterwurzacher2016-01-23 19:33:03 +0100
commit4a1768a3145d8df415e60c0cab3425c0d50eb46d (patch)
tree972fd442da5a64f25fb4ccf86583cfe9264f67d1 /benchmarks-external.bash
parentea38ff4e0bd39f08907239d2f482d95aa38893c0 (diff)
Automate standard performance tests
Diffstat (limited to 'benchmarks-external.bash')
-rwxr-xr-xbenchmarks-external.bash34
1 files changed, 34 insertions, 0 deletions
diff --git a/benchmarks-external.bash b/benchmarks-external.bash
new file mode 100755
index 0000000..f48c7ac
--- /dev/null
+++ b/benchmarks-external.bash
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+set -eu
+
+TIME="/usr/bin/time -f %e"
+
+# Setup
+cd /tmp
+wget -q -c https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz
+DIR1=$(mktemp -d)
+DIR2=$(mktemp -d)
+gocryptfs -q -init -extpass="echo test" $DIR1
+gocryptfs -q -extpass="echo test" $DIR1 $DIR2
+cd $DIR2
+echo
+
+# Benchmarks
+echo -n "WRITE: "
+dd if=/dev/zero of=zero bs=128K count=1000 2>&1 | tail -n 1
+rm zero
+sleep 1
+echo -n "UNTAR: "
+$TIME tar xzf ../linux-3.0.tar.gz
+sleep 1
+echo -n "LS: "
+$TIME ls -lR linux-3.0 > /dev/null
+sleep 1
+echo -n "RM: "
+$TIME rm -Rf linux-3.0
+
+# Cleanup
+cd ..
+fusermount -u $DIR2 -z
+rm -Rf $DIR1 $DIR2