Whamcloud - gitweb
LU-14585 tests: use striped ha_test_dir 16/43216/2
authorElena Gryaznova <elena.gryaznova@hpe.com>
Tue, 6 Apr 2021 07:13:41 +0000 (10:13 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Apr 2021 06:30:55 +0000 (06:30 +0000)
currently ha.sh has the ability to create the clients
striped directories with different stripe parameters.
We also need the ability to create working striped
directory (ha_test_dir) to have the chance to replicate
the issues hit on directory tree where child directory
stripe settings differ from parent ones.

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

index d18a26b..b7ada94 100755 (executable)
@@ -197,6 +197,9 @@ declare     ha_pm_host=${PM_HOST:-$(hostname)}
 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_test_dir_stripe_count=${TDSTRIPECOUNT:-"1"}
+declare     ha_test_dir_mdt_index=${TDMDTINDEX:-"0"}
+declare     ha_test_dir_mdt_index_random=${TDMDTINDEXRAND:-false}
 declare     ha_dir_stripe_count=${DSTRIPECOUNT:-"1"}
 declare     ha_mdt_index=${MDTINDEX:-"0"}
 declare     ha_mdt_index_random=${MDTINDEXRAND:-false}
 declare     ha_dir_stripe_count=${DSTRIPECOUNT:-"1"}
 declare     ha_mdt_index=${MDTINDEX:-"0"}
 declare     ha_mdt_index_random=${MDTINDEXRAND:-false}
@@ -1092,7 +1095,17 @@ ha_main()
                "START: $0: $(date +%H:%M:%S' '%s)"
        trap ha_trap_exit EXIT
        mkdir "$ha_tmp_dir"
                "START: $0: $(date +%H:%M:%S' '%s)"
        trap ha_trap_exit EXIT
        mkdir "$ha_tmp_dir"
-       ha_on ${ha_clients[0]} mkdir "$ha_test_dir"
+
+       local mdt_index
+       if $ha_test_dir_mdt_index_random &&
+               [ $ha_test_dir_mdt_index -ne 0 ]; then
+               mdt_index=$(ha_rand $ha_test_dir_mdt_index)
+       else
+               mdt_index=$ha_test_dir_mdt_index
+       fi
+       ha_on ${ha_clients[0]} "$LFS mkdir -i$mdt_index \
+               -c$ha_test_dir_stripe_count $ha_test_dir"
+       ha_on ${ha_clients[0]} $LFS getdirstripe $ha_test_dir
        ha_on ${ha_clients[0]} " \
                $LFS setstripe $ha_stripe_params $ha_test_dir"
 
        ha_on ${ha_clients[0]} " \
                $LFS setstripe $ha_stripe_params $ha_test_dir"