From 74e58ae8e6647a3a61e1fba302918b3eb61b576b Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 21 Jul 2017 23:31:13 +0200 Subject: [PATCH] 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. --- tests/stress_tests/fsstress-gocryptfs.bash | 35 +++++++++------------- 1 file 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