Skip to content

Commit

Permalink
ZTS: Count CKSUM for all vdevs in verify_pool
Browse files Browse the repository at this point in the history
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 openzfs#10271
  • Loading branch information
Ryan Moeller authored and jsai20 committed Mar 30, 2021
1 parent 231d57b commit ffeff2a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/zfs-tests/include/libtest.shlib
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit ffeff2a

Please sign in to comment.