test/bdev: Use separate function for cleaning lingering files

Change-Id: Ib44dbf1a4ec8e44f26cb8219e53b3ed1ae03d48b
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1095
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Michal Berger 2020-03-02 21:48:33 +01:00 committed by Tomasz Zawadzki
parent 465f4c1254
commit a940721a29

View File

@ -10,6 +10,14 @@ conf_file="$testdir/bdev.conf"
# Make sure the configuration is clean
:>"$conf_file"
function cleanup() {
rm -f "/tmp/aiofile"
rm -f "/tmp/spdk-pmem-pool"
rm -f "$conf_file"
rbd_cleanup
}
function start_spdk_tgt() {
local spdk_cmd
@ -371,7 +379,4 @@ if [ "$test_type" = "gpt" ]; then
part_dev_by_gpt $conf_file Nvme0n1 $rootdir reset
fi
rm -f /tmp/aiofile
rm -f /tmp/spdk-pmem-pool
rm -f $conf_file
rbd_cleanup
cleanup