From e73d334266dfd3a991e7e734f78b13c9b350e3fa Mon Sep 17 00:00:00 2001 From: Alexandre Ioffe Date: Fri, 19 Jul 2024 16:43:01 -0700 Subject: [PATCH] LU-17685 tests: skip nocompr test for older versions nocompr flag in lfs mirror extend is supported after MDS version v2_15_61-245-g37e1316050 Fixes: 37e1316050 ("LU-17685 utils: Allow nocompr flag in lfs mirror extend") Test-Parameters: trivial testlist=sanity-flr env=ONLY="205a 205b" Test-Parameters: trivial testlist=sanity-flr env=ONLY="205a 205b" Test-Parameters: trivial testlist=sanity-flr env=ONLY="205a 205b" Signed-off-by: Alexandre Ioffe Change-Id: I5c23e549893b9f6dbc016b79d4a6601a8320bf94 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55816 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Vitaliy Kuznetsov Reviewed-by: Colin Faber Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/sanity-flr.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index 04317ca..160d0a2 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -4143,7 +4143,7 @@ test_204f() { } run_test 204f "FLR write/stale/resync sel w/forced extension" -function test_205() { +function test_205a() { local tf=$DIR/$tfile local mirrors @@ -4158,22 +4158,39 @@ function test_205() { $($LFS getstripe $tf | grep lcme_flags: | tail -1 | grep -q prefer) || error "prefer flag was not set on the new mirror" +} +run_test 205a "lfs mirror extend to set prefer flag" + +function test_205b() { + if (( MDS1_VERSION <= $(version_code v2_15_61-245-g37e1316050) )) ; then + skip "Need MDS > v2_15_61-245-g37e1316050 to test nocompr flag" + fi + + local tf=$DIR/$tfile + local mirrors + + $LFS setstripe -c1 $tf || + error "$LFS setstripe -c $tf failed" + + $LFS mirror extend -N --flags=nocompr $tf || + error "$LFS mirror extend -N --flags=nocompr $tf failed" - $LFS mirror extend -N --flags=nocompr $tf mirrors=$($LFS getstripe $tf | grep lcme_mirror_id | wc -l ) - (( $mirrors == 4 )) || error "no new mirror with nocompr flag was created?" + (( $mirrors == 2 )) || error "no new mirror with nocompr flag was created?" $($LFS getstripe $tf | grep lcme_flags: | tail -1 | grep -q nocompr) || error "nocompr flag was not set on the new mirror" - $LFS mirror extend -N --flags=prefer,nocompr $tf + $LFS mirror extend -N --flags=prefer,nocompr $tf || + error "$LFS mirror extend -N --flags=prefer,nocompr $tf failed" mirrors=$($LFS getstripe $tf | grep lcme_mirror_id | wc -l ) - (( $mirrors == 5 )) || error "no new mirror with prefer,nocompr flags was created?" + + (( $mirrors == 3 )) || error "no new mirror with prefer,nocompr flags was created?" $($LFS getstripe $tf | grep lcme_flags: | tail -1 | grep -q "prefer,nocompr") || error "prefer,nocompr flags were not set on the new mirror" } -run_test 205 "lfs mirror extend to set prefer and nocompr flags" +run_test 205b "lfs mirror extend to set nocompr flag" function test_206() { # create a new OST pool -- 1.8.3.1