aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-05-29 13:57:22 +0200
committerJakob Unterwurzacher2016-05-29 13:57:22 +0200
commit9aeb639a15511d0e1c5090e9d3cfcd98074d04f3 (patch)
treeaa6e77904d931f34656e1174fb3349bffc718353
parent4c0cb37c50c66b03be43063d77a52b74f24ec9f7 (diff)
fsstress-loopback: properly stop on Ctrl-C
Send fsstress (which ignores Ctrl-C) into the background so the shell gets the signal. Manually kill fsstress in the cleanup handler. Also, use the build.bash script for gocryptfs.
-rwxr-xr-xstress_tests/fsstress-loopback.bash16
1 files changed, 11 insertions, 5 deletions
diff --git a/stress_tests/fsstress-loopback.bash b/stress_tests/fsstress-loopback.bash
index a60face..51c68db 100755
--- a/stress_tests/fsstress-loopback.bash
+++ b/stress_tests/fsstress-loopback.bash
@@ -40,10 +40,11 @@ if [ $MYNAME = fsstress-loopback.bash ]; then
cd $GOPATH/src/github.com/hanwen/go-fuse/example/loopback
go build && go install
$GOPATH/bin/loopback -l $MNT $DIR &
+ disown
elif [ $MYNAME = fsstress-gocryptfs.bash ]; then
echo "Recompile gocryptfs"
cd $GOPATH/src/github.com/rfjakob/gocryptfs
- go build && go install
+ ./build.bash
$GOPATH/bin/gocryptfs -q -init -extpass "echo test" -scryptn=10 $DIR
$GOPATH/bin/gocryptfs -q -extpass "echo test" -nosyslog $DIR $MNT
else
@@ -61,7 +62,7 @@ done
echo
# Cleanup trap
-trap "cd /; fusermount -u -z $MNT; rm -rf $DIR $MNT" EXIT
+trap "kill %1 ; cd /; fusermount -u -z $MNT; rm -rf $DIR $MNT" EXIT
echo "Starting fsstress loop"
N=1
@@ -70,15 +71,20 @@ do
echo $N
mkdir $MNT/fsstress.1
echo -n " fsstress.1 "
- $FSSTRESS -r -m 8 -n 1000 -d $MNT/fsstress.1
+ $FSSTRESS -r -m 8 -n 1000 -d $MNT/fsstress.1 &
+ wait
mkdir $MNT/fsstress.2
echo -n " fsstress.2 "
- $FSSTRESS -p 20 -r -m 8 -n 1000 -d $MNT/fsstress.2
+ $FSSTRESS -p 20 -r -m 8 -n 1000 -d $MNT/fsstress.2 &
+ wait
mkdir $MNT/fsstress.3
echo -n " fsstress.3 "
- $FSSTRESS -p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20 -m 8 -n 1000 -d $MNT/fsstress.3
+ $FSSTRESS -p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 \
+ -f rename=30 -f stat=30 -f unlink=30 -f truncate=20 -m 8 \
+ -n 1000 -d $MNT/fsstress.3 &
+ wait
echo " rm"
rm -R $MNT/*