From 65bc006a78c67b8f8cf0b01f8ed948dca6c1e408 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 6 Oct 2019 22:34:19 +0200 Subject: [PATCH] stress_tests: use /var/tmp by default There is a good chance that /tmp is tmpfs, and we want to run our tests on a real filesystem. --- tests/stress_tests/extractloop.bash | 9 +++++++-- tests/stress_tests/fsstress-gocryptfs.bash | 7 ++++++- tests/stress_tests/parallel_cp.sh | 7 ++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/stress_tests/extractloop.bash b/tests/stress_tests/extractloop.bash index 742715da..c6e96326 100755 --- a/tests/stress_tests/extractloop.bash +++ b/tests/stress_tests/extractloop.bash @@ -11,6 +11,11 @@ # # See Documentation/extractloop.md for example output. +if [[ -z $TMPDIR ]]; then + TMPDIR=/var/tmp + export TMPDIR +fi + set -eu # Run at low priority to not annoy the user too much @@ -23,8 +28,8 @@ source ../fuse-unmount.bash # Setup dirs ../dl-linux-tarball.bash -cd /tmp -EXTRACTLOOP_TMPDIR=/tmp/extractloop_tmpdir +cd $TMPDIR +EXTRACTLOOP_TMPDIR=$TMPDIR/extractloop_tmpdir mkdir -p $EXTRACTLOOP_TMPDIR CRYPT=$(mktemp -d $EXTRACTLOOP_TMPDIR/XXX) CSV=$CRYPT.csv diff --git a/tests/stress_tests/fsstress-gocryptfs.bash b/tests/stress_tests/fsstress-gocryptfs.bash index 2bb362fe..78a7f7d1 100755 --- a/tests/stress_tests/fsstress-gocryptfs.bash +++ b/tests/stress_tests/fsstress-gocryptfs.bash @@ -12,6 +12,11 @@ # # Nowadays it should pass an indefinite number of iterations. +if [[ -z $TMPDIR ]]; then + TMPDIR=/var/tmp + export TMPDIR +fi + set -eu cd "$(dirname "$0")" @@ -28,7 +33,7 @@ then fi # Backing directory -DIR=$(mktemp -d /tmp/$MYNAME.XXX) +DIR=$(mktemp -d $TMPDIR/$MYNAME.XXX) # Mountpoint MNT="$DIR.mnt" mkdir $MNT diff --git a/tests/stress_tests/parallel_cp.sh b/tests/stress_tests/parallel_cp.sh index b9e6b4b9..ad98e5e3 100755 --- a/tests/stress_tests/parallel_cp.sh +++ b/tests/stress_tests/parallel_cp.sh @@ -12,6 +12,11 @@ # # See https://github.com/rfjakob/gocryptfs/issues/322 for details. +if [[ -z $TMPDIR ]]; then + TMPDIR=/var/tmp + export TMPDIR +fi + cd "$(dirname "$0")" MYNAME=$(basename $0) source ../fuse-unmount.bash @@ -20,7 +25,7 @@ source ../fuse-unmount.bash GOPATH=$(go env GOPATH) # Backing directory -DIR=$(mktemp -d /tmp/$MYNAME.XXX) +DIR=$(mktemp -d $TMPDIR/$MYNAME.XXX) $GOPATH/bin/gocryptfs -q -init -extpass "echo test" -scryptn=10 $DIR # Mountpoint