stress_tests: extractloop: run two loops in parallel

This increases the load but also the disk space requirements
(to about 2GB).
This commit is contained in:
Jakob Unterwurzacher 2016-05-05 14:17:05 +02:00
parent 730291feab
commit d56f1ee179
1 changed files with 19 additions and 14 deletions

View File

@ -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