From a94860a6dee1c07bb96ee36dafcba40b804560cc Mon Sep 17 00:00:00 2001 From: Tony Hutter Date: Mon, 20 Nov 2023 16:07:32 -0800 Subject: [PATCH] ZTS: Fix 'could not unmount datasets' on Alma 9 (#15542) Many tests are failing on AlmaLinux 9 because ZTS could not destroy the pool in cleanup. This was due to $PWD being set to '.' instead of the expected full path. This patch sets $PWD to the full path. Signed-off-by: Tony Hutter Reviewed-by: Don Brady --- tests/zfs-tests/include/libtest.shlib | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index d5d7bb6c83..b4d2b91dd4 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -37,6 +37,12 @@ . ${STF_SUITE}/include/math.shlib . ${STF_SUITE}/include/blkdev.shlib +# On AlmaLinux 9 we will see $PWD = '.' instead of the full path. This causes +# some tests to fail. Fix it up here. +if [ "$PWD" = "." ] ; then + PWD="$(readlink -f $PWD)" +fi + # # Apply constrained path when available. This is required since the # PATH may have been modified by sudo's secure_path behavior.