summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Brady <[email protected]>2017-09-21 11:17:56 -0600
committerBrian Behlendorf <[email protected]>2017-09-21 10:17:56 -0700
commit5df5d06a8d86af475e90fe7dd86ea044f937be66 (patch)
treee3d5f74b7277627607fa75dcf6427dc845d19728
parent4ce3c45a5e30a6ee698ea60be381c774050093ed (diff)
Cleanup zloop working directory after each pass
Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed by: John Kennedy <[email protected]> Reviewed-by: Olaf Faaland <[email protected]> Signed-off-by: Don Brady <[email protected]> Issue #6595 Closes #6663
-rwxr-xr-xscripts/zloop.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/zloop.sh b/scripts/zloop.sh
index d3ec93202..f285d6a25 100755
--- a/scripts/zloop.sh
+++ b/scripts/zloop.sh
@@ -99,6 +99,7 @@ function store_core
{
core="$(core_file)"
if [[ $ztrc -ne 0 ]] || [[ -f "$core" ]]; then
+ df -h "$workdir" >>ztest.out
coreid=$(date "+zloop-%y%m%d-%H%M%S")
foundcrashes=$((foundcrashes + 1))
@@ -148,13 +149,14 @@ function store_core
# parse arguments
# expected format: zloop [-t timeout] [-c coredir] [-- extra ztest args]
coredir=$DEFAULTCOREDIR
-workdir=$DEFAULTWORKDIR
+basedir=$DEFAULTWORKDIR
+rundir="zloop-run"
timeout=0
while getopts ":ht:c:f:" opt; do
case $opt in
t ) [[ $OPTARG -gt 0 ]] && timeout=$OPTARG ;;
c ) [[ $OPTARG ]] && coredir=$OPTARG ;;
- f ) [[ $OPTARG ]] && workdir=$(readlink -f "$OPTARG") ;;
+ f ) [[ $OPTARG ]] && basedir=$(readlink -f "$OPTARG") ;;
h ) usage
exit 2
;;
@@ -198,6 +200,11 @@ curtime=$starttime
while [[ $timeout -eq 0 ]] || [[ $curtime -le $((starttime + timeout)) ]]; do
zopt="-VVVVV"
+ # start each run with an empty directory
+ workdir="$basedir/$rundir"
+ or_die rm -rf "$workdir"
+ or_die mkdir "$workdir"
+
# switch between common arrangements & fully randomized
if [[ $((RANDOM % 2)) -eq 0 ]]; then
mirrors=2