aboutsummaryrefslogtreecommitdiff
path: root/tests/stress_tests/parallel_cp.sh
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-02-17 16:02:30 +0100
committerJakob Unterwurzacher2019-02-17 16:02:30 +0100
commit5826ff8c9c7e88b684994f8dd4b0d294381ae499 (patch)
treee27377ec737d318fd035d373bef4ffe21d2667c1 /tests/stress_tests/parallel_cp.sh
parentfa81c13beebf2df0326636665553e9c0a9a29dca (diff)
tests: parallel_cp.sh: automount fs
Teach the script to automatically mount and unmount.
Diffstat (limited to 'tests/stress_tests/parallel_cp.sh')
-rwxr-xr-xtests/stress_tests/parallel_cp.sh23
1 files changed, 21 insertions, 2 deletions
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"