From 04794b33653fedca282d6f8dfd9c1c9e833ead06 Mon Sep 17 00:00:00 2001 From: Bruno Faccini Date: Thu, 13 Oct 2016 23:53:53 +0200 Subject: [PATCH] LU-8526 tests: ensure all OSTs active for allocations 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 Change-Id: Id5db31948ab86c1b3c2bc289191917ed3e8aadf8 Reviewed-on: https://review.whamcloud.com/23148 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- lustre/tests/conf-sanity.sh | 13 ------------- lustre/tests/replay-single.sh | 4 ++-- lustre/tests/test-framework.sh | 13 +++++++++++++ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 937cd92..2a0dc2d 100755 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -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: diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index d3fc511..96fc10a 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -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" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index a90beae..d27cb30 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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 -- 1.8.3.1