Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
function zpool_export_cleanup
{
[[ -d $TESTDIR0 ]] && log_must rm -rf $TESTDIR0
default_cleanup
default_cleanup_noexit
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
Loading