if [[ $facet == client* ]]; then
# During setup time, the osc might not be setup, it need wait
- # until list_param can return valid value. And also if there
- # are mulitple osc entries we should list all of them before
- # go to wait.
+ # until list_param can return valid value.
+ param="osc.${ost%?}[^mM]*.ost_server_uuid"
params=$($LCTL list_param $param 2>/dev/null || true)
while [ -z "$params" ]; do
if [ $i -ge $maxtime ]; then
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
}
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 () {