9166 zfs storage pool checkpoint
[unleashed.git] / usr / src / test / zfs-tests / tests / functional / pool_checkpoint / checkpoint_sm_scale.ksh
blob29ffcd2a310c5b945c6998cfa5c310e23d53ae81
1 #!/usr/bin/ksh -p
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
7 # 1.0 of the CDDL.
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
21 # DESCRIPTION:
22 # The maximum address that can be described by the current space
23 # map design (assuming the minimum 512-byte addressable storage)
24 # limits the maximum allocatable space of any top-level vdev to
25 # 64PB whenever a vdev-wide space map is used.
27 # Since a vdev-wide space map is introduced for the checkpoint
28 # we want to ensure that we cannot checkpoint a pool that has a
29 # top-level vdev with more than 64PB of allocatable space.
31 # Note: Since this is a pool created from file-based vdevs we
32 # are guaranteed that vdev_ashift is SPA_MINBLOCKSHIFT
33 # [which is currently 9 and (1 << 9) = 512], so the numbers
34 # work out for this test.
36 # STRATEGY:
37 # 1. Create pool with a disk of exactly 64PB
38 # (so ~63.5PB of allocatable space)
39 # 2. Ensure that you can checkpoint it
40 # 3. Create pool with a disk of exactly 65PB
41 # (so ~64.5PB of allocatable space)
42 # 4. Ensure we fail trying to checkpoint it
45 verify_runnable "global"
47 TESTPOOL1=testpool1
48 TESTPOOL2=testpool2
50 DISK64PB=/$DISKFS/disk64PB
51 DISK65PB=/$DISKFS/disk65PB
53 function test_cleanup
55 poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
56 poolexists $TESTPOOL2 && destroy_pool $TESTPOOL2
57 log_must rm -f $DISK64PB $DISK65PB
58 cleanup_test_pool
61 setup_test_pool
62 log_onexit test_cleanup
64 log_must zfs create $DISKFS
65 log_must mkfile -n $((64 * 1024 * 1024))g $DISK64PB
66 log_must mkfile -n $((65 * 1024 * 1024))g $DISK65PB
68 log_must zpool create $TESTPOOL1 $DISK64PB
69 log_must zpool create $TESTPOOL2 $DISK65PB
71 log_must zpool checkpoint $TESTPOOL1
72 log_mustnot zpool checkpoint $TESTPOOL2
74 log_pass "Attempting to checkpoint a pool with a vdev that's more than 64PB."