From 6127b1a33bb05f66cd6ede805f061ef033d6e31a Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Mon, 17 Aug 2020 13:37:18 +0200 Subject: [PATCH] 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 Change-Id: I84f75c189bb04d0e3208dfc4f221d07d17db5ee5 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3819 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Tomasz Zawadzki Reviewed-by: Michal Berger --- test/common/autotest_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 9c65ea837..8827c704c 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -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)