summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Ottenklinger <evnu@posteo.de>2015-10-14 22:08:32 +0200
committerMagnus Ottenklinger <evnu@posteo.de>2015-10-14 22:25:11 +0200
commit3624fa82895ac7bbe0221fbf32bf72cdb16c68ec (patch)
tree8a9e3940baf24d8e7b7a89d3ca0c05c34cd5473f
parent5169fbe145e06ef28d59a80310d3bdb69e80d4ba (diff)
downloadunionfs-fuse-git-3624fa82895ac7bbe0221fbf32bf72cdb16c68ec.tar.gz
use a cleanup function in test.sh
-rwxr-xr-xtest.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/test.sh b/test.sh
index e1248be..21acf09 100755
--- a/test.sh
+++ b/test.sh
@@ -9,8 +9,14 @@ echo v1 > original/file
echo v1 > original/play-with-me
echo v1 > original/delete-me
+cleanup() {
+ if [ -e "union" ]; then fusermount -u -q union; fi
+ rm -rf union original working-copy
+}
+trap cleanup EXIT
+
src/unionfs -d -o cow working-copy=rw:original=ro union >unionfs.log 2>&1 &
-trap 'if [ "$(ls union)" ]; then fusermount -u union; fi; rm -rf union original working-copy' EXIT
+
sleep 1
[ "$(cat union/file)" = "v1" ]