From e1c216fb0c33209471b51f80ba3a1ce8910913c7 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 3 Oct 2019 09:39:13 -0700 Subject: ZTS: Fix upgrade_readonly_pool Update cleanup_upgrade to use destroy_dataset and destroy_pool when performing cleanup. These wrappers retry if the pool is busy preventing occasional failures like those observed when running tests upgrade_readonly_pool. For example: SUCCESS: test enabled == enabled User accounting upgrade is not executed on readonly pool NOTE: Performing local cleanup via log_onexit (cleanup_upgrade) cannot destroy 'testpool': pool is busy ERROR: zpool destroy testpool exited 1 Reviewed-by: Ryan Moeller Reviewed-by: John Kennedy Reviewed-by: Igor Kozhukhov Signed-off-by: Brian Behlendorf Closes #9400 --- tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib b/tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib index 679ff3049..6ffd85b5b 100644 --- a/tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib +++ b/tests/zfs-tests/tests/functional/upgrade/upgrade_common.kshlib @@ -34,8 +34,8 @@ export TMPDEV=$TEST_BASE_DIR/zpool_upgrade_test.dat function cleanup_upgrade { - datasetexists $TESTPOOL/fs1 && log_must zfs destroy $TESTPOOL/fs1 - datasetexists $TESTPOOL/fs2 && log_must zfs destroy $TESTPOOL/fs2 - datasetexists $TESTPOOL/fs3 && log_must zfs destroy $TESTPOOL/fs3 - datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL + destroy_dataset "$TESTPOOL/fs1" + destroy_dataset "$TESTPOOL/fs2" + destroy_dataset "$TESTPOOL/fs3" + destroy_pool "$TESTPOOL" } -- cgit v1.2.3