From c58ce2c18590c8fe378c7902303e8d036d41bfe4 Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Tue, 6 Apr 2021 10:13:41 +0300 Subject: [PATCH] LU-14585 tests: use striped ha_test_dir 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 HPE-bug-id: LUS-9621 Reviewed-by: Alexander Boyko Reviewed-by: Vladimir Saveliev Change-Id: I77612c360f0bf407bd0298f827b409b4a288540f Reviewed-on: https://review.whamcloud.com/43216 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Vladimir Saveliev Reviewed-by: Oleg Drokin --- lustre/tests/ha.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lustre/tests/ha.sh b/lustre/tests/ha.sh index d18a26b..b7ada94 100755 --- a/lustre/tests/ha.sh +++ b/lustre/tests/ha.sh @@ -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_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} @@ -1092,7 +1095,17 @@ ha_main() "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" -- 1.8.3.1