4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright (c) 2017 by Delphix. All rights reserved.
18 .
$STF_SUITE/tests
/functional
/pool_checkpoint
/pool_checkpoint.kshlib
22 # Attempt to take a checkpoint while a removal is
23 # in progress. The attempt should fail.
26 # 1. Create pool with one disk
27 # 2. Create a big file in the pool, so when the disk
28 # is later removed, it will give us enough of a
29 # time window to attempt the checkpoint while the
31 # 3. Add a second disk where all the data will be moved
32 # to when the first disk will be removed.
33 # 4. Start removal of first disk
34 # 5. Attempt to checkpoint (attempt should fail)
37 verify_runnable
"global"
41 log_mustnot zpool checkpoint
$TESTPOOL
49 log_onexit cleanup_test_pool
53 # Create big empty file and do some writes at random
54 # offsets to ensure that it takes up space. Note that
55 # the implcitly created filesystem ($FS0) does not
56 # have compression enabled.
58 log_must mkfile
$BIGFILESIZE $FS0FILE
59 log_must randwritecomp
$FS0FILE 1000
64 log_must zpool add
$TESTPOOL $EXTRATESTDISK
67 # Remove disk and attempt to take checkpoint
69 log_must attempt_during_removal
$TESTPOOL $TESTDISK callback
70 log_must zpool status
$TESTPOOL
72 log_pass
"Attempting to checkpoint during removal fails as expected."