Commit d1f9da82 authored by Seth Howell's avatar Seth Howell Committed by Jim Harris
Browse files

autotest.sh: create cleanup function



This function consolidates cleanup behaviors that the pool should follow
in the event of a failure.

Change-Id: I8623f065146292b29a38eb199dcbeac5787723e7
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/401857


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 4dbff01b
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ if [ $(uname -s) = Linux ]; then
	echo "core" > /proc/sys/kernel/core_pattern
fi

trap "process_core; $rootdir/scripts/setup.sh reset; exit 1" SIGINT SIGTERM EXIT
trap "process_core; autotest_cleanup; exit 1" SIGINT SIGTERM EXIT

timing_enter autotest

@@ -205,13 +205,7 @@ if [ $SPDK_TEST_NVML -eq 1 ]; then
fi

timing_enter cleanup
if [ $SPDK_TEST_RBD -eq 1 ]; then
	rbd_cleanup
fi
./scripts/setup.sh reset
if [ $SPDK_BUILD_IOAT_KMOD -eq 1 ]; then
	./scripts/build_kmod.sh clean
fi
autotest_cleanup
timing_exit cleanup

timing_exit autotest
+13 −0
Original line number Diff line number Diff line
@@ -538,5 +538,18 @@ function get_bdev_size()
	echo "$bdev_size"
}

function autotest_cleanup()
{
	if [ $SPDK_TEST_RBD -eq 1 ]; then
		rbd_cleanup
	fi

	$rootdir/scripts/setup.sh reset

	if [ $SPDK_BUILD_IOAT_KMOD -eq 1 ]; then
		$rootdir/scripts/build_kmod.sh clean
	fi
}

set -o errtrace
trap "trap - ERR; print_backtrace >&2" ERR