From d0eb4a44a005577d82c42537e1d471c4b65c4510 Mon Sep 17 00:00:00 2001 From: JT Pennington Date: Tue, 18 Nov 2025 18:54:21 +0000 Subject: [PATCH 1/2] ZTS: Fix zpool_export.kshlib to prevent failing tests from passing Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: JT Pennington --- .../tests/functional/cli_root/zpool_export/zpool_export.kshlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib index c574c34aff09..ab824d797b34 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export.kshlib @@ -29,5 +29,5 @@ function zpool_export_cleanup { [[ -d $TESTDIR0 ]] && log_must rm -rf $TESTDIR0 - default_cleanup + default_cleanup_noexit } From bc2a5a6c02d91112019b6233e52dcd2e58ae6caf Mon Sep 17 00:00:00 2001 From: JT Pennington Date: Tue, 18 Nov 2025 18:55:10 +0000 Subject: [PATCH 2/2] ZTS: Fix zpool_export_002_pos.ksh Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: JT Pennington --- .../zpool_export/zpool_export_002_pos.ksh | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh index 5f5376a09113..c56f92b99043 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_002_pos.ksh @@ -38,8 +38,9 @@ # busy i.e. mounted. # # STRATEGY: -# 1. Try and export the default pool when mounted and busy. -# 2. Verify an error is returned. +# 1. Create a pool and filesystem for testing. +# 2. Try and export the pool when mounted and busy. +# 3. Verify an error is returned. # verify_runnable "global" @@ -56,6 +57,26 @@ log_onexit cleanup log_assert "Verify a busy ZPOOL cannot be exported." +# Set up the pool and filesystem manually +DISK=${DISKS%% *} + +# Clean up any existing pool +if poolexists $TESTPOOL ; then + destroy_pool $TESTPOOL +fi +[[ -d /$TESTPOOL ]] && rm -rf /$TESTPOOL + +# Create the pool +log_must zpool create -f $TESTPOOL $DISK + +# Create test directory +rm -rf $TESTDIR || log_unresolved "Could not remove $TESTDIR" +mkdir -p $TESTDIR || log_unresolved "Could not create $TESTDIR" + +# Create filesystem with mountpoint +log_must zfs create $TESTPOOL/$TESTFS +log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS + log_must ismounted "$TESTPOOL/$TESTFS" log_must cd $TESTDIR log_mustnot zpool export $TESTPOOL