diff --git a/tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib b/tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib index 2b5a28b0620..ae8a4b2a648 100644 --- a/tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib +++ b/tests/zfs-tests/tests/functional/redundancy/redundancy.kshlib @@ -435,32 +435,38 @@ function verify_draid_pool log_note "verify_draid_pool $pool $replace_mode" log_must zpool scrub -w $pool + sync_pool $pool true - typeset -i cksum=$(cksum_pool $pool) + typeset status=$(zpool status -p $pool) + typeset -i cksum=$(echo "$status" | awk ' + !NF { isvdev = 0 } + isvdev { errors += $NF } + /CKSUM$/ { isvdev = 1 } + END { print errors }') if [[ "$replace_mode" = "healing" ]]; then if [[ $cksum -gt 0 ]]; then - log_must zpool status -v $pool + log_note "$status" log_fail "Unexpected CKSUM errors found for $pool ($cksum)" fi if ! check_pool_status $pool "scan" "repaired 0B"; then - log_must zpool status -v $pool + log_note "$status" log_fail "Unexpected repair IO found for $pool ($cksum)" fi elif [[ "$replace_mode" = "sequential" ]]; then if [[ $cksum -gt 0 ]]; then - log_must zpool status -v $pool + log_note "$status" log_fail "Unexpected CKSUM errors found for $pool ($cksum)" fi elif [[ "$replace_mode" = "damaged" ]]; then if [[ $cksum -lt 1 ]]; then - log_must zpool status -v $pool + log_note "$status" log_fail "Expected CKSUM errors missing for $pool ($cksum)" fi if check_pool_status $pool "scan" "repaired 0B"; then - log_must zpool status -v $pool + log_note "$status" log_fail "Expected repair IO missing for $pool ($cksum)" fi else @@ -468,12 +474,12 @@ function verify_draid_pool fi if ! check_pool_status $pool "scan" "with 0 errors"; then - log_must zpool status -v $pool + log_note "$status" log_fail "Unexpected repair errors found for $pool" fi if ! check_pool_status $pool "errors" "No known data errors"; then - log_must zpool status -v $pool + log_note "$status" log_fail "Unexpected data errors found for $pool" fi }