Skip to content

Commit

Permalink
ZTS: zfs_mount_all_fail leaves /var/tmp/testrootPIDNUM directory around
Browse files Browse the repository at this point in the history
Before we can remove test files, we need to unmount datasets
used by test first.

See also: zfs_mount_all_mountpoints.ksh

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Toomas Soome <[email protected]>
Closes #16914
  • Loading branch information
tsoome authored Jan 2, 2025
1 parent 3c2267a commit 8dc15ef
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#
# Copyright (c) 2017 by Delphix. All rights reserved.
# Copyright 2024 MNX Cloud, Inc.
#

. $STF_SUITE/include/libtest.shlib
Expand Down Expand Up @@ -44,8 +45,9 @@ typeset fscount=10
function setup_all
{
# Create $fscount filesystems at the top level of $path
for ((i=0; i<$fscount; i++)); do
for ((i=0; i<fscount; i++)); do
setup_filesystem "$DISKS" "$TESTPOOL" $i "$path/$i" ctr
filesystems+=($i)
done

zfs list -r $TESTPOOL
Expand All @@ -58,6 +60,12 @@ function cleanup_all
export __ZFS_POOL_RESTRICT="$TESTPOOL"
log_must zfs $unmountall
unset __ZFS_POOL_RESTRICT
# make sure we leave $TESTPOOL mounted
log_must zfs mount $TESTPOOL

for fs in ${filesystems[@]}; do
cleanup_filesystem "$TESTPOOL" "$fs"
done

[[ -d ${TEST_BASE_DIR%%/}/testroot$$ ]] && \
rm -rf ${TEST_BASE_DIR%%/}/testroot$$
Expand All @@ -76,7 +84,7 @@ log_must zfs $unmountall
unset __ZFS_POOL_RESTRICT

# All of our filesystems should be unmounted at this point
for ((i=0; i<$fscount; i++)); do
for ((i=0; i<fscount; i++)); do
log_mustnot mounted "$TESTPOOL/$i"
done

Expand All @@ -98,7 +106,7 @@ log_mustnot mounted "$TESTPOOL/0"
unset __ZFS_POOL_RESTRICT

# All other filesystems should be mounted
for ((i=1; i<$fscount; i++)); do
for ((i=1; i<fscount; i++)); do
log_must mounted "$TESTPOOL/$i"
done

Expand Down

0 comments on commit 8dc15ef

Please sign in to comment.