From 395a6b19d35c97d14d9a3a009433a727a5f59e41 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Wed, 29 Jan 2020 14:24:18 -0500 Subject: [PATCH] ZTS: Simplify zero_partitions on FreeBSD We can avoid a great deal of `sleep 3` by simply destroying the whole partition table in one shot with gpart. Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #9908 --- tests/zfs-tests/include/libtest.shlib | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index 9c089990b2..4ad3ee9bf6 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -879,7 +879,9 @@ function zero_partitions # typeset diskname=$1 typeset i - if is_linux; then + if is_freebsd; then + gpart destroy -F $diskname + elif is_linux; then DSK=$DEV_DSKDIR/$diskname DSK=$(echo $DSK | sed -e "s|//|/|g") log_must parted $DSK -s -- mklabel gpt