From 86f7ab1aeb3e18aa12b364066ebbe43f8fdc8ded Mon Sep 17 00:00:00 2001 From: Alena Nikitenko Date: Tue, 28 Dec 2021 20:26:53 +0300 Subject: [PATCH] EX-3342 tests: fix Lustre ver in skip checks in sanity-flr Many patches land to the EXAScaler branches as ports from other branches. Sometimes the tests that are included with the ported patches check the version of Lustre to ensure that the feature it tests exists in this version of Lustre. These version values are not always changed when patches are ported from one branch to another. Sanity-flr tests 0b, 0h, 37 were modified. Performing test steps on versions >= 2.12.56 or between versions 2.12.2 and 2.12.50 makes no sense for b_es5_2 branch, because all Lustre tags on this branch are lower than 2.12.50. Similar checks happen in all three of the modified tests. Checks in tests 0b and 0h will be changed to >= 2.12.3.1 which is a tag for the patches that added these tests to this branch. Test 37 check doesn't need elif statement, because original test excludes versions between 2.12.50 and 2.12.52, which doesn't make sense for b_es5_2 branch. It will be replaced with else statement. Fixes: 3a8d96a1ebf ("LU-11022 lfs: remove mirror by pool name") Fixes: 79346930b34 ("LU-11485 lod: disallow setting the last non-stale mirror as stale") Fixes: 24f181513fb ("LU-10258 lfs: lfs mirror copy command") Lustre-change: https://review.whamcloud.com/45949 Lustre-commit: 896b18bf3dd169641147ad382314f86d482ad670 Test-Parameters: env=ONLY="0b 0h 37" serverversion=2.10.8 \ serverdistro=el7.6 testlist=sanity-flr Test-Parameters: trivial env=ONLY="0b 0h 37" testlist=sanity-flr Signed-off-by: Alena Nikitenko Change-Id: Ie417f72b7ccafff600a762f78f5c2c1605e00221 Reviewed-on: https://review.whamcloud.com/45949 Reviewed-by: James Nunez Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/46414 Tested-by: jenkins Tested-by: Maloo --- lustre/tests/sanity-flr.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index da20bf6..09d6d6e 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -328,7 +328,7 @@ test_0b() { verify_comp_attr stripe-count $tf ${ids[5]} $OSTCOUNT verify_comp_attr_with_parent pool $tf ${ids[5]} - if [ $MDS1_VERSION -ge $(version_code 2.12.55) ]; then + if [[ $MDS1_VERSION -ge $(version_code 2.12.3.1) ]]; then # LU-11022 - remove mirror by pool name local=cnt cnt=$($LFS getstripe $tf | grep archive | wc -l) [ "$cnt" != "1" ] && error "unexpected mirror count $cnt" @@ -703,7 +703,7 @@ test_0h() { error "error clearing prefer flag from component 0x20003" # MDS disallows setting stale flag on the last non-stale mirror - [[ "$MDS1_VERSION" -ge $(version_code 2.12.57) ]] || return 0 + [[ $MDS1_VERSION -ge $(version_code 2.12.3.1) ]] || return 0 cp /etc/hosts $tf || error "error writing file '$tf'" @@ -1563,8 +1563,19 @@ test_37() local osts=$(comma_list $(osts_nodes)) - $LFS mirror copy -i ${mirror_array[0]} -o-1 $tf || - error "mirror copy error" + if [[ $MDS1_VERSION -lt $(version_code 2.12.3) ]]; then + # define OBD_FAIL_OST_SKIP_LV_CHECK 0x241 + do_nodes $osts lctl set_param fail_loc=0x241 + + mirror_io copy -i ${mirror_array[0]} \ + -t $(echo ${mirror_array[@]:1} | tr ' ' ',') $tf || + error "mirror copy error" + + do_nodes $osts lctl set_param fail_loc=0 + else + $LFS mirror copy -i ${mirror_array[0]} -o-1 $tf || + error "mirror copy error" + fi # verify copying is successful by checking checksums remount_client $MOUNT -- 1.8.3.1