Skip to content

Commit

Permalink
BRT: Check pool stats in more tests
Browse files Browse the repository at this point in the history
This should allow to catch some leaks, if those happen.

Signed-off-by:  Alexander Motin <[email protected]>
Sponsored by:   iXsystems, Inc.
  • Loading branch information
amotin committed Mar 19, 2024
1 parent ff7b70f commit fac01bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,20 @@ 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
typeset -r total_count=$(bclone_corner_cases_test count)
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

#
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fac01bb

Please sign in to comment.