1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Don Brady <dev.fs.zfs@gmail.com>
3 Date: Thu, 21 Sep 2017 11:17:56 -0600
4 Subject: [PATCH] Cleanup zloop working directory after each pass
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Reviewed-by: George Melikov <mail@gmelikov.ru>
10 Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
11 Reviewed by: John Kennedy <jwk404@gmail.com>
12 Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
13 Signed-off-by: Don Brady <don.brady@delphix.com>
16 (cherry picked from commit d1630dda5857175bad0ac7f6e142ae299606d88a)
17 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
19 scripts/zloop.sh | 11 +++++++++--
20 1 file changed, 9 insertions(+), 2 deletions(-)
22 diff --git a/scripts/zloop.sh b/scripts/zloop.sh
23 index 03e825059..f0af87553 100755
24 --- a/scripts/zloop.sh
25 +++ b/scripts/zloop.sh
26 @@ -101,6 +101,7 @@ function store_core
29 if [[ $ztrc -ne 0 ]] || [[ -f "$core" ]]; then
30 + df -h "$workdir" >>ztest.out
31 coreid=$(date "+zloop-%y%m%d-%H%M%S")
32 foundcrashes=$((foundcrashes + 1))
34 @@ -150,7 +151,8 @@ function store_core
36 # expected format: zloop [-t timeout] [-c coredir] [-- extra ztest args]
37 coredir=$DEFAULTCOREDIR
38 -workdir=$DEFAULTWORKDIR
39 +basedir=$DEFAULTWORKDIR
43 while getopts ":ht:s:c:f:" opt; do
44 @@ -158,7 +160,7 @@ while getopts ":ht:s:c:f:" opt; do
45 t ) [[ $OPTARG -gt 0 ]] && timeout=$OPTARG ;;
46 s ) [[ $OPTARG ]] && size=$OPTARG ;;
47 c ) [[ $OPTARG ]] && coredir=$OPTARG ;;
48 - f ) [[ $OPTARG ]] && workdir=$(readlink -f "$OPTARG") ;;
49 + f ) [[ $OPTARG ]] && basedir=$(readlink -f "$OPTARG") ;;
53 @@ -202,6 +204,11 @@ curtime=$starttime
54 while [[ $timeout -eq 0 ]] || [[ $curtime -le $((starttime + timeout)) ]]; do
57 + # start each run with an empty directory
58 + workdir="$basedir/$rundir"
59 + or_die rm -rf "$workdir"
60 + or_die mkdir "$workdir"
62 # switch between common arrangements & fully randomized
63 if [[ $((RANDOM % 2)) -eq 0 ]]; then