From cbeeb4afb35ecd77e70f5019ac4f3f0f88fb8df6 Mon Sep 17 00:00:00 2001 From: Prakash Surya Date: Wed, 11 Jan 2017 16:36:58 -0800 Subject: [PATCH] OpenZFS 7761 - bootfs_005_neg's pool destruction must handle EBUSY Authored by: Prakash Surya Reviewed by: Yuri Pankov Reviewed by: John Kennedy Reviewed by: Matt Ahrens Approved by: Robert Mustacchi Reviewed-by: Brian Behlendorf Reviewed-by: Giuseppe Di Natale Ported-by: George Melikov OpenZFS-issue: https://www.illumos.org/issues/7761 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ad309d3 Closes #5818 --- .../tests/functional/bootfs/bootfs_005_neg.ksh | 10 +++------- .../cli_root/zpool_upgrade/zpool_upgrade.kshlib | 6 ++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh b/tests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh index f09b32d2b..82932a7dc 100755 --- a/tests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh +++ b/tests/zfs-tests/tests/functional/bootfs/bootfs_005_neg.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2012, 2015 by Delphix. All rights reserved. +# Copyright (c) 2012, 2017 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -53,14 +53,10 @@ function cleanup { typeset pool_name for config in $CONFIGS; do pool_name=$(eval $ECHO \$ZPOOL_VERSION_${config}_NAME) - if poolexists $pool_name; then - log_must $ZPOOL destroy $pool_name - fi + destroy_pool $pool_name done - if poolexists $TESTPOOL ; then - log_must $ZPOOL destroy $TESTPOOL - fi + destroy_pool $TESTPOOL } log_assert "Boot properties cannot be set on pools with older versions" diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib index d2d0eafe2..0252cac70 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib @@ -25,7 +25,7 @@ # # -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2012, 2017 by Delphix. All rights reserved. # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # @@ -93,9 +93,7 @@ function destroy_upgraded_pool typeset -n pool_files=ZPOOL_VERSION_${vers}_FILES typeset -n pool_name=ZPOOL_VERSION_${vers}_NAME - if poolexists $pool_name; then - log_must $ZPOOL destroy $pool_name - fi + destroy_pool $pool_name for file in $pool_files; do $RM -f /$TESTPOOL/$file done