diff options
author | Brian Behlendorf <[email protected]> | 2019-09-25 09:24:45 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-25 09:24:45 -0700 |
commit | 5e5cefbaee494c4e347216aafb945cc358f224ac (patch) | |
tree | 99688e604e3930aaf77ae90a294cbbe4b01ecef7 | |
parent | f81d5ef686e8198c38caa8622905647667165622 (diff) |
ZTS: harden xattr/cleanup.ksh
When the xattr/cleanup.ksh script is unable to remove the test group
due to an active process then it will not call default_cleanup. This
will result in a zvol_ENOSPC/setup failure when attempting to create
the /mnt/testdir directory which will already exist.
Resolve the issue by performing the default_cleanup before removing
the test user and group to ensure this step always happens. Also
allow one more retry to further minimize the likelihood of the
cleanup failing.
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #9358
-rw-r--r-- | tests/zfs-tests/include/libtest.shlib | 2 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/xattr/cleanup.ksh | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index 776c953b1..c0fbde433 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -2375,7 +2375,7 @@ function del_user #<logname> <basedir> fi if id $user > /dev/null 2>&1; then - log_must_retry "currently used" 5 userdel $user + log_must_retry "currently used" 6 userdel $user fi [[ -d $basedir/$user ]] && rm -fr $basedir/$user diff --git a/tests/zfs-tests/tests/functional/xattr/cleanup.ksh b/tests/zfs-tests/tests/functional/xattr/cleanup.ksh index 509090619..b3629629c 100755 --- a/tests/zfs-tests/tests/functional/xattr/cleanup.ksh +++ b/tests/zfs-tests/tests/functional/xattr/cleanup.ksh @@ -30,9 +30,6 @@ . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/xattr/xattr_common.kshlib -del_user $ZFS_USER -del_group $ZFS_GROUP - USES_NIS=$(cat $TEST_BASE_DIR/zfs-xattr-test-nis.txt) rm $TEST_BASE_DIR/zfs-xattr-test-nis.txt @@ -41,4 +38,9 @@ then svcadm enable svc:/network/nis/client:default fi -default_cleanup +default_cleanup_noexit + +del_user $ZFS_USER +del_group $ZFS_GROUP + +log_pass |