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