diff options
Diffstat (limited to 'tests/zfs-tests/include/libtest.shlib')
-rw-r--r-- | tests/zfs-tests/include/libtest.shlib | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index 07cf9a1e6..aafc47b2b 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -1825,6 +1825,29 @@ function snapshot_mountpoint } # +# Given a device and 'ashift' value verify it's correctly set on every label +# +function verify_ashift # device ashift +{ + typeset device="$1" + typeset ashift="$2" + + zdb -e -lll $device | awk -v ashift=$ashift '/ashift: / { + if (ashift != $2) + exit 1; + else + count++; + } END { + if (count != 4) + exit 1; + else + exit 0; + }' + + return $? +} + +# # Given a pool and file system, this function will verify the file system # using the zdb internal tool. Note that the pool is exported and imported # to ensure it has consistent state. @@ -3220,6 +3243,21 @@ function wait_freeing #pool } # +# Wait for every device replace operation to complete +# +# $1 pool name +# +function wait_replacing #pool +{ + typeset pool=${1:-$TESTPOOL} + while true; do + [[ "" == "$(zpool status $pool | + awk '/replacing-[0-9]+/ {print $1}')" ]] && break + log_must sleep 1 + done +} + +# # Check if ZED is currently running, if not start ZED. # function zed_start |