2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright (c) 2014, 2016 by Delphix. All rights reserved.
16 # testfile The file to examine.
17 # hole_blks The expected number of holes.
18 # data_blks The expected number of data blocks.
19 function verify_holes_and_data_blocks
22 typeset -i hole_blks=$2
23 typeset -i data_blks=$3
26 found_hole_blks=$(getholes -h $testfile)
27 found_data_blks=$(getholes -d $testfile)
28 if [[ $found_hole_blks -ne $hole_blks ]] then;
29 log_note "Found $found_hole_blks, not $hole_blks hole blocks."
33 if [[ $found_data_blks -ne $data_blks ]] then;
34 log_note "Found $found_data_blks, not $data_blks data blocks."
38 [[ $failures -eq 0 ]] || log_fail "Wrong number of data/hole blocks."