From: Bart Van Assche Date: Thu, 13 Dec 2018 21:49:20 +0000 (-0800) Subject: common/multipath-over-rdma: Skip teardown if $debug has been set X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a0402c97b8f4bbac2c02785cd159a4687d97633f;p=users%2Fsagi%2Fblktests.git common/multipath-over-rdma: Skip teardown if $debug has been set A convenient way to debug the srp and nvmeof-mp tests scripts is to set the debug variable in common/multipath-over-rdma. Examining what went wrong during a test is only possible if teardown() is skipped after a test failure. Make sure that this is the case. Signed-off-by: Bart Van Assche --- diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma index 8583b58..1520146 100644 --- a/common/multipath-over-rdma +++ b/common/multipath-over-rdma @@ -598,7 +598,7 @@ setup_rdma() { } # Undo setup() -teardown() { +teardown_uncond() { shutdown_client killall -9 multipathd >&/dev/null rm -f /etc/multipath.conf @@ -607,6 +607,10 @@ teardown() { unload_null_blk } +teardown() { + [ -z "$debug" ] && teardown_uncond +} + # Set up test configuration with "$1" as multipath configuration file. setup_test() { local i m modules @@ -618,7 +622,7 @@ setup_test() { return 1 fi - if ! teardown; then + if ! teardown_uncond; then echo "teardown() failed" return 1 fi