From e715a8c2a616f6d4158decfed5dec2fa444f0c67 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sat, 13 Apr 2024 23:54:24 -0600 Subject: [PATCH] LU-16623 tests: ignore sanity-pfl 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. Test-Parameters: trivial testlist=sanity-flr Signed-off-by: Andreas Dilger Change-Id: Ie482fdf86f82e7a2292c021761885249a6c551f1 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54778 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/tests/sanity-flr.sh | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index 03558df..371cc2b 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -29,11 +29,11 @@ if [[ "$ost1_FSTYPE" == "zfs" ]]; then fi if [ -r /etc/redhat-release ]; then - rhel_version=$(cat /etc/redhat-release | - sed -e 's/^[^0-9.]*//g' | sed -e 's/[ ].*//') - if (( $(version_code $rhel_version) >= $(version_code 9.3.0) )); then - always_except LU-17675 61a - fi + rhel_version=$(cat /etc/redhat-release | + sed -e 's/^[^0-9.]*//g' | sed -e 's/[ ].*//') + if (( $(version_code $rhel_version) >= $(version_code 9.3.0) )); then + always_except LU-17675 61a + fi fi build_test_filter @@ -181,7 +181,9 @@ verify_comp_attr() { return } - [[ $value = $expected ]] || { + [[ $value = $expected ]] || + # file sometimes one stripe short if MDS-OST didn't precreate, LU-16623 + [[ $attr == "stripe-count" && $value == $((OSTCOUNT - 1)) ]] || { $getstripe_cmd $tf error "verify $attr failed on $tf: $value != $expected" } @@ -229,7 +231,9 @@ verify_comp_attr_with_parent() { value=$($tf_cmd $opt $tf) [[ $value = -1 ]] && value=$OSTCOUNT - [[ $value = $expected ]] || { + [[ $value = $expected ]] || + # file sometimes one stripe short if MDS-OST didn't precreate, LU-16623 + [[ $attr == "stripe-count" && $value == $((OSTCOUNT - 1)) ]] || { $td_cmd -d $td $tf_cmd -v $tf error "verify $attr failed with parent on $tf:" \ @@ -268,7 +272,9 @@ verify_comp_attr_with_default() { value=$($tf_cmd $opt $tf) [[ $value = -1 ]] && value=$OSTCOUNT - [[ $value = $expected ]] || { + [[ $value = $expected ]] || + # file sometimes one stripe short if MDS-OST didn't precreate, LU-16623 + [[ $attr == "stripe-count" && $value == $((OSTCOUNT - 1)) ]] || { $tf_cmd -v $tf error "verify $attr failed with default value on $tf:" \ "$value != $expected" @@ -4195,11 +4201,11 @@ function test_206() { run_test 206 "lfs setstripe -pool .. --comp-flags=.. " test_207() { - local file=$DIR/$tfile - local tmpfile=$DIR/$tfile-tt + local file=$DIR/$tfile + local tmpfile=$DIR/$tfile-tt - [ $MDS1_VERSION -lt $(version_code 2.14.50) ] && - skip "Need MDS version at least 2.14.50" + (( $MDS1_VERSION >= $(version_code v2_14_50-161-g571f3cf111) )) || + skip "Need MDS >= 2.14.50.161 for stale components fix" stack_trap "rm -f $tmpfile $file" -- 1.8.3.1