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.
This commit is contained in:
Jakob Unterwurzacher 2017-07-21 23:31:13 +02:00
parent ccf1a84e41
commit 74e58ae8e6

View File

@ -18,36 +18,29 @@ cd "$(dirname "$0")"
MYNAME=$(basename $0) MYNAME=$(basename $0)
source ../fuse-unmount.bash 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 binary
FSSTRESS=$GOPATH/src/xfstests/ltp/fsstress FSSTRESS=$HOME/fuse-xfstests/ltp/fsstress
if [ ! -x $FSSTRESS ] if [ ! -x $FSSTRESS ]
then 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 exit 1
fi fi
# Setup # Backing directory
fuse-unmount -z $MNT &> /dev/null || true DIR=$(mktemp -d /tmp/$MYNAME.XXX)
mkdir -p $DIR $MNT # Mountpoint
rm -Rf $DIR/* MNT="$DIR.mnt"
rm -Rf $MNT/* mkdir $MNT
# Set the GOPATH variable to the default if it is empty
GOPATH=$(go env GOPATH)
# FS-specific compile and mount # FS-specific compile and mount
if [ $MYNAME = fsstress-loopback.bash ]; then if [ $MYNAME = fsstress-loopback.bash ]; then
echo "Recompile go-fuse loopback" echo "Recompile go-fuse loopback"
cd $GOPATH/src/github.com/hanwen/go-fuse/example/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 & $GOPATH/bin/loopback -l $MNT $DIR &
disown disown
elif [ $MYNAME = fsstress-gocryptfs.bash ]; then elif [ $MYNAME = fsstress-gocryptfs.bash ]; then
@ -64,14 +57,14 @@ else
exit 1 exit 1
fi fi
echo -n "Waiting for mount: "
sleep 0.5 sleep 0.5
echo -n "Waiting for mount: "
while ! grep "$MNT fuse" /proc/self/mounts > /dev/null while ! grep "$MNT fuse" /proc/self/mounts > /dev/null
do do
sleep 1 sleep 1
echo -n x echo -n x
done done
echo echo " ok"
# Cleanup trap # 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