From ac68c305748b8b120de2309d27cc401b1346bd19 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Wed, 5 Jun 2024 23:33:09 +0800 Subject: [PATCH] EX-9802 test: refine sanity-compr.sh/test_0a 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 Change-Id: I307f3826973f48791b7fbf4cdfa121401b059b0e Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55356 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/tests/sanity-compr.sh | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/lustre/tests/sanity-compr.sh b/lustre/tests/sanity-compr.sh index 7a71590..331ffc3 100644 --- a/lustre/tests/sanity-compr.sh +++ b/lustre/tests/sanity-compr.sh @@ -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" -- 1.8.3.1