]> www.infradead.org Git - users/hch/blktests.git/commitdiff
common/multipath-over-rdma: Skip teardown if $debug has been set
authorBart Van Assche <bvanassche@acm.org>
Thu, 13 Dec 2018 21:49:20 +0000 (13:49 -0800)
committerBart Van Assche <bvanassche@acm.org>
Mon, 11 Feb 2019 16:34:27 +0000 (08:34 -0800)
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 <bvanassche@acm.org>
common/multipath-over-rdma

index 8583b58d7a872bc64975e92aa71e3b10aec119d8..15201468ca734fa78ef850ab5775fb035145b00f 100644 (file)
@@ -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