Skip to content

Commit

Permalink
Add failure diagnostic output in fault/auto_spare_001_pos
Browse files Browse the repository at this point in the history
Signed-off-by: Don Brady <dev.fs.zfs@gmail.com>
  • Loading branch information
don-brady committed Jan 17, 2024
1 parent ea98ab7 commit 5369043
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/zfs-tests/tests/functional/fault/auto_spare_001_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,17 @@

verify_runnable "both"

PASSED="/$TESTPOOL/$TESTFS/passed"

function cleanup
{
# if something failed log additional info
if [[ -e "/$TESTPOOL" && ! -e "$PASSED" ]]; then
log_note "$(zpool status $TESTPOOL)"
echo "==================== zed log search ===================="
grep "Diagnosis Engine" $ZEDLET_DIR/zed.log
fi

log_must zinject -c all
destroy_pool $TESTPOOL
rm -f $VDEV_FILES $SPARE_FILE
Expand All @@ -56,6 +65,8 @@ zed_events_drain
TESTFILE="/$TESTPOOL/$TESTFS/testfile"

for type in "mirror" "raidz" "raidz2" "draid:1s"; do
log_must rm -f $PASSED

if [ "$type" = "draid:1s" ]; then
# 1. Create a dRAID pool with a distributed hot spare
#
Expand Down Expand Up @@ -111,6 +122,8 @@ for type in "mirror" "raidz" "raidz2" "draid:1s"; do
log_must is_pool_resilvered $TESTPOOL
log_must check_state $TESTPOOL "" "ONLINE"

log_must touch $PASSED

cleanup
done

Expand Down

0 comments on commit 5369043

Please sign in to comment.