Whamcloud - gitweb
b=24294 test_pios: take the ost-s sizes into account
authorElena Gryaznova <elena.gryaznova@oracle.com>
Thu, 23 Dec 2010 23:39:13 +0000 (02:39 +0300)
committerVitaly Fertman <vitaly.fertman@oracle.com>
Thu, 23 Dec 2010 23:55:41 +0000 (02:55 +0300)
i=Vitaly.Fertman

lustre/tests/obdfilter-survey.sh
lustre/tests/sanity-benchmark.sh
lustre/tests/test-framework.sh

index f5cd00d..3c8aff9 100644 (file)
@@ -25,10 +25,6 @@ OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)}
 build_test_filter
 check_and_setup_lustre
 
 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
 # FIXME: the summary file a bit smaller than OSTSIZE, add estimation
 minsize=$(min_ost_size)
 if [ $(( size * 1024 )) -ge $minsize  ]; then
index c573af1..d64ec23 100644 (file)
@@ -231,7 +231,13 @@ pios_file_size () {
 }
 
 space_check () {
 }
 
 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,
     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,
@@ -265,7 +271,7 @@ pios_setup() {
 }
 
 pios_cleanup() {
 }
 
 pios_cleanup() {
-    local rc=$1
+    local rc=${1:-0}
     local testdir=$DIR/$tdir
     if [ $rc -eq 0 ]; then
         echo cleanup: testdir=$testdir rc=$rc
     local testdir=$DIR/$tdir
     if [ $rc -eq 0 ]; then
         echo cleanup: testdir=$testdir rc=$rc
@@ -301,8 +307,12 @@ test_pios_ssf() {
     fi
 
     local rc=0
     fi
 
     local rc=0
-    space_check || { skip_env "not enough space" && return 0; }
     pios_setup --stripe || return
     pios_setup --stripe || return
+    if ! space_check; then
+        skip_env "not enough space"
+        pios_cleanup
+        return 0
+    fi
     run_pios || return
     run_pios  --verify || rc=$? 
     pios_cleanup $rc
     run_pios || return
     run_pios  --verify || rc=$? 
     pios_cleanup $rc
@@ -317,8 +327,12 @@ test_pios_fpp() {
     fi
 
     local rc=0
     fi
 
     local rc=0
-    space_check || { skip_env "not enough space" && return 0; }
     pios_setup || return
     pios_setup || return
+    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=$?
     pios_cleanup $rc
     run_pios -L fpp || return
     run_pios -L fpp --verify || rc=$?
     pios_cleanup $rc
index bc8de5c..9302d23 100644 (file)
@@ -4502,3 +4502,7 @@ is_sanity_benchmark() {
     return 1
 }
 
     return 1
 }
 
+min_ost_size () {
+    $LCTL get_param -n osc.*.kbytesavail | sort -n | head -n1
+}
+