2016-09-25 20:04:03 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
MD5="$PWD/../stress_tests/linux-3.0.md5sums"
|
|
|
|
MYNAME=$(basename "$0")
|
2017-02-15 23:02:01 +01:00
|
|
|
source ../fuse-unmount.bash
|
2016-09-25 20:04:03 +02:00
|
|
|
|
|
|
|
# Setup dirs
|
2018-03-07 09:45:20 +01:00
|
|
|
../dl-linux-tarball.bash
|
2016-09-25 20:04:03 +02:00
|
|
|
cd /tmp
|
2021-08-31 19:01:47 +02:00
|
|
|
WD=$(mktemp -d "/tmp/$MYNAME.XXX")
|
2016-09-25 20:04:03 +02:00
|
|
|
|
|
|
|
# Cleanup trap
|
2017-02-15 23:02:01 +01:00
|
|
|
trap "set +u; cd /; fuse-unmount -z $WD/c; fuse-unmount -z $WD/b; rm -rf $WD" EXIT
|
2016-09-25 20:04:03 +02:00
|
|
|
|
2021-08-31 19:01:47 +02:00
|
|
|
cd "$WD"
|
2016-09-25 20:04:03 +02:00
|
|
|
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"
|
2016-09-26 23:25:13 +02:00
|
|
|
set -o pipefail
|
2021-08-31 19:01:47 +02:00
|
|
|
md5sum -c "$MD5" | pv -l -s 36782 -N "files checked" | (grep -v ": OK" || true)
|