aboutsummaryrefslogtreecommitdiff
path: root/tests/stress_tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-02-15 23:02:01 +0100
committerJakob Unterwurzacher2017-02-15 23:02:01 +0100
commitce2e610428c940c2bd5ca1790e7375117b1f6015 (patch)
tree08563c5e36b8d285390f897cd122e7e1aa8f6fc4 /tests/stress_tests
parent6be7808992a1d9562b113b13831cd6d6a40114d6 (diff)
OSX compat: replace fusermount calls with fuse-unmount.bash
Mac OS X does not have fusermount and uses umount instead. The fuse-unmount.bash calls the appropriate command.
Diffstat (limited to 'tests/stress_tests')
-rwxr-xr-xtests/stress_tests/extractloop.bash5
-rwxr-xr-xtests/stress_tests/fsstress-gocryptfs.bash9
-rwxr-xr-xtests/stress_tests/pingpong.bash5
3 files changed, 12 insertions, 7 deletions
diff --git a/tests/stress_tests/extractloop.bash b/tests/stress_tests/extractloop.bash
index 2c139ab..18fc4ef 100755
--- a/tests/stress_tests/extractloop.bash
+++ b/tests/stress_tests/extractloop.bash
@@ -14,6 +14,7 @@ set -eu
cd "$(dirname "$0")"
MD5="$PWD/linux-3.0.md5sums"
MYNAME=$(basename "$0")
+source ../fuse-unmount.bash
# Setup dirs
cd /tmp
@@ -49,8 +50,8 @@ ln -sTf $CSV /tmp/extractloop.csv
# Cleanup trap
# Note: gocryptfs may have already umounted itself because bash relays SIGINT
-# Just ignore fusermount errors.
-trap "cd /; fusermount -u -z $MNT; rm -rf $CRYPT $MNT" EXIT
+# Just ignore unmount errors.
+trap "cd /; fuse-unmount -z $MNT; rm -rf $CRYPT $MNT" EXIT
function loop {
# Note: In a subshell, $$ returns the PID of the parent shell.
diff --git a/tests/stress_tests/fsstress-gocryptfs.bash b/tests/stress_tests/fsstress-gocryptfs.bash
index 51c68db..432899a 100755
--- a/tests/stress_tests/fsstress-gocryptfs.bash
+++ b/tests/stress_tests/fsstress-gocryptfs.bash
@@ -14,6 +14,10 @@
set -eu
+cd "$(dirname "$0")"
+MYNAME=$(basename $0)
+source ../fuse-unmount.bash
+
# Backing directory
DIR=$(mktemp -d /tmp/fsstress.XXX)
# Mountpoint
@@ -28,13 +32,12 @@ then
fi
# Setup
-fusermount -u -z $MNT &> /dev/null || true
+fuse-unmount -z $MNT &> /dev/null || true
mkdir -p $DIR $MNT
rm -Rf $DIR/*
rm -Rf $MNT/*
# FS-specific compile and mount
-MYNAME=$(basename $0)
if [ $MYNAME = fsstress-loopback.bash ]; then
echo "Recompile go-fuse loopback"
cd $GOPATH/src/github.com/hanwen/go-fuse/example/loopback
@@ -62,7 +65,7 @@ done
echo
# Cleanup trap
-trap "kill %1 ; cd /; fusermount -u -z $MNT; rm -rf $DIR $MNT" EXIT
+trap "kill %1 ; cd /; fuse-unmount -z $MNT; rm -rf $DIR $MNT" EXIT
echo "Starting fsstress loop"
N=1
diff --git a/tests/stress_tests/pingpong.bash b/tests/stress_tests/pingpong.bash
index ebcb8c5..02aabc9 100755
--- a/tests/stress_tests/pingpong.bash
+++ b/tests/stress_tests/pingpong.bash
@@ -11,6 +11,7 @@ set -eu
cd "$(dirname "$0")"
MD5="$PWD/linux-3.0.md5sums"
MYNAME=$(basename $0)
+source ../fuse-unmount.bash
# Setup
cd /tmp
@@ -22,8 +23,8 @@ mkdir $PING.mnt $PONG.mnt
# Cleanup trap
# Note: gocryptfs may have already umounted itself because bash relays SIGINT
-# Just ignore fusermount errors.
-trap "set +e ; cd /tmp; fusermount -u -z $PING.mnt ; fusermount -u -z $PONG.mnt ; rm -rf $PING $PONG $PING.mnt $PONG.mnt" EXIT
+# Just ignore unmount errors.
+trap "set +e ; cd /tmp; fuse-unmount -z $PING.mnt ; fuse-unmount -z $PONG.mnt ; rm -rf $PING $PONG $PING.mnt $PONG.mnt" EXIT
gocryptfs -q -init -extpass="echo test" -scryptn=10 $PING
gocryptfs -q -init -extpass="echo test" -scryptn=10 $PONG