[PATCH 03/10] nvme/rc: clear hosts directory in _cleanup_nvmet()

Hannes Reinecke
2022-06-10T11:33:52Z

From: Hannes Reinecke <hare@suse.com>

When clearing out the configuration we need to clear the 'hosts'
directory, too, as scripts might have added host configurations.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
tests/nvme/rc | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/tests/nvme/rc b/tests/nvme/rc
index 454609a..cc48802 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -124,6 +124,12 @@ _cleanup_nvmet() {
rmdir "${subsys}"
done

+ for host in "${NVMET_CFS}"/hosts/*; do
+ name=$(basename "${host}")
+ echo "WARNING: Test did not clean up host: ${name}"
+ rmdir "${host}"
+ done
+
shopt -u nullglob
trap SIGINT

--
2.26.2