aboutsummaryrefslogtreecommitdiff
path: root/tests/stress_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stress_tests')
-rwxr-xr-xtests/stress_tests/extractloop.bash2
-rwxr-xr-xtests/stress_tests/fsstress-gocryptfs.bash13
-rwxr-xr-xtests/stress_tests/parallel_cp.sh8
-rwxr-xr-xtests/stress_tests/pingpong.bash8
-rwxr-xr-xtests/stress_tests/pjdfstest.bash34
5 files changed, 53 insertions, 12 deletions
diff --git a/tests/stress_tests/extractloop.bash b/tests/stress_tests/extractloop.bash
index 1f78a5e..714d2d7 100755
--- a/tests/stress_tests/extractloop.bash
+++ b/tests/stress_tests/extractloop.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Mount a gocryptfs filesystem somewhere on /tmp, then run two parallel
# infinite loops inside that do the following:
diff --git a/tests/stress_tests/fsstress-gocryptfs.bash b/tests/stress_tests/fsstress-gocryptfs.bash
index 30ea456..7e3f160 100755
--- a/tests/stress_tests/fsstress-gocryptfs.bash
+++ b/tests/stress_tests/fsstress-gocryptfs.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Mount a gocryptfs filesystem in /var/tmp and run fsstress against it
# in an infinite loop, only exiting on errors.
@@ -27,11 +27,11 @@ MYNAME=$(basename "$0")
source ../fuse-unmount.bash
# fsstress binary
-FSSTRESS=/opt/fuse-xfstests/ltp/fsstress
+FSSTRESS=/var/lib/xfstests/ltp/fsstress
if [[ ! -x $FSSTRESS ]]
then
echo "$MYNAME: fsstress binary not found at $FSSTRESS"
- echo "Please clone and compile https://github.com/rfjakob/fuse-xfstests"
+ echo "Please build and \"sudo make install\" git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git"
exit 1
fi
@@ -62,9 +62,8 @@ if [[ $MYNAME = fsstress-loopback.bash ]]; then
$GOPATH/bin/loopback $OPTS "$MNT" "$DIR" &
disown
elif [[ $MYNAME = fsstress-gocryptfs.bash ]]; then
- echo "Recompile gocryptfs"
- cd "$GOPATH/src/github.com/rfjakob/gocryptfs"
- ./build.bash # also prints the version
+ echo "$MYNAME: using gocryptfs at $GOPATH/bin/gocryptfs"
+ $GOPATH/bin/gocryptfs --version
$GOPATH/bin/gocryptfs -q -init -extpass "echo test" -scryptn=10 "$DIR"
$GOPATH/bin/gocryptfs -q -extpass "echo test" -nosyslog -fusedebug="$DEBUG" "$DIR" "$MNT"
elif [[ $MYNAME = fsstress-encfs.bash ]]; then
@@ -84,7 +83,7 @@ done
echo " ok: $MNT"
# Cleanup trap
-trap "kill %1 ; cd / ; fuse-unmount -z $MNT ; rm -rf $DIR $MNT" EXIT
+trap "echo ' cleaning up...' ; kill %1 ; cd / ; fuse-unmount -z $MNT ; rm -rf $DIR $MNT" EXIT
echo "Starting fsstress loop"
N=1
diff --git a/tests/stress_tests/parallel_cp.sh b/tests/stress_tests/parallel_cp.sh
index cd08d31..f113248 100755
--- a/tests/stress_tests/parallel_cp.sh
+++ b/tests/stress_tests/parallel_cp.sh
@@ -2,15 +2,16 @@
#
# Simplified xfstests generic/273
#
-# Fails with
+# Used to fail with
#
# cp: cannot create regular file 'sub_49/file_773': No such file or directory
#
# If you cannot reproduce, try running this in the background:
#
-# while sleep 0.1 ; do echo 3 > /proc/sys/vm/drop_caches ; done"
+# while sleep 0.1 ; do echo 3 > /proc/sys/vm/drop_caches ; done
#
# See https://github.com/rfjakob/gocryptfs/issues/322 for details.
+# Fixed by https://github.com/hanwen/go-fuse/commit/d0fca860a5759d17592becfa1b8e5b1bd354b24a .
if [[ -z $TMPDIR ]]; then
TMPDIR=/var/tmp
@@ -24,6 +25,9 @@ source ../fuse-unmount.bash
# Set the GOPATH variable to the default if it is empty
GOPATH=$(go env GOPATH)
+echo "$MYNAME: using gocryptfs at $GOPATH/bin/gocryptfs"
+$GOPATH/bin/gocryptfs --version
+
# Backing directory
DIR=$(mktemp -d "$TMPDIR/$MYNAME.XXX")
$GOPATH/bin/gocryptfs -q -init -extpass "echo test" -scryptn=10 "$DIR"
diff --git a/tests/stress_tests/pingpong.bash b/tests/stress_tests/pingpong.bash
index 4b8346e..4fd5ff2 100755
--- a/tests/stress_tests/pingpong.bash
+++ b/tests/stress_tests/pingpong.bash
@@ -1,7 +1,8 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Mounts two gocryptfs filesystems, "ping" and "pong" and moves the
-# linux-3.0 kernel tree back and forth between them.
+# linux-3.0 kernel tree back and forth between them, checking integrity
+# using md5sum.
#
# When called as "pingpong-rsync.bash" it uses "rsync --remove-source-files"
# for moving the files, otherwise plain "mv".
@@ -29,6 +30,9 @@ mkdir "$PING.mnt" "$PONG.mnt"
# Just ignore unmount errors.
trap "set +e ; cd /tmp; fuse-unmount -z $PING.mnt ; fuse-unmount -z $PONG.mnt ; rm -rf $PING $PONG $PING.mnt $PONG.mnt" EXIT
+echo "$MYNAME: using gocryptfs at $(command -v gocryptfs)"
+gocryptfs --version
+
gocryptfs -q -init -extpass="echo test" -scryptn=10 "$PING"
gocryptfs -q -init -extpass="echo test" -scryptn=10 "$PONG"
diff --git a/tests/stress_tests/pjdfstest.bash b/tests/stress_tests/pjdfstest.bash
new file mode 100755
index 0000000..a786e41
--- /dev/null
+++ b/tests/stress_tests/pjdfstest.bash
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+#
+# Mount a gocryptfs filesystem in /var/tmp and run pjdfstest against it
+
+set -eu
+
+export TMPDIR=${TMPDIR:-/var/tmp}
+
+cd "$(dirname "$0")"
+MYNAME=$(basename "$0")
+source ../fuse-unmount.bash
+
+pjdfstest_dir=$(realpath ../../../pjdfstest)
+if [[ ! -x $pjdfstest_dir/pjdfstest ]]
+then
+ echo "$MYNAME: pjdfstest binary not found at $pjdfstest_dir/pjdfstest"
+ echo "Please clone and build https://github.com/pjd/pjdfstest"
+ exit 1
+fi
+
+# Backing directory + mountpoint
+DIR=$(mktemp -d "$TMPDIR/$MYNAME.XXX")
+MNT="$DIR.mnt"
+mkdir "$MNT"
+
+../../gocryptfs -q -init -extpass "echo test" -scryptn=10 "$DIR"
+sudo ../../gocryptfs -q -extpass "echo test" -nosyslog -allow_other "$DIR" "$MNT"
+cd "$MNT"
+
+# Cleanup trap
+trap "cd /tmp ; fuse-unmount -z $MNT" EXIT
+
+echo "Starting pjdfstest"
+sudo prove -r "$pjdfstest_dir/tests" \ No newline at end of file