Whamcloud - gitweb
EX-9802 test: refine sanity-compr.sh/test_0a
authorBobi Jam <bobijam@whamcloud.com>
Wed, 5 Jun 2024 15:33:09 +0000 (23:33 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 19 Jun 2024 22:33:56 +0000 (22:33 +0000)
Only change and verify compression types negotiation between client
and OST0000.

Test-Parameters: trivial testlist=sanity-compr env=ONLY=0a
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I307f3826973f48791b7fbf4cdfa121401b059b0e
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55356
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 7a71590..331ffc3 100644 (file)
@@ -42,43 +42,37 @@ $LFS setstripe $COMPR_EXTRA_LAYOUT $MOUNT
 ALWAYS_EXCEPT_SAVE=$ALWAYS_EXCEPT
 
 test_0a() {
+       local obd_str="obdfilter.*-OST0000"
+       local osc_str="osc.*-OST0000-osc-[^M][^D][^t]*"
        local types_save=($(do_facet ost1 \
-                           $LCTL get_param -n obdfilter.*.compress_types))
+                           $LCTL get_param -n ${obd_str}.compress_types))
 
        [[ -n "$types_save" ]] || skip "no OST support for compress_types"
        stack_trap "do_facet ost1 \
-                   $LCTL set_param obdfilter.*.compress_types='$types_save'"
+                   $LCTL set_param -n ${obd_str}.compress_types='$types_save' \
+                   && umount_client $MOUNT && mount_client $MOUNT"
 
-       echo " ** add lz4fast, delete lzo compression type on OST"
-       do_facet ost1 $LCTL set_param obdfilter.*.compress_types=+lz4fast-lzo
+       echo " ** add lz4fast, delete lzo compression type on OST0000"
+       do_facet ost1 $LCTL set_param -n ${obd_str}.compress_types=+lz4fast-lzo
 
        # remount client to get new compression types from OSS
        umount_client $MOUNT
        mount_client $MOUNT
 
-       local types=$($LCTL get_param -n osc.*.import | grep compress_types)
-       [[ -n "$types" ]] || {
-               do_facet ost1 $LCTL get_param obdfilter.*.compress_types
-               echo $types
+       local names=$($LCTL get_param -n $osc_str.import | grep name)
+       local types=$($LCTL get_param -n $osc_str.import | grep compress_types)
+       local obdtypes=$(do_facet ost1 $LCTL get_param $obd_str.compress_types)
+       echo " ** $obdtypes"
+       echo " ** $names"
+       echo " ** $types"
+       [[ -n "$types" ]] ||
                error "cannot find any compress support on client"
-       }
 
-       [[ "$types" =~ "lz4fast" ]] || {
-               do_facet ost1 $LCTL get_param obdfilter.*.compress_types
-               echo $types
+       [[ "$types" =~ "lz4fast" ]] ||
                error "cannot find lz4fast compress support on client"
-       }
 
-       [[ "$types" =~ "lzo" ]] && {
-               do_facet ost1 $LCTL get_param obdfilter.*.compress_types
-               echo $types
+       [[ ! "$types" =~ "lzo" ]] ||
                error "should not have lzo compress support on client"
-       }
-
-       do_facet ost1 $LCTL set_param obdfilter.*.compress_types='$types_save'
-       # need to remount to allow client to use all compression types
-       umount_client $MOUNT
-       mount_client $MOUNT
 }
 run_test 0a "compression types negotiation between client and OST"