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
Tony Hutter <hutter2@llnl.gov>Committed on Nov 2 2021, 4:51 PM
Parents
rG55ab3773d796: Workaround cloud-init hotplug issue
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rGaf9aa4a2166e: ZTS: Standardize use of destroy_dataset in cleanup (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Nov 2 2021, 4:51 PM