ZTS: Count CKSUM for all vdevs in verify_pool

The verify_pool function should detect checksum errors on any vdev, but
it was only checking at the root of the pool.

Accumulate the errors for all vdevs to obtain the correct count.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10271
This commit is contained in:
Ryan Moeller 2020-04-30 20:50:16 -04:00 committed by GitHub
parent 154e48eac9
commit 6ed4391da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2029,7 +2029,12 @@ function verify_pool
log_must zpool scrub $pool
log_must wait_scrubbed $pool
cksum=$(zpool status $pool | awk 'L{print $NF;L=0} /CKSUM$/{L=1}')
typeset -i cksum=$(zpool status $pool | awk '
!NF { isvdev = 0 }
isvdev { errors += $NF }
/CKSUM$/ { isvdev = 1 }
END { print errors }
')
if [[ $cksum != 0 ]]; then
log_must zpool status -v
log_fail "Unexpected CKSUM errors found on $pool ($cksum)"