X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Ftest-framework.sh;h=39a09900ea7ac623a72d312c5f87f49cce4c31ff;hp=37e8475891fee92b845c539e2f7e7ee5ba2268ab;hb=0b07798c8490b3537025e22d6d50a96321a8e513;hpb=2aa5147cd05fa8342493333e92a0c0fc7f87bbde diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 37e8475..39a0990 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -6233,6 +6233,7 @@ create_pool() { local fsname=${1%%.*} local poolname=${1##$fsname.} + trap "destroy_test_pools $fsname" EXIT do_facet mgs lctl pool_new $1 local RC=$? # get param should return err unless pool is created @@ -6312,22 +6313,22 @@ destroy_pool() { } destroy_pools () { - local fsname=${1:-$FSNAME} - local poolname - local listvar=${fsname}_CREATED_POOLS + local fsname=${1:-$FSNAME} + local poolname + local listvar=${fsname}_CREATED_POOLS - [ x${!listvar} = x ] && return 0 + [ x${!listvar} = x ] && return 0 - echo destroy the created pools: ${!listvar} - for poolname in ${!listvar//,/ }; do - destroy_pool $fsname.$poolname - done + echo "Destroy the created pools: ${!listvar}" + for poolname in ${!listvar//,/ }; do + destroy_pool $fsname.$poolname + done } -cleanup_pools () { - local fsname=${1:-$FSNAME} - trap 0 - destroy_pools $fsname +destroy_test_pools () { + trap 0 + local fsname=${1:-$FSNAME} + destroy_pools $fsname || true } gather_logs () {