Whamcloud - gitweb
LU-13270 tests: dom-performance fixes 44/37644/3
authorElena Gryaznova <elena.gryaznova@hpe.com>
Thu, 20 Feb 2020 13:29:24 +0000 (16:29 +0300)
committerOleg Drokin <green@whamcloud.com>
Sun, 1 Mar 2020 05:37:39 +0000 (05:37 +0000)
Patch makes the fs cleanup at the start of dom-performance
optional and depending on t-f global DO_CLEANUP option
value. For DO_CLEANUP=false script removes only the
directories created by previous dom-performance session.
Without this fix test run 2nd time fail with:
  lfs setdirstripe: dirstripe error on '/mnt/testfs/dp_dne':
      stripe already set
  lfs setdirstripe: cannot create stripe dir '/mnt/testfs/dp_dne':
      File exists

Patch removes the check of the files createmany, statmany
and smalliomany which are part of lustre/tests. With
the existing check test_smallio() is always skipped
if run on PWD != lustre/tests.

Patch removes the comparison with MDSSIZE and adds the
comparison with real mds size. Without this fix the test
works incorrectly if run on existing fs (formatall was not
done during this session: Lustre was created with mds size
differs from MDSSIZE).

Add skip_env() to report about missing mdtest/dbench/IOR/etc.
Without this fix  the tests are skipped silently.

Test-Parameters: trivial mdssizegb=20 testlist=dom-performance
Cray-bug-id: LUS-7349
Signed-off-by: Elena Gryaznova <elena.gryaznova@hpe.com>
Reviewed-by: Vladimir Saveliev <vladimir.saveliev@hpe.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Change-Id: I5fdf1ad480edb17598cbe427bc550396ebe97808
Reviewed-on: https://review.whamcloud.com/37644
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/dom-performance.sh
lustre/tests/test-framework.sh

index 98d454c..501a30f 100644 (file)
@@ -41,13 +41,17 @@ DP_DIO=${DP_DIO:-"no"}
 DOM_SIZE=${DOM_SIZE:-"1M"}
 DP_OSC="mdc"
 
 DOM_SIZE=${DOM_SIZE:-"1M"}
 DP_OSC="mdc"
 
-rm -rf $DIR/*
-
 DP_NORM=$DIR/dp_norm
 DP_DOM=$DIR/dp_dom
 DP_DOM_DNE=$DIR/dp_dne
 DP_STATS=${DP_STATS:-"no"}
 
 DP_NORM=$DIR/dp_norm
 DP_DOM=$DIR/dp_dom
 DP_DOM_DNE=$DIR/dp_dne
 DP_STATS=${DP_STATS:-"no"}
 
+if $DO_CLEANUP; then
+       rm -rf $DIR/*
+else
+       rm -rf $DP_NORM $DP_DOM $DP_DOM_DNE
+fi
+
 # total number of files
 DP_FNUM=${DP_FNUM:-16384}
 # number of threads
 # total number of files
 DP_FNUM=${DP_FNUM:-16384}
 # number of threads
@@ -140,8 +144,7 @@ dp_run_cmd() {
 
 run_MDtest() {
        if ! which mdtest > /dev/null 2>&1 ; then
 
 run_MDtest() {
        if ! which mdtest > /dev/null 2>&1 ; then
-               echo "Mdtest is not installed, skipping"
-               return 0
+               skip_env "Mdtest is not installed, skipping"
        fi
 
        local mdtest=$(which mdtest)
        fi
 
        local mdtest=$(which mdtest)
@@ -167,38 +170,26 @@ run_MDtest() {
 }
 
 run_SmallIO() {
 }
 
 run_SmallIO() {
-       if [ ! -f createmany ] ; then
-               echo "Createmany is not installed, skipping"
-               return 0
-       fi
-
-       if [ ! -f smalliomany ] ; then
-               echo "Smalliomany is not installed, skipping"
-               return 0
-       fi
-
        local TDIR=${1:-$DIR}
        local count=$DP_FNUM
 
        local MIN=$((count * 16))
        local TDIR=${1:-$DIR}
        local count=$DP_FNUM
 
        local MIN=$((count * 16))
-       [ $MDSSIZE -le $MIN ] && count=$((MDSSIZE / 16))
+       local mdssize=$(mdssize_from_index $TDIR 0)
+       [ $mdssize -le $MIN ] && count=$((mdssize / 16))
 
 
-       dp_run_cmd "./createmany -o $TDIR/file- $count | grep 'total:'"
+       dp_run_cmd "createmany -o $TDIR/file- $count | grep 'total:'"
        if [ ${PIPESTATUS[0]} != 0 ]; then
                error "File creation failed, aborting"
        fi
 
        if [ ${PIPESTATUS[0]} != 0 ]; then
                error "File creation failed, aborting"
        fi
 
-       if [ -f statmany ]; then
-               dp_run_cmd "./statmany -s $TDIR/file- $count $((count * 5)) |
-                       grep 'total:'"
-               if [ ${PIPESTATUS[0]} != 0 ]; then
-                       error "File stat failed, aborting"
-               fi
-
+       dp_run_cmd "statmany -s $TDIR/file- $count $((count * 5)) |
+               grep 'total:'"
+       if [ ${PIPESTATUS[0]} != 0 ]; then
+               error "File stat failed, aborting"
        fi
 
        for opc in w a r ; do
        fi
 
        for opc in w a r ; do
-               dp_run_cmd "./smalliomany -${opc} $TDIR/file- $count 300 |
+               dp_run_cmd "smalliomany -${opc} $TDIR/file- $count 300 |
                        grep 'total:'"
                if [ ${PIPESTATUS[0]} != 0 ]; then
                        error "SmallIO -${opc} failed, aborting"
                        grep 'total:'"
                if [ ${PIPESTATUS[0]} != 0 ]; then
                        error "SmallIO -${opc} failed, aborting"
@@ -206,7 +197,7 @@ run_SmallIO() {
 
        done
 
 
        done
 
-       dp_run_cmd "./unlinkmany $TDIR/file- $count | grep 'total:'"
+       dp_run_cmd "unlinkmany $TDIR/file- $count | grep 'total:'"
        if [ ${PIPESTATUS[0]} != 0 ]; then
                error "SmallIO failed, aborting"
        fi
        if [ ${PIPESTATUS[0]} != 0 ]; then
                error "SmallIO failed, aborting"
        fi
@@ -216,8 +207,7 @@ run_SmallIO() {
 
 run_IOR() {
        if ! which IOR > /dev/null 2>&1 ; then
 
 run_IOR() {
        if ! which IOR > /dev/null 2>&1 ; then
-               echo "IOR is not installed, skipping"
-               return 0
+               skip_env "IOR is not installed, skipping"
        fi
 
        local IOR=$(which IOR)
        fi
 
        local IOR=$(which IOR)
@@ -262,8 +252,7 @@ run_IOR() {
 
 run_Dbench() {
        if ! which dbench > /dev/null 2>&1 ; then
 
 run_Dbench() {
        if ! which dbench > /dev/null 2>&1 ; then
-               echo "Dbench is not installed, skipping"
-               return 0
+               skip_env "Dbench is not installed, skipping"
        fi
 
        local TDIR=${1:-$MOUNT}
        fi
 
        local TDIR=${1:-$MOUNT}
@@ -285,8 +274,7 @@ run_Dbench() {
 run_FIO() {
        # https://github.com/axboe/fio/archive/fio-2.8.zip
        if ! which fio > /dev/null 2>&1 ; then
 run_FIO() {
        # https://github.com/axboe/fio/archive/fio-2.8.zip
        if ! which fio > /dev/null 2>&1 ; then
-               echo "No FIO installed, skipping"
-               return 0
+               skip_env "No FIO installed, skipping"
        fi
 
        local fnum=128 # per thread
        fi
 
        local fnum=128 # per thread
@@ -357,14 +345,22 @@ run_FIO() {
 }
 
 run_compbench() {
 }
 
 run_compbench() {
-       if ! which compilebench > /dev/null 2>&1 ; then
-               echo "Compilebench is not installed, skipping"
-               return 0
+       local compilebench
+       if [ x$cbench_DIR = x ]; then
+               compilebench=$(which compilebench 2> /dev/null)
+       else
+               cd $cbench_DIR
+               [ -x compilebench ] ||
+                       skip_env "compilebench is missing in $cbench_DIR"
+               compilebench=compilebench
        fi
 
        fi
 
+       [ x$compilebench != x ] ||
+               skip_env "Compilebench is not installed, skipping"
+
        local TDIR=${1:-$MOUNT}
 
        local TDIR=${1:-$MOUNT}
 
-       dp_run_cmd "compilebench -D $TDIR -i 2 -r 2 --makej"
+       dp_run_cmd "$compilebench -D $TDIR -i 2 -r 2 --makej"
        if [ ${PIPESTATUS[0]} != 0 ]; then
                error "Compilebench failed, aborting"
        fi
        if [ ${PIPESTATUS[0]} != 0 ]; then
                error "Compilebench failed, aborting"
        fi
index b392017..0ff2a81 100755 (executable)
@@ -6616,6 +6616,16 @@ ostname_from_index() {
     echo ${uuid/_UUID/}
 }
 
     echo ${uuid/_UUID/}
 }
 
+mdtname_from_index() {
+       local uuid=$(mdtuuid_from_index $1)
+       echo ${uuid/_UUID/}
+}
+
+mdssize_from_index () {
+       local mdt=$(mdtname_from_index $2)
+       $LFS df $1 | grep $mdt | awk '{ print $2 }'
+}
+
 index_from_ostuuid()
 {
     $LFS osts $2 | sed -ne "/${1}/s/\(.*\): .* .*$/\1/p"
 index_from_ostuuid()
 {
     $LFS osts $2 | sed -ne "/${1}/s/\(.*\): .* .*$/\1/p"