aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-03-07 20:37:10 +0100
committerJakob Unterwurzacher2018-03-07 20:37:10 +0100
commit51de6cd9405aa0db3b248324623c82cbc05e61ae (patch)
tree3cc3ec167477861ca884360c815e1919aa092c59 /tests
parent02693912e59b44f463c4b14d6a3168fa24857e6f (diff)
macos: tests: make extractloop.bash work on macos
macos' bash and ln lack a few features we used.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/stress_tests/extractloop.bash17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/stress_tests/extractloop.bash b/tests/stress_tests/extractloop.bash
index e25f721..26496ba 100755
--- a/tests/stress_tests/extractloop.bash
+++ b/tests/stress_tests/extractloop.bash
@@ -48,7 +48,7 @@ echo "Test dir: $CRYPT"
sleep 1
cd $MNT
-ln -sTf $CSV /tmp/extractloop.csv
+ln -sTf $CSV /tmp/extractloop.csv || true # fails on MacOS
# Cleanup trap
# Note: gocryptfs may have already umounted itself because bash relays SIGINT
@@ -56,12 +56,11 @@ ln -sTf $CSV /tmp/extractloop.csv
trap "cd /; fuse-unmount -z $MNT; rm -rf $CRYPT $MNT" EXIT
function loop {
- # Note: In a subshell, $$ returns the PID of the parent shell.
- # We need our own PID, which is why we use $BASHPID.
- mkdir $BASHPID
- cd $BASHPID
+ ID=$1
+ mkdir $ID
+ cd $ID
- echo "[pid $BASHPID] Starting loop"
+ echo "[looper $ID] Starting"
N=1
RSS=0
@@ -77,7 +76,7 @@ function loop {
RSS=$(grep VmRSS /proc/$FSPID/status | tr -s ' ' | cut -f2 -d ' ')
echo "$N,$SECONDS,$RSS" >> $CSV
fi
- echo "[pid $BASHPID] Iteration $N done, $delta seconds, RSS $RSS kiB"
+ echo "[looper $ID] Iteration $N done, $delta seconds, RSS $RSS kiB"
let N=$N+1
done
}
@@ -89,7 +88,7 @@ function memprof {
done
}
-loop &
-loop &
+loop 1 &
+loop 2 &
#memprof &
wait