From: grev Date: Wed, 21 Oct 2009 09:30:46 +0000 (+0000) Subject: b=20863 X-Git-Tag: v1_8_2_01~1^2~6 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e2dcecafd184d05df524bde467577d9cad144295;p=fs%2Flustre-release.git b=20863 i=Brian sanity test_200* cleanup --- diff --git a/lustre/tests/ost-pools.sh b/lustre/tests/ost-pools.sh index a07f247..84371a6 100644 --- a/lustre/tests/ost-pools.sh +++ b/lustre/tests/ost-pools.sh @@ -187,30 +187,6 @@ drain_pool() { ||error "Failed to remove targets from pool: $pool" } -destroy_pool_int() { - OSTS=$(do_facet mds lctl pool_list $1 | awk '$1 !~ /^Pool:/ {print $1}') - for ost in $OSTS - do - do_facet mds lctl pool_remove $1 $ost - done - do_facet mds lctl pool_destroy $1 -} - -destroy_pool() { - local RC - - do_facet mds lctl pool_list $FSNAME.$1 - RC=$? - [[ $RC -ne 0 ]] && return $RC - - destroy_pool_int $FSNAME.$1 - RC=$? - [[ $RC -ne 0 ]] && return $RC - - wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$1 \ - 2>/dev/null || echo foo" "foo" && return 0 -} - add_pool() { local pool=$1 local osts=$2 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 09cff2f..b834772 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -6261,9 +6261,20 @@ check_file_in_pool() export mdtlov= +cleanup_200 () { + trap 0 + test_pools || return 0 + destroy_pool $POOL +} + test_200a() { test_pools || return 0 + do_facet mgs $LCTL pool_new $FSNAME.$POOL + + trap cleanup_200 EXIT + CLEANUP_200=yes + # get param should return err until pool is created wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null || echo foo" "" || error "Pool creation of $POOL failed" } @@ -6359,11 +6370,14 @@ test_201c() { # was 200i test_pools || return 0 do_facet mgs $LCTL pool_destroy $FSNAME.$POOL # get param should return err once pool is gone - wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null || echo foo" "foo" && return 0 + wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null || + echo foo" "foo" && unset CLEANUP_200 && trap 0 && return 0 error "Pool $FSNAME.$POOL is not destroyed" } run_test 201c "Remove a pool ============================================" +[ "$CLEANUP_200" ] && cleanup_200 + test_202() { $LFS setstripe -c 2 -s 1048576 $DIR/$tfile multiop $DIR/$tfile oO_WRONLY:O_APPEND:O_DIRECT:b1048548b130c || \ diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index a51bece..487dd41 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -2739,6 +2739,30 @@ wait_clients_import_state () { fi } +destroy_pool_int() { + local ost + local OSTS=$(do_facet mds lctl pool_list $1 | awk '$1 !~ /^Pool:/ {print $1}') + for ost in $OSTS; do + do_facet mgs lctl pool_remove $1 $ost + done + do_facet mgs lctl pool_destroy $1 +} + +destroy_pool() { + local RC + + do_facet mds lctl pool_list $FSNAME.$1 + RC=$? + [[ $RC -ne 0 ]] && return $RC + + destroy_pool_int $FSNAME.$1 + RC=$? + [[ $RC -ne 0 ]] && return $RC + + wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$1 \ + 2>/dev/null || echo foo" "foo" && return 0 +} + gather_logs () { local list=$1