From ab4ede45b4c027aa69d64205d33e333b8283d95e Mon Sep 17 00:00:00 2001 From: Frederick Dilger Date: Thu, 13 Jun 2024 23:29:10 -0400 Subject: [PATCH] LU-17856 tests: ignore sanity stripe-count off-by-1 In some cases the MDS may not create all stripes on a file, if the MDT-OST connection does not have precreated objects. This is OK, so the tests should not fail the stripe-count check if trying to create a fully-striped file and one of the stripes is missing. parse_layout_param was modified to change the output value of stripe count to be $OSTCOUNT if the stripe_count=$OSTCOUNT - 1. Even if the stripe_count was meant to be $OSTCOUNT - 1 this shouldn't fail any tests as both tested values will be modified. Test-Parameters: trivial testlist=sanity env=ONLY=56xd-56xe,ONLY_REPEAT=100 Test-Parameters: trivial testlist=sanity env=ONLY=65n,ONLY_REPEAT=100 Test-Parameters: trivial testlist=sanity env=ONLY=184d,ONLY_REPEAT=100 Signed-off-by: Frederick Dilger Change-Id: Ie908a07d21b75e3ba60b7e6ca326675684ee2037 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55427 Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/tests/test-framework.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 94ed56f..6711d59 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -10551,7 +10551,8 @@ parse_plain_dir_param() local param="" if [[ ${invalues[0]} =~ "stripe_count:" ]]; then - param="-c ${invalues[1]}" + (( ${invalues[1]} == $OSTCOUNT - 1 )) && + param="-c $OSTCOUNT" || param="-c ${invalues[1]}" fi if [[ ${invalues[2]} =~ "stripe_size:" ]]; then param="$param -S ${invalues[3]}" @@ -10574,6 +10575,8 @@ parse_plain_param() local val=$(awk '{print $2}' <<< $line) if [[ $line =~ ^"lmm_stripe_count:" ]]; then + (( $val == $OSTCOUNT - 1 )) && + param="-c $OSTCOUNT" || param="-c $val" echo "-c $val" elif [[ $line =~ ^"lmm_stripe_size:" ]]; then echo "-S $val" -- 1.8.3.1