From d56f1ee179857701df0a3bfb1d20a81921088bc5 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 5 May 2016 14:17:05 +0200 Subject: [PATCH] stress_tests: extractloop: run two loops in parallel This increases the load but also the disk space requirements (to about 2GB). --- stress_tests/extractloop.bash | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/stress_tests/extractloop.bash b/stress_tests/extractloop.bash index 3d43763..b3c13c0 100755 --- a/stress_tests/extractloop.bash +++ b/stress_tests/extractloop.bash @@ -16,17 +16,22 @@ cd $DIR2 # Just ignore fusermount errors. trap "cd /; fusermount -u -z $DIR2; rm -rf $DIR1 $DIR2" EXIT -# Loop -N=1 -while true -do - echo -n "$N " - echo -n "extract " - tar xf /tmp/linux-3.0.tar.gz - echo -n "diff " - diff -ur linux-3.0 /tmp/linux-3.0 - echo -n "rm " - rm -Rf linux-3.0 - date - let N=$N+1 -done +function loop { + # Note: $$ returns the PID of the *parent* shell + mkdir $BASHPID + cd $BASHPID + + N=1 + while true + do + echo "Process $BASHPID iteration $N: $(date)" + tar xf /tmp/linux-3.0.tar.gz + diff -ur linux-3.0 /tmp/linux-3.0 + rm -Rf linux-3.0 + let N=$N+1 + done +} + +loop & +loop & +wait