From 570c8bb4836341e741c49eb5cf1d5f2cce3d6b94 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 23 Jun 2021 10:33:17 +0200 Subject: [PATCH] autotest: Purge tmp test dirs during the final cleanup Fixes #2006 Signed-off-by: Michal Berger Change-Id: I3dbc0cb1177f3611b6d5684ddac7d26c64cc0479 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8476 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Changpeng Liu Reviewed-by: Ziye Yang --- test/common/autotest_common.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 9f215f9506..4506ccffdd 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -291,17 +291,6 @@ function set_test_storage() { local source fs size avail mount use local storage_fallback storage_candidates - local storage_fallback_purge - - shopt -s nullglob - storage_fallback_purge=("${TMPDIR:-/tmp}/spdk."??????) - shopt -u nullglob - - if ((${#storage_fallback_purge[@]} > 0)); then - printf '* Purging old temporary test storage (%s)\n' \ - "${storage_fallback_purge[*]}" >&2 - sudo rm -rf "${storage_fallback_purge[@]}" - fi storage_fallback=$(mktemp -udt spdk.XXXXXX) storage_candidates=( @@ -1245,6 +1234,16 @@ function autotest_cleanup() { kill "$udevadm_pid" || : fi revert_soft_roce + + shopt -s nullglob + local storage_fallback_purge=("${TMPDIR:-/tmp}/spdk."??????) + shopt -u nullglob + + if ((${#storage_fallback_purge[@]} > 0)); then + printf '* Purging old temporary test storage (%s)\n' \ + "${storage_fallback_purge[*]}" >&2 + rm -rf "${storage_fallback_purge[@]}" + fi } function freebsd_update_contigmem_mod() {