summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-07-21 23:31:13 +0200
committerJakob Unterwurzacher2017-07-21 23:34:44 +0200
commit74e58ae8e6647a3a61e1fba302918b3eb61b576b (patch)
treee790e2721e38696dfac0d0c42b578852e3d84914
parentccf1a84e417e9f7d83f31c61c44cf3851703b1e4 (diff)
tests: fsstress-gocryptfs.bash: sync up with EncFS
I have added a subset of fsstress-gocryptfs.bash to EncFS as fsstress-encfs.sh, improving the code a bit. This change forward-ports these improvements to fsstress-gocryptfs.bash.
-rwxr-xr-xtests/stress_tests/fsstress-gocryptfs.bash35
1 files changed, 14 insertions, 21 deletions
diff --git a/tests/stress_tests/fsstress-gocryptfs.bash b/tests/stress_tests/fsstress-gocryptfs.bash
index caa73c6..2bb362f 100755
--- a/tests/stress_tests/fsstress-gocryptfs.bash
+++ b/tests/stress_tests/fsstress-gocryptfs.bash
@@ -18,36 +18,29 @@ cd "$(dirname "$0")"
MYNAME=$(basename $0)
source ../fuse-unmount.bash
-# Backing directory
-DIR=$(mktemp -d /tmp/fsstress.XXX)
-# Mountpoint
-MNT="$DIR.mnt"
-
-# Set the GOPATH variable to the default if it is empty
-GOPATH=$(go env GOPATH)
-
# fsstress binary
-FSSTRESS=$GOPATH/src/xfstests/ltp/fsstress
-
+FSSTRESS=$HOME/fuse-xfstests/ltp/fsstress
if [ ! -x $FSSTRESS ]
then
- echo "fsstress binary not found, adjust FSSTRESS=$FSSTRESS"
+ echo "$MYNAME: fsstress binary not found at $FSSTRESS"
+ echo "Please clone and compile https://github.com/rfjakob/fuse-xfstests"
exit 1
fi
-# Setup
-fuse-unmount -z $MNT &> /dev/null || true
-mkdir -p $DIR $MNT
-rm -Rf $DIR/*
-rm -Rf $MNT/*
-
+# Backing directory
+DIR=$(mktemp -d /tmp/$MYNAME.XXX)
+# Mountpoint
+MNT="$DIR.mnt"
+mkdir $MNT
+# Set the GOPATH variable to the default if it is empty
+GOPATH=$(go env GOPATH)
# FS-specific compile and mount
if [ $MYNAME = fsstress-loopback.bash ]; then
echo "Recompile go-fuse loopback"
cd $GOPATH/src/github.com/hanwen/go-fuse/example/loopback
- go build && go install
+ go build -race && go install
$GOPATH/bin/loopback -l $MNT $DIR &
disown
elif [ $MYNAME = fsstress-gocryptfs.bash ]; then
@@ -64,17 +57,17 @@ else
exit 1
fi
-echo -n "Waiting for mount: "
sleep 0.5
+echo -n "Waiting for mount: "
while ! grep "$MNT fuse" /proc/self/mounts > /dev/null
do
sleep 1
echo -n x
done
-echo
+echo " ok"
# Cleanup trap
-trap "kill %1 ; cd /; fuse-unmount -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