diff options
author | Tim Chase <[email protected]> | 2018-04-07 23:10:22 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-04-13 18:04:10 -0700 |
commit | 4b0f5b2d7b99ca3ed9585173fe4b1c7fedda5aa5 (patch) | |
tree | b1e2cc85066691c324b2433cd0b819b7e6bc0cc4 | |
parent | 5c596ba7a47942f42aa7b67509cf28ebb878d058 (diff) |
Wait for resilver after online
This test performs a rapid offline/online cycle of each of several
mirror vdevs. It can run so quickly that there isn't sufficient pool
redundancy to perform an offline. The solution is to wait until the
pool is resilvered following the online operation.
Also, add a pool sync before the offline operation to help reduce
spurious errors.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Issue #6900
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh index 2fe679776..7ba301e2b 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_online/zpool_online_001_pos.ksh @@ -71,10 +71,13 @@ if [[ -z $DISKLIST ]]; then fi typeset -i i=0 +typeset -i j=0 for disk in $DISKLIST; do i=0 while [[ $i -lt ${#args[*]} ]]; do + + log_must sync_pool $TESTPOOL log_must zpool offline $TESTPOOL $disk check_state $TESTPOOL $disk "offline" if [[ $? != 0 ]]; then @@ -87,6 +90,14 @@ for disk in $DISKLIST; do log_fail "$disk of $TESTPOOL did not match online state" fi + while [[ $j -lt 20 ]]; do + is_pool_resilvered $TESTPOOL && break + sleep 0.5 + (( j = j + 1 )) + done + is_pool_resilvered $TESTPOOL || \ + log_file "Pool didn't resilver after online" + (( i = i + 1 )) done done |