Whamcloud - gitweb
LU-11497 tests: improve ha.sh to set striped dirs 40/33340/3
authorElena Gryaznova <c17455@cray.com>
Wed, 10 Oct 2018 16:10:34 +0000 (19:10 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 21 Nov 2018 04:05:43 +0000 (04:05 +0000)
For DNE II testing we need the possibility to create
the striped directories, like it is done in t-f:test_mkdir().
This patch covers the following settings:
-c stripe_count -i mdt_index
-c stripe_count -i <random mdt_index>,
which allows to have the clients work directories with
the same stripe_count but different mdt indexes.

Test-Parameters:trivial
Signed-off-by: Elena Gryaznova <c17455@cray.com>
Cray-bug-id: LUS-5974
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Reviewed-by: Alexander Boyko <c17825@cray.com>
Change-Id: I6117601e741a95059750149d1c38b402fccb29b7
Reviewed-on: https://review.whamcloud.com/33340
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/ha.sh

index 6f7cb19..713811b 100755 (executable)
@@ -180,6 +180,9 @@ declare     ha_power_delay=${POWER_DELAY:-60}
 declare     ha_failback_delay=${DELAY:-5}
 declare     ha_failback_cmd=${FAILBACK:-""}
 declare     ha_stripe_params=${STRIPEPARAMS:-"-c 0"}
 declare     ha_failback_delay=${DELAY:-5}
 declare     ha_failback_cmd=${FAILBACK:-""}
 declare     ha_stripe_params=${STRIPEPARAMS:-"-c 0"}
+declare     ha_dir_stripe_count=${DSTRIPECOUNT:-"1"}
+declare     ha_mdt_index=${MDTINDEX:-"0"}
+declare     ha_mdt_index_random=${MDTINDEXRAND:-false}
 declare -a  ha_clients
 declare -a  ha_servers
 declare -a  ha_victims
 declare -a  ha_clients
 declare -a  ha_servers
 declare -a  ha_victims
@@ -394,7 +397,14 @@ ha_repeat_mpi_load()
        local machines="-machinefile $ha_machine_file"
        while [ ! -e "$ha_stop_file" ] && ((rc == 0)); do
                {
        local machines="-machinefile $ha_machine_file"
        while [ ! -e "$ha_stop_file" ] && ((rc == 0)); do
                {
-               ha_on $client mkdir -p "$dir" &&
+               local mdt_index
+               if $ha_mdt_index_random && [ $ha_mdt_index -ne 0 ]; then
+                       mdt_index=$(ha_rand $ha_mdt_index)
+               else
+                       mdt_index=$ha_mdt_index
+               fi
+               ha_on $client $LFS mkdir -i$mdt_index -c$ha_dir_stripe_count "$dir" &&
+               ha_on $client $LFS getdirstripe "$dir" &&
                ha_on $client chmod a+xwr $dir &&
                ha_on $client "su mpiuser sh -c \" $mpirun $ha_mpirun_options \
                        -np $((${#ha_clients[@]} * mpi_threads_per_client )) \
                ha_on $client chmod a+xwr $dir &&
                ha_on $client "su mpiuser sh -c \" $mpirun $ha_mpirun_options \
                        -np $((${#ha_clients[@]} * mpi_threads_per_client )) \