diff options
author | Ryan Moeller <[email protected]> | 2020-04-30 20:50:16 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-30 17:50:16 -0700 |
commit | 6ed4391da97a1d183dbabcbe667026deb6678612 (patch) | |
tree | 56edb8b9347e26ff6d2c3c37ccd17a646c565094 | |
parent | 154e48eac904dc8e4d46c8f74f0ce50dd0e94697 (diff) |
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #10271
-rw-r--r-- | tests/zfs-tests/include/libtest.shlib | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index f917c5812..9fbcc37c6 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -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)" |