test/common: use sudo to remove old temp files

Most common scenario is to run SPDK tests using "autorun.sh",
which calls autotest.sh with "sudo" and permissions are not
an issue then.
However we have a number of tests which are run independently
(e.g. test/fuzz/autofuzz.sh) and try to remove old temp files
before sudo is used to elevate privileges. This causes tests
to fail early.
Using "sudo" explicitly in autotest_common.sh to remove old
files will fix the problem.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I84f75c189bb04d0e3208dfc4f221d07d17db5ee5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3819
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
This commit is contained in:
Karol Latecki 2020-08-17 13:37:18 +02:00 committed by Tomasz Zawadzki
parent fa729fd3a7
commit 6127b1a33b

View File

@ -247,7 +247,7 @@ function set_test_storage() {
if ((${#storage_fallback_purge[@]} > 0)); then
printf '* Purging old temporary test storage (%s)\n' \
"${storage_fallback_purge[*]}" >&2
rm -rf "${storage_fallback_purge[@]}"
sudo rm -rf "${storage_fallback_purge[@]}"
fi
storage_fallback=$(mktemp -udt spdk.XXXXXX)