diff options
author | Giuseppe Di Natale <[email protected]> | 2017-04-18 09:45:45 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-04-18 09:45:45 -0700 |
commit | f995e5ec43aa25c3e131e431606d141e121786f0 (patch) | |
tree | bd8b3754098c2d7eb58531eb62efbfb1702fe34e /tests/zfs-tests | |
parent | 6faad211e348e565a2725278cf5edb7fec7eaf4b (diff) |
Clean up correctly in zpool_scrub_004_pos
Ensure `zinject -c` all gets called whenever
zpool_scrub_004_pos exits.
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Giuseppe Di Natale <[email protected]>
Issue #5444
Closes #6021
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh index b2cb8893a..fabe27626 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_004_pos.ksh @@ -46,6 +46,11 @@ # resilver does not complete before the scrub can be issued. This # can occur when testing with small pools or very fast hardware. +function cleanup +{ + log_must zinject -c all +} + verify_runnable "global" # See issue: https://github.com/zfsonlinux/zfs/issues/5444 @@ -53,6 +58,8 @@ if is_32bit; then log_unsupported "Test case fails on 32-bit systems" fi +log_onexit cleanup + log_assert "Resilver prevent scrub from starting until the resilver completes" log_must zpool detach $TESTPOOL $DISK2 @@ -66,5 +73,4 @@ while ! is_pool_resilvered $TESTPOOL; do sleep 1 done -log_must zinject -c all log_pass "Resilver prevent scrub from starting until the resilver completes" |