Whamcloud - gitweb
EX-9482 tests: skip sanity-pfl tests if no compression
authorAndreas Dilger <adilger@whamcloud.com>
Sun, 14 Apr 2024 07:07:21 +0000 (01:07 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 15 Apr 2024 09:53:05 +0000 (09:53 +0000)
Skip sanity-pfl test_100* for servers that do not understand CSDC.

Test-Parameters: trivial
Test-Parameters: testlist=sanity-pfl
Test-Parameters: testlist=sanity-pfl serverjob=lustre-master serverbuildno=4521 serverdistro=el8.9
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib3fcfd77e9e7ffb122ed6ade9015b02d42ea8319
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54781
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
lustre/tests/sanity-pfl.sh

index 985880e..c3fe357 100644 (file)
@@ -2545,13 +2545,12 @@ export LFS_SETSTRIPE_COMPR_OK="yes"
 test_100a() {
        (( $MDS1_VERSION >= $(version_code 2.14.0.92) )) ||
                skip "Need MDS >= 2.14.0.92 for compression support"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
 
        local tf=$DIR/$tdir/$tfile
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
 
        test_mkdir $DIR/$tdir
-       save_lustre_params client "llite.*.enable_compression" > $p
-       stack_trap "restore_lustre_params < $p" EXIT
 
        $LCTL set_param llite.*.enable_compression=1
 
@@ -2573,6 +2572,7 @@ run_test 100a "set stripe component with nocompr"
 test_100b() {
        (( $MDS1_VERSION >= $(version_code 2.14.0.92) )) ||
                skip "Need MDS >= 2.14.0.92 for compression support"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
 
        local tf=$DIR/$tdir/$tfile
        # putting lz4 twice:
@@ -2585,9 +2585,7 @@ test_100b() {
        local c1="64"
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
 
-       save_lustre_params client "llite.*.enable_compression" > $p
-       stack_trap "rm -rf $DIR/$tdir; restore_lustre_params < $p" EXIT
-       $LCTL set_param llite.*.enable_compression=1
+       stack_trap "rm -rf $DIR/$tdir"
 
        test_mkdir $DIR/$tdir
 
@@ -2661,14 +2659,13 @@ run_test 100b "create with compress component"
 test_100c() {
        (( $MDS1_VERSION >= $(version_code 2.14.0.92) )) ||
                skip "Need MDS >= 2.14.0.92 for compression support"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
 
        local tf=$DIR/$tdir/$tfile
        local d1=$DIR/$tdir/dir-1
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
 
-       save_lustre_params client "llite.*.enable_compression" > $p
-       stack_trap "rm -rf $DIR/$tdir; restore_lustre_params < $p" EXIT
-       $LCTL set_param llite.*.enable_compression=1
+       stack_trap "rm -rf $DIR/$tdir"
 
        test_mkdir $DIR/$tdir
 
@@ -2754,6 +2751,7 @@ run_test 100c "create compress file with improper compress arguments"
 test_100d() {
        (( $MDS1_VERSION >= $(version_code 2.14.0.92) )) ||
                skip "Need MDS >= 2.14.0.92 for compression support"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
 
        local tf=$DIR/$tdir/$tfile
        # putting lz4 twice:
@@ -2769,9 +2767,7 @@ test_100d() {
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
        local expect
 
-       save_lustre_params client "llite.*.enable_compression" > $p
-       stack_trap "rm -rf $DIR/$tdir; restore_lustre_params < $p" EXIT
-       $LCTL set_param llite.*.enable_compression=1
+       stack_trap "rm -rf $DIR/$tdir"
 
        test_mkdir $DIR/$tdir
        $LFS setstripe -c-1 $DIR/$tdir ||
@@ -2906,12 +2902,13 @@ run_test 100d "lfs find compress component"
 test_100e() {
        (( $MDS1_VERSION >= $(version_code 2.14.0.92) )) ||
                skip "Need MDS >= 2.14.0.92 for compression support"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
 
        local tf=$DIR/$tdir/$tfile
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
 
-       save_lustre_params client "llite.*.enable_compression" > $p
-       stack_trap "rm -rf $DIR/$tdir; restore_lustre_params < $p" EXIT
+       stack_trap "rm -rf $DIR/$tdir"
+       stack_trap "$LCTL set_param llite.*.enable_compression=1"
        $LCTL set_param llite.*.enable_compression=0
 
        test_mkdir $DIR/$tdir
@@ -2929,13 +2926,12 @@ run_test 100e "don't set compress file with llite.*.enable_compression=0"
 test_100f() {
        (( $MDS1_VERSION >= $(version_code 2.14.0.91) )) ||
                skip "Need MDS >= 2.14.0.91 for compression support"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
 
        local tf=$DIR/$tdir/$tfile
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
 
-       save_lustre_params client "llite.*.enable_compression" > $p
-       stack_trap "rm -rf $DIR/$tdir; restore_lustre_params < $p" EXIT
-       $LCTL set_param llite.*.enable_compression=1
+       stack_trap "rm -rf $DIR/$tdir"
 
        test_mkdir $DIR/$tdir
        $LFS setstripe -E1M -Z gzip:1 -E4M -E6M -Z none -Eeof -Z gzip:4 $tf ||
@@ -2974,6 +2970,7 @@ run_test 100f "lfs find -printf %LZ support"
 test_100j() {
        (( $MDS1_VERSION >= $(version_code 2.14.0.92) )) ||
                skip "Need MDS >= 2.14.0.92 for compression support"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
 
        local tf=$DIR/$tdir/$tfile
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
@@ -2981,8 +2978,6 @@ test_100j() {
        local tmp_hdf_128k=$TMP/$tfile.128k
        local hdf=$LUSTRE/tests/AMSR_E_L3_DailyOcean_V05_20111003.hdf
 
-       export LFS_SETSTRIPE_COMPR_OK="yes"
-
        [[ -s $hdf.bz2 ]] || skip_env "HDF file not present"
 
        if type -p bzcat >/dev/null; then
@@ -2995,10 +2990,6 @@ test_100j() {
        fi
 
        test_mkdir $DIR/$tdir
-       save_lustre_params client "llite.*.enable_compression" > $p
-
-       $LCTL set_param llite.*.enable_compression=1
-       stack_trap "restore_lustre_params < $p; rm -f $p" EXIT
 
        $LFS setstripe -E eof -Z lz4 $tf || error "setstripe lz4 failed"
        $LFS getstripe $tf
@@ -3017,13 +3008,12 @@ run_test 100j "basic debug test for compression"
 test_100k() {
        (( $MDS1_VERSION >= $(version_code 2.14.0.92) )) ||
                skip "Need MDS >= 2.14.0.92 for compression support"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
 
        local tf=$DIR/$tdir/$tfile
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
 
-       save_lustre_params client "llite.*.enable_compression" > $p
-       stack_trap "rm -rf $DIR/$tdir; restore_lustre_params < $p" EXIT
-       $LCTL set_param llite.*.enable_compression=1
+       stack_trap "rm -rf $DIR/$tdir"
 
        test_mkdir $DIR/$tdir
 
@@ -3041,15 +3031,14 @@ run_test 100k "create with DoM compression component"
 test_100l() {
        (( $MDS1_VERSION >= $(version_code 2.14.0.91) )) ||
                skip "Need MDS >= 2.14.0.91 for compression support"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
 
        local tf=$DIR/$tdir/$tfile
        local tf2=$DIR/$tdir/${tfile}_compr
        local flags
        local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
 
-       save_lustre_params client "llite.*.enable_compression" > $p
-       stack_trap "rm -rf $DIR/$tdir; restore_lustre_params < $p" EXIT
-       $LCTL set_param llite.*.enable_compression=1
+       stack_trap "rm -rf $DIR/$tdir"
 
        test_mkdir $DIR/$tdir