From fac01bb26c5a7854eb0c30b3b3f304ff691a1508 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Tue, 19 Mar 2024 13:08:05 -0400 Subject: [PATCH] BRT: Check pool stats in more tests This should allow to catch some leaks, if those happen. Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. --- .../tests/functional/bclone/bclone_corner_cases.kshlib | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib b/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib index ddfbfc999c4e..fe7739e921a9 100644 --- a/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib +++ b/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib @@ -210,6 +210,8 @@ function bclone_corner_cases_test typeset -r dstdir=$2 typeset limit=$3 typeset -i count=0 + typeset oused + typeset osaved if [[ $srcdir != "count" ]]; then if [[ -n "$limit" ]]; then @@ -217,6 +219,11 @@ function bclone_corner_cases_test limit=$(random_int_between 1 $total_count $((limit*2)) | sort -nu | head -n $limit | xargs) fi bclone_corner_cases_init $srcdir $dstdir + + # Save current block cloning stats for later use. + sync_pool $TESTPOOL + oused=$(get_pool_prop bcloneused $TESTPOOL) + osaved=$(get_pool_prop bclonesaved $TESTPOOL) fi # @@ -300,6 +307,9 @@ function bclone_corner_cases_test fi rm -f "$CLONE" + sync_pool $TESTPOOL + verify_pool_prop_eq bcloneused $oused + verify_pool_prop_eq bclonesaved $osaved done done done