aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/tests/zfs-tests/include/libtest.shlib
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/openzfs/tests/zfs-tests/include/libtest.shlib')
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/include/libtest.shlib15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/contrib/openzfs/tests/zfs-tests/include/libtest.shlib b/sys/contrib/openzfs/tests/zfs-tests/include/libtest.shlib
index 3d697726a763..23460d66590a 100644
--- a/sys/contrib/openzfs/tests/zfs-tests/include/libtest.shlib
+++ b/sys/contrib/openzfs/tests/zfs-tests/include/libtest.shlib
@@ -3139,6 +3139,21 @@ function wait_scrubbed #pool timeout
done
}
+# Wait for a pool to be resilvered
+#
+# $1 pool name
+# $2 timeout
+#
+function wait_resilvered #pool timeout
+{
+ typeset timeout=${2:-300}
+ typeset pool=${1:-$TESTPOOL}
+ for (( timer = 0; timer < $timeout; timer++ )); do
+ is_pool_resilvered $pool && break;
+ sleep 1;
+ done
+}
+
# Backup the zed.rc in our test directory so that we can edit it for our test.
#
# Returns: Backup file name. You will need to pass this to zed_rc_restore().