Whamcloud - gitweb
LU-8526 tests: ensure all OSTs active for allocations 48/23148/2
authorBruno Faccini <bruno.faccini@intel.com>
Thu, 13 Oct 2016 21:53:53 +0000 (23:53 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 15 Feb 2017 01:02:54 +0000 (01:02 +0000)
This patch ensures that all OSTs are active to be selected
for objids allocations. This will allow for random selection
of OSTs during setstripe to be effective.
To do so, wait_osts_up() has been exported from conf-sanity
to test-framework to become part of the generic functions
set and be used from any tests suites, and particularly in
replay-single/test_90 sub-test.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: Id5db31948ab86c1b3c2bc289191917ed3e8aadf8
Reviewed-on: https://review.whamcloud.com/23148
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/conf-sanity.sh
lustre/tests/replay-single.sh
lustre/tests/test-framework.sh

index 937cd92..2a0dc2d 100755 (executable)
@@ -5641,19 +5641,6 @@ test_81() { # LU-4665
 }
 run_test 81 "sparse OST indexing"
 
-# Wait OSTs to be active on both client and MDT side.
-wait_osts_up() {
-       local cmd="$LCTL get_param -n lov.$FSNAME-clilov-*.target_obd |
-               awk 'BEGIN {c = 0} /ACTIVE/{c += 1} END {printf \\\"%d\\\", c}'"
-       wait_update $HOSTNAME "eval $cmd" $OSTCOUNT ||
-               error "wait_update OSTs up on client failed"
-
-       cmd="$LCTL get_param -n lod.$FSNAME-MDT*-*.target_obd | sort -u |
-            awk 'BEGIN {c = 0} /ACTIVE/{c += 1} END {printf \\\"%d\\\", c}'"
-       wait_update_facet $SINGLEMDS "eval $cmd" $OSTCOUNT ||
-               error "wait_update OSTs up on MDT failed"
-}
-
 # Here we exercise the stripe placement functionality on a file system that
 # has formatted the OST with a random index. With the file system the following
 # functionality is tested:
index d3fc511..96fc10a 100755 (executable)
@@ -3294,8 +3294,8 @@ test_90() { # bug 19494
             return 0
         fi
     fi
-       # maybe effected by previous test
-        wait_osc_import_state mds ost FULL
+       # ensure all OSTs are active to allow allocations
+       wait_osts_up
 
        mkdir $dir || error "mkdir $dir failed"
 
index a90beae..d27cb30 100755 (executable)
@@ -2336,6 +2336,19 @@ wait_mds_ost_sync () {
        return 1
 }
 
+# Wait OSTs to be active on both client and MDT side.
+wait_osts_up() {
+       local cmd="$LCTL get_param -n lov.$FSNAME-clilov-*.target_obd |
+               awk 'BEGIN {c = 0} /ACTIVE/{c += 1} END {printf \\\"%d\\\", c}'"
+       wait_update $HOSTNAME "eval $cmd" $OSTCOUNT ||
+               error "wait_update OSTs up on client failed"
+
+       cmd="$LCTL get_param -n lod.$FSNAME-MDT*-*.target_obd | sort -u |
+            awk 'BEGIN {c = 0} /ACTIVE/{c += 1} END {printf \\\"%d\\\", c}'"
+       wait_update_facet $SINGLEMDS "eval $cmd" $OSTCOUNT ||
+               error "wait_update OSTs up on MDT failed"
+}
+
 wait_destroy_complete () {
        echo "Waiting for local destroys to complete"
        # MAX value shouldn't be big as this mean server responsiveness