Whamcloud - gitweb
LU-15022 revert: "LU-14997 tests: Register stack_trap for sanity/104c" 08/45008/3
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 21 Sep 2021 22:58:30 +0000 (22:58 +0000)
committerOleg Drokin <green@whamcloud.com>
Wed, 22 Sep 2021 03:12:49 +0000 (03:12 +0000)
This reverts commit 59b32113313c3566e5f3797bca404a5b19d5e305
since it caused constant test failures for ZFS backends.

Change-Id: I195cc483166294dbf97be50a9b747c8a2b534799
Test-Parameters: trivial fstype=zfs testlist=sanity env=ONLY=104,ONLY_REPEAT=20
Reviewed-on: https://review.whamcloud.com/45008
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 112b8bb..3a9f141 100755 (executable)
@@ -11304,17 +11304,6 @@ test_104b() {
 }
 run_test 104b "$RUNAS lfs check servers test ===================="
 
-cleanup_104c() {
-       local facets=$1
-       local param=$2
-       local saved_blocks=$3
-
-       for facet in ${facets//,/ }; do
-               osd=$(do_facet $facet $LCTL get_param -n $param.mntdev)
-               do_facet $facet zfs set recordsize=$saved_blocks $osd
-       done
-}
-
 #
 # Verify $1 is within range of $2.
 # Success when $1 is within range. That is, when $1 is >= 2% of $2 and
@@ -11322,8 +11311,8 @@ cleanup_104c() {
 #
 value_in_range() {
        # Strip all units (M, G, T)
-       actual=$(echo ${1/[a-zA-Z]*/})
-       expect=$(echo ${2/[a-zA-Z]*/})
+       actual=$(echo $1 | tr -d A-Z)
+       expect=$(echo $2 | tr -d A-Z)
 
        expect_lo=$(($expect * 98 / 100)) # 2% below
        expect_hi=$(($expect * 102 / 100)) # 2% above
@@ -11372,11 +11361,6 @@ test_104c() {
                do_facet $facet zfs set recordsize=32768 $mdt
        done
 
-       # Restore OST recordize back to original
-       stack_trap "cleanup_104c $ofacets $ost_param $saved_ost_blocks"
-       # Restore MDT recordize back to original
-       stack_trap "cleanup_104c $mfacets $mdt_param $saved_mdt_blocks"
-
        # Give new values chance to reflect change
        sleep 2
 
@@ -11404,6 +11388,18 @@ test_104c() {
        value_in_range ${df_after[3]%.*} ${df[3]%.*} ||
                error "df avail: ${df_after[3]%.*} != ${df[3]%.*}"
 
+       # Restore MDT recordize back to original
+       for facet in ${mfacets//,/ }; do
+               mdt=$(do_facet $facet lctl get_param -n $mdt_param.mntdev)
+               do_facet $facet zfs set recordsize=$saved_mdt_blocks $mdt
+       done
+
+       # Restore OST recordize back to original
+       for facet in ${ofacets//,/ }; do
+               ost=$(do_facet $facet lctl get_param -n $ost_param.mntdev)
+               do_facet $facet zfs set recordsize=$saved_ost_blocks $ost
+       done
+
        return 0
 }
 run_test 104c "Verify df vs lfs_df stays same after recordsize change"