From e3acab84b4a782a322e3cdab67077f1ccafb409c Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Fri, 24 Dec 2010 17:56:02 +0300 Subject: [PATCH] b=24294 test_pios: take the ost-s sizes into account i=Vitaly.Fertman remove obsolete workaround bug19657 part --- lustre/tests/obdfilter-survey.sh | 4 ---- lustre/tests/sanity-benchmark.sh | 30 ++++++++++++++++++------------ lustre/tests/test-framework.sh | 5 +++++ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/lustre/tests/obdfilter-survey.sh b/lustre/tests/obdfilter-survey.sh index ccdccdf..043883f 100644 --- a/lustre/tests/obdfilter-survey.sh +++ b/lustre/tests/obdfilter-survey.sh @@ -24,10 +24,6 @@ OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)} build_test_filter check_and_setup_lustre -min_ost_size () { - $LCTL get_param -n osc.*.kbytesavail | sort -n | head -n1 -} - # FIXME: the summary file a bit smaller than OSTSIZE, add estimation minsize=$(min_ost_size) if [ $(( size * 1024 )) -ge $minsize ]; then diff --git a/lustre/tests/sanity-benchmark.sh b/lustre/tests/sanity-benchmark.sh index df615a1..7bc3a03 100644 --- a/lustre/tests/sanity-benchmark.sh +++ b/lustre/tests/sanity-benchmark.sh @@ -230,7 +230,13 @@ pios_file_size () { } space_check () { - local space=$(df -P $DIR | tail -n 1 | awk '{ print $4 }') + local testdir=$DIR/$tdir + local stripe=$($LFS getstripe -c $testdir) + + # if stripe_count = 1 the size should be less than min ost size, bug 24294 + local space=$($LFS df $testdir | grep "filesystem summary:" | awk '{print $3}') + [ $stripe -eq 1 ] && space=$(min_ost_size) + local size=$(pios_file_size) size=$(( size + size / 10 )) # we can not use pios --cleanup|-x because we need the files exist for pios --verify, @@ -264,7 +270,7 @@ pios_setup() { } pios_cleanup() { - local rc=$1 + local rc=${1:-0} local testdir=$DIR/$tdir if [ $rc -eq 0 ]; then echo cleanup: testdir=$testdir rc=$rc @@ -300,14 +306,14 @@ test_pios_ssf() { fi local rc=0 - space_check || { skip_env "not enough space" && return 0; } pios_setup --stripe || return - # bug 19657 - local old_PWD=$PWD - cd $TMP + if ! space_check; then + skip_env "not enough space" + pios_cleanup + return 0 + fi run_pios || return run_pios --verify || rc=$? - cd $old_PWD pios_cleanup $rc return $rc } @@ -320,14 +326,14 @@ test_pios_fpp() { fi local rc=0 - space_check || { skip_env "not enough space" && return 0; } pios_setup || return - # bug 19657 - local old_PWD=$PWD - cd $TMP + if ! space_check; then + skip_env "not enough space" + pios_cleanup + return 0 + fi run_pios -L fpp || return run_pios -L fpp --verify || rc=$? - cd $old_PWD pios_cleanup $rc return $rc } diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index cd6821b..c33d839 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -3673,3 +3673,8 @@ is_sanity_benchmark() { done return 1 } + +min_ost_size () { + $LCTL get_param -n osc.*.kbytesavail | sort -n | head -n1 +} + -- 1.8.3.1