aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2026-07-16 22:03:13 +0200
committerJakob Unterwurzacher2026-07-16 22:03:58 +0200
commit2f487597f9cabe372a96eecc6007cba1fa9526ac (patch)
tree3539a14f1346e6412de13c1d80799c9b3fa81b85
parent1e1603c06de224be85d589943a08f2f825347466 (diff)
Add tests/stress_tests/pjdfstest.bash
-rwxr-xr-xtests/stress_tests/pjdfstest.bash34
1 files changed, 34 insertions, 0 deletions
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