Skip to content

Commit

Permalink
ZTS: Fix zpool_status_-s
Browse files Browse the repository at this point in the history
After commit 5e74ac5 which split and reordered the run files the
`zpool_status_-s` test began failing.  The new ordering placed
the test after a previous test which used `zpool replace` to replace
a disk but did not clear its label.  This resulted in the next test,
`zpool_status_-s`, failing because of the potentially active
pool being detected on the replaced vdev.

    /dev/loop0 is part of potentially active pool 'testpool'

Use the default_mirror_setup_noexit() and default_cleanup_noexit()
functions to create the pool in `zpool_status_-s`.  They use the -f
flag by default.

In the `scrub_after_resilver` test wipe the label during cleanup
to prevent future failures if the tests are again reordered.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#9451
  • Loading branch information
behlendorf authored and tonyhutter committed Dec 27, 2019
1 parent 08410c2 commit 5d5faa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function cleanup
# Restore our zed.rc
log_must zed_rc_restore $zedrc_backup
default_cleanup_noexit
log_must zpool labelclear -f $DISK1
}

log_onexit cleanup
Expand Down
4 changes: 2 additions & 2 deletions tests/zfs-tests/tests/functional/fault/zpool_status_-s.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ DISK=${DISKS%% *}

verify_runnable "both"

log_must zpool create $TESTPOOL mirror ${DISKS}
default_mirror_setup_noexit $DISKS

function cleanup
{
log_must zinject -c all
log_must set_tunable64 zio_slow_io_ms $OLD_SLOW_IO
log_must set_tunable64 zfs_slow_io_events_per_second $OLD_SLOW_IO_EVENTS
log_must destroy_pool $TESTPOOL
default_cleanup_noexit
}

log_onexit cleanup
Expand Down

0 comments on commit 5d5faa3

Please sign in to comment.