Whamcloud - gitweb
EX-9125 tests: change source dir for sanity-compr/1008
authorJian Yu <yujian@whamcloud.com>
Thu, 6 Jun 2024 07:34:00 +0000 (00:34 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 7 Jun 2024 07:27:17 +0000 (07:27 +0000)
While the source directory contains almost all small files,
sanity-compr test_1008 will hit the
"failed estimates > 50% of total estimates" failure on SLES15.

The patch fixes the issue by changing the source dir to
contain large files.

Test-Parameters: trivial clientdistro=sles15sp5 \
  testlist=sanity-compr env=ONLY="1008",ONLY_REPEAT=3

Test-Parameters: trivial clientdistro=el9.3 \
  testlist=sanity-compr env=ONLY="1008",ONLY_REPEAT=3

Test-Parameters: trivial clientdistro=el8.8 \
  testlist=sanity-compr env=ONLY="1008",ONLY_REPEAT=3

Change-Id: Iad661750cba7c9d2204f2306e73169deb012ddf4
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55334
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-compr.sh

index 1fb6e0b..66399be 100644 (file)
@@ -1141,9 +1141,27 @@ test_1008() {
        local failed_margin=50
 
        local td=$DIR/$tdir
-       local source="/etc/ /bin/"
+       local source=$TMP/$tdir
+       local hdf=$LUSTRE/tests/AMSR_E_L3_DailyOcean_V05_20111003.hdf
+       local tmp_hdf=$source/$tfile.hdf
+
+       mkdir -p $source || error "mkdir -p $source failed"
+
+       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
+
+       cp -a $tmp_hdf{,.bak} || error "copy $tmp_hdf failed"
+       cp -a /etc $source || error "copy /etc failed"
+       # Sync to disk and drop cache
+       sync; echo 3 > /proc/sys/vm/drop_caches
 
-       stack_trap "rm -rf $td"
+       stack_trap "rm -rf $td $TMP/$tdir"
        compression_enabled || skip "compression is disabled ($(uname -a))"
 
        for compr_type in ${compr_types[@]}; do