diff options
author | Jakob Unterwurzacher | 2019-11-03 20:02:46 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2019-11-03 20:04:23 +0100 |
commit | 74b723d765e246f3409d4e538325242eabbc96fe (patch) | |
tree | b3fcd70313c4b1d5b1dbeefcc2427cd7c280c9b1 /tests/stress_tests/extractloop.bash | |
parent | 6c91f697e19490b38f5408eb142a27cd6d2b6c3c (diff) |
tests: send SIGUSR1 to loopback
loopback needs to receive SIGUSR1 to write a memory profile.
Diffstat (limited to 'tests/stress_tests/extractloop.bash')
-rwxr-xr-x | tests/stress_tests/extractloop.bash | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/stress_tests/extractloop.bash b/tests/stress_tests/extractloop.bash index e4be841..cdd0c25 100755 --- a/tests/stress_tests/extractloop.bash +++ b/tests/stress_tests/extractloop.bash @@ -48,16 +48,20 @@ function check_md5sums { # Mount FSPID=0 +FS="" if [ $# -eq 1 ] && [ "$1" == "-encfs" ]; then + FS=encfs echo "Testing EncFS" encfs --extpass="echo test" --standard $CRYPT $MNT > /dev/null elif [ $# -eq 1 ] && [ "$1" == "-loopback" ]; then + FS=loopback echo "Testing go-fuse loopback" rm -f /tmp/loopback*.memprof loopback -memprofile=/tmp/loopback $MNT $CRYPT & FSPID=$(jobs -p) disown else + FS=gocryptfs echo "Testing gocryptfs" gocryptfs -q -init -extpass="echo test" -scryptn=10 $CRYPT gocryptfs -q -extpass="echo test" -nosyslog -fg $CRYPT $MNT & @@ -75,7 +79,18 @@ ln -v -sTf $CSV /tmp/extractloop.csv 2> /dev/null || true # fails on MacOS, igno # Cleanup trap # Note: gocryptfs may have already umounted itself because bash relays SIGINT # Just ignore unmount errors. -trap "cd / ; rm -Rf $CRYPT ; fuse-unmount -z $MNT || true ; rmdir $MNT" EXIT +trap cleanup_exit EXIT + +function cleanup_exit { + if [[ $FS == loopback ]]; then + # SIGUSR1 causes loopback to write the memory profile to disk + kill -USR1 $FSPID + fi + cd / + rm -Rf $CRYPT + fuse-unmount -z $MNT || true + rmdir $MNT +} function loop { ID=$1 @@ -93,7 +108,7 @@ function loop { # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # Exclude the one symlink in the tarball - causes problems on MacOS: "Can't set permissions to 0755" check_md5sums $MD5 - rm -Rf linux-3.0 + rm -R linux-3.0 t2=$SECONDS delta=$((t2-t1)) if [[ $FSPID -gt 0 && -d /proc ]]; then @@ -114,5 +129,7 @@ function memprof { loop 1 & loop 2 & -#memprof & +if [[ $FS == loopback ]]; then + memprof & +fi wait |