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
This commit is contained in:
parent
3b18e546fc
commit
7d1400d872
@ -12,6 +12,7 @@ function usage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
OPT_ENCFS=0
|
OPT_ENCFS=0
|
||||||
|
OPT_LOOPBACK=0
|
||||||
OPT_OPENSSL=""
|
OPT_OPENSSL=""
|
||||||
OPT_DIR=""
|
OPT_DIR=""
|
||||||
DD_ONLY=""
|
DD_ONLY=""
|
||||||
@ -34,6 +35,9 @@ while [[ $# -gt 0 ]] ; do
|
|||||||
-dd)
|
-dd)
|
||||||
DD_ONLY=1
|
DD_ONLY=1
|
||||||
;;
|
;;
|
||||||
|
-loopback)
|
||||||
|
OPT_LOOPBACK=1
|
||||||
|
;;
|
||||||
-*)
|
-*)
|
||||||
echo "Invalid option: $1"
|
echo "Invalid option: $1"
|
||||||
usage
|
usage
|
||||||
@ -69,6 +73,10 @@ if [[ $OPT_ENCFS -eq 1 ]]; then
|
|||||||
echo -n "Testing EncFS at $CRYPT: "
|
echo -n "Testing EncFS at $CRYPT: "
|
||||||
encfs --version
|
encfs --version
|
||||||
/home/jakob.donotbackup/encfs/build/encfs --extpass="echo test" --standard $CRYPT $MNT > /dev/null
|
/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
|
else
|
||||||
echo -n "Testing gocryptfs at $CRYPT: "
|
echo -n "Testing gocryptfs at $CRYPT: "
|
||||||
gocryptfs -version
|
gocryptfs -version
|
||||||
@ -76,13 +84,18 @@ else
|
|||||||
gocryptfs -q -extpass="echo test" $OPT_OPENSSL $CRYPT $MNT
|
gocryptfs -q -extpass="echo test" $OPT_OPENSSL $CRYPT $MNT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Make sure we have actually mounted something
|
||||||
|
if ! mountpoint $MNT ; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Cleanup trap
|
# Cleanup trap
|
||||||
trap "cd /; fuse-unmount -z $MNT; rm -rf $CRYPT $MNT" EXIT
|
trap "cd /; fuse-unmount -z $MNT; rm -rf $CRYPT $MNT" EXIT
|
||||||
|
|
||||||
# Benchmarks
|
# Benchmarks
|
||||||
if [[ $DD_ONLY -eq 1 ]]; then
|
if [[ $DD_ONLY -eq 1 ]]; then
|
||||||
echo -n "WRITE: "
|
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
|
rm $MNT/zero
|
||||||
else
|
else
|
||||||
./tests/canonical-benchmarks.bash $MNT
|
./tests/canonical-benchmarks.bash $MNT
|
||||||
|
Loading…
Reference in New Issue
Block a user