aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBrian Behlendorf <behlendorf1@llnl.gov>2018-05-15 08:58:46 -0700
committerGitHub <noreply@github.com>2018-05-15 08:58:46 -0700
commitab6a2b5cd7ff867e63b03ca6c021d72d9b6be817 (patch)
tree557a35c89a661b43bd2ae3bc56e403be4961defe /tests
parent8c64fe04421664fbf908bbe928e14e2dfeadb058 (diff)
ZTS: Improve zpool_scrub_004_pos reliability
It's possible for the `zpool attach` portion of this test case to complete before the `zpool scrub` can be issued. Update the test case to force the resilvering phase to take longer. Reviewed-by: Tim Chase <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #5444 Closes #7541
Diffstat (limited to 'tests')
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh
index 4d29e78bc..14563d64d 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh
@@ -39,7 +39,9 @@
# STRATEGY:
# 1. Setup a mirror pool and filled with data.
# 2. Detach one of devices
-# 3. Verify scrub failed until the resilver completed
+# 3. Create a file for the resilver to work on so it takes some time
+# 4. Export/import the pool to ensure the cache is dropped
+# 5. Verify scrub failed until the resilver completed
#
# NOTES:
# Artificially limit the scrub speed by setting the zfs_scan_vdev_limit
@@ -49,22 +51,26 @@
function cleanup
{
log_must set_tunable64 zfs_scan_vdev_limit $ZFS_SCAN_VDEV_LIMIT_DEFAULT
+ rm -f $mntpnt/extra
}
verify_runnable "global"
-# See issue: https://github.com/zfsonlinux/zfs/issues/5444
-if is_32bit; then
- log_unsupported "Test case fails on 32-bit systems"
-fi
-
log_onexit cleanup
log_assert "Resilver prevent scrub from starting until the resilver completes"
+mntpnt=$(get_prop mountpoint $TESTPOOL/$TESTFS)
log_must set_tunable64 zfs_scan_vdev_limit $ZFS_SCAN_VDEV_LIMIT_SLOW
-log_must zpool detach $TESTPOOL $DISK2
-log_must zpool attach $TESTPOOL $DISK1 $DISK2
+
+while ! is_pool_resilvering $TESTPOOL; do
+ log_must zpool detach $TESTPOOL $DISK2
+ log_must file_write -b 1048576 -c 128 -o create -d 0 -f $mntpnt/extra
+ log_must zpool export $TESTPOOL
+ log_must zpool import $TESTPOOL
+ log_must zpool attach $TESTPOOL $DISK1 $DISK2
+done
+
log_must is_pool_resilvering $TESTPOOL
log_mustnot zpool scrub $TESTPOOL