libgocryptfs/benchmark.bash

29 lines
649 B
Bash
Raw Normal View History

#!/bin/bash -eu
2016-01-23 19:33:03 +01:00
# Run the set of "canonical" benchmarks that are shown on
# https://nuetzlich.net/gocryptfs/comparison/
cd "$(dirname "$0")"
2016-01-23 19:33:03 +01:00
# Setup
CRYPT=$(mktemp -d /tmp/benchmark.bash.XXX)
MNT=$CRYPT.mnt
mkdir $MNT
# Mount
if [ $# -eq 1 ] && [ "$1" == "-encfs" ]; then
echo "Testing EncFS at $MNT"
encfs --extpass="echo test" --standard $CRYPT $MNT > /dev/null
else
echo "Testing gocryptfs at $MNT"
gocryptfs -q -init -extpass="echo test" -scryptn=10 $CRYPT
gocryptfs -q -extpass="echo test" $CRYPT $MNT
fi
# Cleanup trap
trap "cd /; fusermount -u -z $MNT; rm -rf $CRYPT $MNT" EXIT
2016-01-23 19:33:03 +01:00
# Benchmarks
./tests/canonical-benchmarks.bash $MNT
2016-01-23 19:33:03 +01:00