HomeFreeBSD

ZTS: Standardize use of destroy_dataset in cleanup

Description

ZTS: Standardize use of destroy_dataset in cleanup

When cleaning up a test case standardize on using the convention:

    datasetexists $ds && destroy_dataset $ds <flags>

By using 'destroy_dataset' instead of 'log_must zfs destroy' we ensure
that the destroy is retried in the event that a ZFS volume is busy.
This helps ensures ensure tests are fully cleaned up and prevents false
positive test failures on Linux.

Note that all of the tests which used 'zfs destroy' in cleanup have
been updated even if they don't use volumes. This was done to
clearly establish the expected convention.

Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12663

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Oct 25 2021, 9:13 PM
GitHub <noreply@github.com>Committed on Oct 25 2021, 9:13 PM
Parents
rG731fbb5d22a6: Workaround cloud-init hotplug issue
Branches
Unknown
Tags
Unknown