From 6a25950e72962f9e8def71504c4a43a13baa87d0 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 7 May 2026 15:57:07 -0700 Subject: [PATCH] ZTS: redundancy_draid_spare1 Preserve the 'zpool status' output used to calculate the number of checksum errors so it can be logged on failure. Several instances have been observed in the CI where cksum was set to a non-zero value, yet a subsequent run of 'zpool status' on failure showed no checksum errors. Reviewed-by: Tony Hutter Signed-off-by: Brian Behlendorf Closes #18500 --- .../functional/redundancy/redundancy.kshlib | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) 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 }