Skip to content

Commit e6597bb

Browse files
committed
ZTS: Fix 'could not unmount datasets' on Alma 9
Many tests are failing on AlmaLinux 9 because ZTS could not destroy the pool in cleanup. This was due to the test running within the mounted dataset directory (/var/tmp/testdir). If you change to a different directory before doing the zpool destroy the failure goes away. Signed-off-by: Tony Hutter <[email protected]>
1 parent cd67bc0 commit e6597bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/zfs-tests/include/libtest.shlib

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,13 @@ function destroy_pool #pool
15691569
# to destroy a pool to fail with EBUSY. We retry a few
15701570
# times allowing failures before requiring the destroy
15711571
# to succeed.
1572+
#
1573+
# Also, sometimes we're in the directory we're trying
1574+
# to unmount so 'cd' to / when we're doing a destroy.
1575+
OLDPWD="$PWD"
1576+
cd /
15721577
log_must_busy zpool destroy -f $pool
1578+
cd "$OLDPWD"
15731579

15741580
[[ -d $mtpt ]] && \
15751581
log_must rm -rf $mtpt

0 commit comments

Comments
 (0)