From 5826ff8c9c7e88b684994f8dd4b0d294381ae499 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 17 Feb 2019 16:02:30 +0100 Subject: tests: parallel_cp.sh: automount fs Teach the script to automatically mount and unmount. --- tests/stress_tests/parallel_cp.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'tests/stress_tests') diff --git a/tests/stress_tests/parallel_cp.sh b/tests/stress_tests/parallel_cp.sh index 324e0c6..b9e6b4b 100755 --- a/tests/stress_tests/parallel_cp.sh +++ b/tests/stress_tests/parallel_cp.sh @@ -12,8 +12,27 @@ # # See https://github.com/rfjakob/gocryptfs/issues/322 for details. -echo "deleting old files" -rm -Rf origin sub_* +cd "$(dirname "$0")" +MYNAME=$(basename $0) +source ../fuse-unmount.bash + +# Set the GOPATH variable to the default if it is empty +GOPATH=$(go env GOPATH) + +# Backing directory +DIR=$(mktemp -d /tmp/$MYNAME.XXX) +$GOPATH/bin/gocryptfs -q -init -extpass "echo test" -scryptn=10 $DIR + +# Mountpoint +MNT="$DIR.mnt" +mkdir $MNT +$GOPATH/bin/gocryptfs -q -extpass "echo test" -nosyslog $DIR $MNT +echo "Mounted gocryptfs $DIR at $MNT" + +# Cleanup trap +trap "cd / ; fuse-unmount -z $MNT ; rm -rf $DIR $MNT" EXIT + +cd $MNT SECONDS=0 echo "creating files with dd" -- cgit v1.2.3