From: Artem Blagodarenko Date: Wed, 12 Jun 2024 13:54:18 +0000 (+0100) Subject: EX-9889 csdc: migrate to another compression level X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5cc56c9533c97de72e263db0e8a59fa8fc030e5d;p=fs%2Flustre-release.git EX-9889 csdc: migrate to another compression level Here is a test there lfs migrate with changed compression level. Test-Parameters: trivial env=ONLY=1030 testlist=sanity-compr Signed-off-by: Artem Blagodarenko Change-Id: Ia67316a247fed99f6ad002c8b67053a3c2fa0cff Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55407 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Colin Faber Reviewed-by: Andreas Dilger --- diff --git a/lustre/tests/sanity-compr.sh b/lustre/tests/sanity-compr.sh index 17d8d1d..06c6ea0 100644 --- a/lustre/tests/sanity-compr.sh +++ b/lustre/tests/sanity-compr.sh @@ -1532,6 +1532,49 @@ test_1021() { } run_test 1021 "change file compressibiblity" +test_1030() { + (( MDS1_VERSION >= $(version_code 2.14.0-ddn153) )) || + skip "Need MDS version at least 2.14.0-ddn153" + + test_mkdir -p $DIR/$tdir + local tf=$DIR/$tdir/$tfile + local hdf=$LUSTRE/tests/AMSR_E_L3_DailyOcean_V05_20111003.hdf + local tmp_hdf=$TMP/$tfile.hdf + local size1 + local size2 + + if [[ ! -f $tmp_hdf ]]; then + if [[ -f $hdf.bz2 ]] && type -p bzcat >/dev/null; then + bzcat $hdf.bz2 > $tmp_hdf + elif [[ -f $hdf.bz2 ]] && type -p bunzip2 >/dev/null; then + cp $hdf.bz2 $tmp_hdf.bz2 || error "cp $tmp_hdf.bz2" + bunzip2 $tmp_hdf.bz2 || error "bunzip2 $tmp_hdf.bz2" + else + skip_env "bunzip2 is not installed" + fi + fi + + stack_trap "rm -f $tf" + compression_enabled || skip "compression is disabled ($(uname -a))" + + $LFS setstripe -E-1 -c1 -Z lz4fast:3 --compress-chunk=64 $tf || + error "set a compress component in $tf failed" + + cp $tmp_hdf $tf + sync ; sync + size1=$(du -sk $tf | awk '{print $1}') + echo "compressed size with lz4fast:3: $size1" + + $LFS migrate -E eof -Z lz4:6 $tf || error "migrate failed" + sync ; sync + size2=$(du -sk $tf | awk '{print $1}') + echo "compressed size with lz4:6: $size2" + + (( $size2 < $size1 )) || + error "lz4:6 ($size2) should be less than lz4:3 ($size1)" +} +run_test 1030 "Migrate to another compression level" + test_1080() { (( MDS1_VERSION >= $(version_code 2.14.0-ddn128) )) || skip "Need MDS version at least 2.14.0-ddn128"