Skip to content

Commit

Permalink
ZTS: Cleanup partition tables
Browse files Browse the repository at this point in the history
The cleanup_devices function should remove any partitions created
on the device and force the partition table to be reread.  This
is needed to ensure that blkid has an up to date version of what
devices and partitions are used by zfs.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
  • Loading branch information
behlendorf committed Jan 4, 2020
1 parent 665684d commit 5dbdc21
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/zfs-tests/include/libtest.shlib
Original file line number Diff line number Diff line change
Expand Up @@ -2301,10 +2301,11 @@ function cleanup_devices #vdevs
{
typeset pool="foopool$$"

if poolexists $pool ; then
destroy_pool $pool
fi
for vdev in $@; do
zero_partitions $vdev
done

poolexists $pool && destroy_pool $pool
create_pool $pool $@
destroy_pool $pool

Expand Down

0 comments on commit 5dbdc21

Please sign in to comment.