diff options
author | Jakob Unterwurzacher | 2019-03-31 21:19:07 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2019-03-31 21:19:07 +0200 |
commit | 7d1400d872c6e0c640ed6279903df746adec332b (patch) | |
tree | 782184d4ade51bad69ec9f83fbec8aa78d5f51bf | |
parent | 3b18e546fc43c13b6ad7d9ad7273594ef019ac73 (diff) |
benchmark.bash: add support for go-fuse loopback
Make testing the performance of the new nodefs API easier
https://github.com/hanwen/go-fuse/pull/280
-rwxr-xr-x | benchmark.bash | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/benchmark.bash b/benchmark.bash index 1501adc..4949831 100755 --- a/benchmark.bash +++ b/benchmark.bash @@ -12,6 +12,7 @@ function usage { } OPT_ENCFS=0 +OPT_LOOPBACK=0 OPT_OPENSSL="" OPT_DIR="" DD_ONLY="" @@ -34,6 +35,9 @@ while [[ $# -gt 0 ]] ; do -dd) DD_ONLY=1 ;; + -loopback) + OPT_LOOPBACK=1 + ;; -*) echo "Invalid option: $1" usage @@ -69,6 +73,10 @@ if [[ $OPT_ENCFS -eq 1 ]]; then echo -n "Testing EncFS at $CRYPT: " encfs --version /home/jakob.donotbackup/encfs/build/encfs --extpass="echo test" --standard $CRYPT $MNT > /dev/null +elif [[ $OPT_LOOPBACK -eq 1 ]]; then + echo "Testing go-fuse loopback" + $HOME/go/src/github.com/hanwen/go-fuse/example/loopback/loopback $MNT $CRYPT & + sleep 0.5 else echo -n "Testing gocryptfs at $CRYPT: " gocryptfs -version @@ -76,13 +84,18 @@ else gocryptfs -q -extpass="echo test" $OPT_OPENSSL $CRYPT $MNT fi +# Make sure we have actually mounted something +if ! mountpoint $MNT ; then + exit 1 +fi + # Cleanup trap trap "cd /; fuse-unmount -z $MNT; rm -rf $CRYPT $MNT" EXIT # Benchmarks if [[ $DD_ONLY -eq 1 ]]; then echo -n "WRITE: " - dd if=/dev/zero of=$MNT/zero bs=131072 count=2000 2>&1 | tail -n 1 + dd if=/dev/zero of=$MNT/zero bs=131072 count=20000 2>&1 | tail -n 1 rm $MNT/zero else ./tests/canonical-benchmarks.bash $MNT |