stress_tests: add header comments
Also, convert extractloop.bash to using md5sum instead of diff -ur so the user does not have to keep an extracted kernel tree around. And print the iteration time.
This commit is contained in:
parent
888e147cd8
commit
b467e7509e
@ -1,7 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Mount a gocryptfs filesystem somewhere on /tmp, then run two parallel
|
||||||
|
# infinite loops inside that do the following:
|
||||||
|
# 1) Extract linux-3.0.tar.gz
|
||||||
|
# 2) Verify the md5sums
|
||||||
|
# 3) Delete, go to (1)
|
||||||
|
#
|
||||||
|
# This test is good at discovering inode-related memory leaks because it creates
|
||||||
|
# huge numbers of files.
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
MD5="$PWD/extractloop.md5sums"
|
||||||
|
|
||||||
# Setup
|
# Setup
|
||||||
cd /tmp
|
cd /tmp
|
||||||
wget -nv --show-progress -c https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz
|
wget -nv --show-progress -c https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz
|
||||||
@ -18,17 +30,23 @@ cd $DIR2
|
|||||||
trap "cd /; fusermount -u -z $DIR2; rm -rf $DIR1 $DIR2" EXIT
|
trap "cd /; fusermount -u -z $DIR2; rm -rf $DIR1 $DIR2" EXIT
|
||||||
|
|
||||||
function loop {
|
function loop {
|
||||||
# Note: $$ returns the PID of the *parent* shell
|
# Note: In a subshell, $$ returns the PID of the *parent* shell,
|
||||||
|
# we need our own, which is why we have to use $BASHPID.
|
||||||
mkdir $BASHPID
|
mkdir $BASHPID
|
||||||
cd $BASHPID
|
cd $BASHPID
|
||||||
|
|
||||||
|
echo "[pid $BASHPID] Starting loop"
|
||||||
|
|
||||||
N=1
|
N=1
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
echo "[pid $BASHPID] $N: $(date +%H:%M:%S)"
|
t1=$(date +%s)
|
||||||
tar xf /tmp/linux-3.0.tar.gz
|
tar xf /tmp/linux-3.0.tar.gz
|
||||||
diff -ur linux-3.0 /tmp/linux-3.0
|
md5sum --status -c $MD5
|
||||||
rm -Rf linux-3.0
|
rm -Rf linux-3.0
|
||||||
|
t2=$(date +%s)
|
||||||
|
delta=$((t2-t1))
|
||||||
|
echo "[pid $BASHPID] Iteration $N done, $delta seconds"
|
||||||
let N=$N+1
|
let N=$N+1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
36782
stress_tests/extractloop.md5sums
Normal file
36782
stress_tests/extractloop.md5sums
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Mount a go-fuse loopback filesystem in /tmp and run fsstress against it
|
||||||
|
# in an infinite loop, only exiting on errors.
|
||||||
|
#
|
||||||
|
# When called as "fsstress-gocryptfs.bash", a gocryptfs filesystem is tested
|
||||||
|
# instead.
|
||||||
|
#
|
||||||
|
# This test used to fail on older go-fuse versions after a few iterations with
|
||||||
|
# errors like this:
|
||||||
|
# "rm: cannot remove ‘/tmp/b/fsstress.2/pd/d1XXX/f4a’: No such file or directory"
|
||||||
|
#
|
||||||
|
# Nowadays it should pass an indefinite number of iterations.
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Backing directory
|
# Backing directory
|
||||||
|
Loading…
Reference in New Issue
Block a user