Whamcloud - gitweb
LU-13283 tests: add racer to nonmpi load 71/37671/5
authorElena Gryaznova <elena.gryaznova@hpe.com>
Fri, 21 Feb 2020 15:40:38 +0000 (18:40 +0300)
committerOleg Drokin <green@whamcloud.com>
Sun, 1 Mar 2020 05:37:55 +0000 (05:37 +0000)
Patch adds the ability to run racer as one of
nonmpi loads. All racer parameters can be set over
RACERP:
Example:
  RACERP="MDSCOUNT=3 DURATION=600 RACER_ENABLE_STRIPED_DIRS=false"
etc.

ha_start_mpi_loads() is improved to not create
machinefiles if no mpi load set.

Test-Parameters: trivial
Cray-bug-id: LUS-8297
Signed-off-by: Elena Gryaznova <elena.gryaznova@hpe.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Vladimir Saveliev <vladimir.saveliev@hpe.com>
Change-Id: I974838ce199897284396ef53d1a487d1a1ae1774
Reviewed-on: https://review.whamcloud.com/37671
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/ha.sh

index 370e1d7..05a9087 100755 (executable)
@@ -220,6 +220,8 @@ declare     ha_mpirun_options=${MPIRUN_OPTIONS:-""}
 declare     ha_clients_stripe=${CLIENTSSTRIPE:-'"$STRIPEPARAMS"'}
 declare     ha_nclientsset=${NCLIENTSSET:-1}
 
+declare     ha_racer_params=${RACERP:-"MDSCOUNT=1"}
+
 eval ha_params_ior=($ha_ior_params)
 eval ha_params_simul=($ha_simul_params)
 eval ha_params_mdtest=($ha_mdtest_params)
@@ -236,12 +238,15 @@ declare -A  ha_mpi_load_cmds=(
        [mdtest]="$MDTEST {params} -d {}"
 )
 
+declare racer=${RACER:-"$(dirname $0)/racer/racer.sh"}
+
 declare     ha_nonmpi_loads=${ha_nonmpi_loads="dd tar iozone"}
 declare -a  ha_nonmpi_load_tags=($ha_nonmpi_loads)
-declare -a  ha_nonmpi_load_cmds=(
-       "dd if=/dev/zero of={}/f.dd bs=1M count=256"
-       "tar cf - /etc | tar xf - -C {}"
-       "iozone -a -e -+d -s $iozone_SIZE {}/f.iozone"
+declare -A  ha_nonmpi_load_cmds=(
+       [dd]="dd if=/dev/zero of={}/f.dd bs=1M count=256"
+       [tar]="tar cf - /etc | tar xf - -C {}"
+       [iozone]="iozone -a -e -+d -s $iozone_SIZE {}/f.iozone"
+       [racer]="$ha_racer_params $racer {}"
 )
 
 ha_usage()
@@ -474,6 +479,19 @@ ha_start_mpi_loads()
        local m
        local -a mach
 
+       # ha_mpi_instances defines the number of
+       # clients start mpi loads; should be <= ${#ha_clients[@]}
+       # do nothing if
+       #    ha_mpi_instances = 0
+       # or
+       #    ${#ha_mpi_load_tags[@]} =0
+       local inst=$ha_mpi_instances
+       (( inst == 0 )) || (( ${#ha_mpi_load_tags[@]} == 0 )) &&
+               ha_info "no mpi load to start" &&
+               return 0
+
+       (( inst <= ${#ha_clients[@]} )) || inst=${#ha_clients[@]}
+
        # Define names for machinefiles for each client set
        for (( n=0; n < $ha_nclientsset; n++ )); do
                mach[$n]=$ha_machine_file$n
@@ -491,11 +509,6 @@ ha_start_mpi_loads()
                scp $ha_machine_file* $client:$dirname
        done
 
-       # ha_mpi_instances defines the number of
-       # clients start mpi loads; should be <= ${#ha_clients[@]}
-       local inst=$ha_mpi_instances
-       (( inst <= ${#ha_clients[@]} )) || inst=${#ha_clients[@]}
-
        for ((n = 0; n < $inst; n++)); do
                client=${ha_clients[n]}
                for ((load = 0; load < ${#ha_mpi_load_tags[@]}; load++)); do
@@ -524,7 +537,7 @@ ha_repeat_nonmpi_load()
        local load=$2
        local status=$3
        local tag=${ha_nonmpi_load_tags[$load]}
-       local cmd=${ha_nonmpi_load_cmds[$load]}
+       local cmd=${ha_nonmpi_load_cmds[$tag]}
        local dir=$ha_test_dir/$client-$tag
        local log=$ha_tmp_dir/$client-$tag
        local rc=0