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 <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #9908
This commit is contained in:
Ryan Moeller 2020-01-29 14:24:18 -05:00 committed by GitHub
parent 74b4d349b3
commit 395a6b19d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -879,7 +879,9 @@ function zero_partitions #<whole_disk_name>
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