diff options
author | Jakob Unterwurzacher | 2016-07-16 18:08:01 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-07-16 18:08:01 +0200 |
commit | 6b50f2debcc78448053b8b015b828833b2796db0 (patch) | |
tree | 947a44c8719a47a3eef1db8281ac24256acfc83c /tests | |
parent | d3940c62633df3596c06d8a433f860dc60723964 (diff) |
tests: factor out fs-agnostic benchmark script
"canonical-benchmarks.bash TESTDIR"
can now be used on any filesystem.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/canonical-benchmarks.bash | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/canonical-benchmarks.bash b/tests/canonical-benchmarks.bash new file mode 100755 index 0000000..4c92c56 --- /dev/null +++ b/tests/canonical-benchmarks.bash @@ -0,0 +1,41 @@ +#!/bin/bash -eu +# +# Run the set of "canonical" benchmarks that are shown on +# https://nuetzlich.net/gocryptfs/comparison/ +# against the directory passed as "$1". +# +# This is called by the top-level script "benchmark.bash". + +if [ $# -ne 1 ]; then + MYNAME=$(basename $0) + echo "usage: $MYNAME TESTDIR" + exit 1 +fi + +cd "$1" + +TGZ=/tmp/linux-3.0.tar.gz + +if [ "$(md5sum /tmp/linux-3.0.tar.gz | cut -f1 -d' ')" != \ + "f7e6591d86a9dbe123dfd1a0be054e7f" ]; then + echo "Downloading linux-3.0.tar.gz" + wget -nv --show-progress -c -O $TGZ \ + https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz +fi + +function etime { + LC_ALL=C /usr/bin/time -f %e 2>&1 $@ > /dev/null +} + +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: " +etime tar xzf $TGZ +sleep 1 +echo -n "LS: " +etime ls -lR linux-3.0 +sleep 1 +echo -n "RM: " +etime rm -Rf linux-3.0 |