summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-09-25 20:04:03 +0200
committerJakob Unterwurzacher2016-09-25 20:04:03 +0200
commit32e35adcadb99bdcbc129fe419269a675cb4fd40 (patch)
treef96ebfd490728a915b62bb088211ecb43d564962
parent28838a489d94a02eb44e5ff166f2c7a0babe452e (diff)
tests: add reverse linux tarball test
-rwxr-xr-xtests/reverse/linux-tarball-test.bash31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/reverse/linux-tarball-test.bash b/tests/reverse/linux-tarball-test.bash
new file mode 100755
index 0000000..7306600
--- /dev/null
+++ b/tests/reverse/linux-tarball-test.bash
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+set -eu
+
+cd "$(dirname "$0")"
+MD5="$PWD/../stress_tests/linux-3.0.md5sums"
+MYNAME=$(basename "$0")
+
+# Setup dirs
+cd /tmp
+wget -nv --show-progress -c https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz
+WD=$(mktemp -d /tmp/$MYNAME.XXX)
+
+# Cleanup trap
+trap "set +u; cd /; fusermount -u -z $WD/c; fusermount -u -z $WD/b; rm -rf $WD" EXIT
+
+cd $WD
+mkdir a b c
+echo "Extracting tarball"
+tar -x -f /tmp/linux-3.0.tar.gz -C a
+echo "Mounting a -> b -> c chain"
+# Init "a"
+gocryptfs -q -extpass="echo test" -reverse -init -scryptn=10 a
+# Reverse-mount "a" on "b"
+gocryptfs -q -extpass="echo test" -reverse a b
+# Forward-mount "b" on "c"
+gocryptfs -q -extpass="echo test" b c
+# Check md5 sums
+cd c
+echo "Checking md5 sums"
+md5sum --status -c $MD5