]> granicus.if.org Git - zfs/commitdiff
ZTS: harden xattr/cleanup.ksh
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 25 Sep 2019 16:24:45 +0000 (09:24 -0700)
committerGitHub <noreply@github.com>
Wed, 25 Sep 2019 16:24:45 +0000 (09:24 -0700)
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 <ryan@ixsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9358

tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/xattr/cleanup.ksh

index 776c953b1b52474ea2a150b84e6659d603f2daf6..c0fbde4339cd08d197f1f530c5b3a3a6d6413775 100644 (file)
@@ -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
index 5090906199ceb49cedef714fb2c067e7373fd3b5..b3629629c78c4bf0650a4a1a25cdbb0acc7e5eec 100755 (executable)
@@ -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