From e498b09fcaca5380b35d9726605ff22d7bd00960 Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Mon, 6 Sep 2010 14:56:23 +0400 Subject: [PATCH] b=23014 sgpdd-survey acc-sm integration i=Andreas.Dilger i=Manoj.P.Joseph --- lustre/tests/Makefile.am | 1 + lustre/tests/acceptance-small.sh | 5 ++- lustre/tests/sgpdd-survey.sh | 79 ++++++++++++++++++++++++++++++++++++++++ lustre/tests/test-framework.sh | 16 ++++++++ 4 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 lustre/tests/sgpdd-survey.sh diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index 1c840f8..a0f19d9 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -25,6 +25,7 @@ noinst_SCRIPTS += run_dbench.sh run_IOR.sh recovery-double-scale.sh noinst_SCRIPTS += recovery-random-scale.sh parallel-scale.sh metadata-updates.sh noinst_SCRIPTS += lustre-rsync-test.sh ost-pools.sh rpc.sh yaml.sh liblustre.sh noinst_SCRIPTS += lnet-selftest.sh obdfilter-survey.sh mmp.sh +noinst_SCRIPTS += sgpdd-survey.sh nobase_noinst_SCRIPTS = cfg/local.sh nobase_noinst_SCRIPTS += acl/make-tree acl/run cfg/ncli.sh nobase_noinst_SCRIPTS += racer/dir_create.sh racer/file_create.sh racer/file_list.sh diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index 3995d5c..67b4e40 100755 --- a/lustre/tests/acceptance-small.sh +++ b/lustre/tests/acceptance-small.sh @@ -14,7 +14,7 @@ DEFAULT_SUITES="runtests sanity sanity-benchmark sanityn lfsck liblustre sanity-gss performance-sanity large-scale recovery-mds-scale recovery-double-scale recovery-random-scale parallel-scale lustre_rsync-test metadata-updates ost-pools lnet-selftest - mmp obdfilter-survey" + mmp obdfilter-survey sgpdd-survey" if [[ -n $@ ]]; then ACC_SM_ONLY="${ACC_SM_ONLY} $@" @@ -162,7 +162,8 @@ run_suite() { log_test_status $duration $status $CLEANUP - $SETUP + [ x$suite = xSGPDD_SURVEY ] || $SETUP + eval ${suite}="done" else echo "Skipping $suite_name" diff --git a/lustre/tests/sgpdd-survey.sh b/lustre/tests/sgpdd-survey.sh new file mode 100644 index 0000000..de84b44d --- /dev/null +++ b/lustre/tests/sgpdd-survey.sh @@ -0,0 +1,79 @@ +#!/bin/bash +#set -x +set -e + +LUSTRE=${LUSTRE:-`dirname $0`/..} +. $LUSTRE/tests/test-framework.sh +init_test_env $@ +. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} +init_logging + +# QE uses the following parameters: +# size=128 crghi=16 thrhi=32 +crghi=${crghi:-2} +thrhi=${thrhi:-16} +size=${size:-1024} + +[ "$SLOW" = no ] && { crghi=2; thrhi=2; } + +if ! ([ "$SGPDD_YES" ] && [ "$REFORMAT" ]); then + skip_env "$0 reformats all devices, please set SGPDD_YES and REFORMAT to run this test" + exit 0 +fi + +# Skip these tests +ALWAYS_EXCEPT="$SGPDD_SURVEY_EXCEPT" + +SGPDDSURVEY=${SGPDDSURVEY:-$(which sgpdd-survey)} + +build_test_filter + +init_facets_vars + +cleanupall + +run_sgpdd_host () { + local host=$1 + local devs=$2 + + local params="size=$size crghi=$crghi thrhi=$thrhi" + do_rpc_nodes $host run_sgpdd $devs "$params" +} + +run_sgpdd_facets () { + local facets=$1 + local facet + + local facetshosts + for facet in ${facets//,/ }; do + local host=$(facet_host $facet) + local dev=${facet}_dev + local var=${host}_devs + eval ${var}=$(expand_list ${!var} ${!dev}) + facetshosts=$(expand_list $facetshosts $host) + done + + for host in ${facetshosts//,/ }; do + var=${host}_devs + echo "=== $facets === $host === ${!var} ===" + local scsidevs=${!var} + run_sgpdd_host $host ${scsidevs} + done +} + +test_1 () { + local mdss=$(get_facets MDS) + + run_sgpdd_facets $mdss +} +run_test 1 "sgpdd-survey, mds, scsidevs" + +test_2 () { + local osts=$(get_facets OST) + + run_sgpdd_facets $osts +} +run_test 2 "sgpdd-survey, osts, scsidevs" + +equals_msg `basename $0`: test complete, cleaning up +[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 42a1af7..1dc5f83 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -145,6 +145,7 @@ init_test_env() { fi export LST=${LST:-"$LUSTRE/../lnet/utils/lst"} [ ! -f "$LST" ] && export LST=$(which lst) + export SGPDDSURVEY=${SGPDDSURVEY:-$(which sgpdd-survey)} export MDSRATE=${MDSRATE:-"$LUSTRE/tests/mpi/mdsrate"} [ ! -f "$MDSRATE" ] && export MDSRATE=$(which mdsrate 2> /dev/null) if ! echo $PATH | grep -q $LUSTRE/tests/racer; then @@ -4352,3 +4353,18 @@ duplicate_mdt_files() { done do_umount } + +run_sgpdd () { + local devs=${1//,/ } + shift + local params=$@ + local rslt=$TMP/sgpdd_survey + + # sgpdd-survey cleanups ${rslt}.* files + + local cmd="rslt=$rslt $params scsidevs=\"$devs\" $SGPDDSURVEY" + echo + $cmd + eval $cmd + cat ${rslt}.detail +} + -- 1.8.3.1