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) 2018 Lawrence Livermore National Security, LLC.
16 # Copyright (c) 2018 by Nutanix. All rights reserved.
19 . $STF_SUITE/include/libtest.shlib
20 . $STF_SUITE/tests/functional/mmp/mmp.cfg
21 . $STF_SUITE/tests/functional/mmp/mmp.kshlib
25 # zdb will work while multihost is enabled.
30 # 3. Run zdb -d with pool and dataset arguments.
31 # 4. Create a checkpoint
32 # 5. Run zdb -kd with pool and dataset arguments.
33 # 6. Discard the checkpoint
35 # 8. Run zdb -ed with pool and dataset arguments.
40 datasetexists $TESTPOOL && destroy_pool $TESTPOOL
41 for DISK in $DISKS; do
42 zpool labelclear -f $DEV_RDSKDIR/$DISK
44 log_must mmp_clear_hostid
47 log_assert "Verify zdb -d works while multihost is enabled"
50 verify_runnable "global"
51 verify_disk_count "$DISKS" 2
53 default_mirror_setup_noexit $DISKS
54 log_must mmp_set_hostid $HOSTID1
55 log_must zpool set multihost=on $TESTPOOL
56 log_must zfs snap $TESTPOOL/$TESTFS@snap
58 log_must zdb -d $TESTPOOL
59 log_must zdb -d $TESTPOOL/
60 log_must zdb -d $TESTPOOL/$TESTFS
61 log_must zdb -d $TESTPOOL/$TESTFS@snap
63 log_must zpool checkpoint $TESTPOOL
64 log_must zdb -kd $TESTPOOL
65 log_must zdb -kd $TESTPOOL/
66 log_must zdb -kd $TESTPOOL/$TESTFS
67 log_must zdb -kd $TESTPOOL/$TESTFS@snap
68 log_must zpool checkpoint -d $TESTPOOL
70 log_must zpool export $TESTPOOL
72 log_must zdb -ed $TESTPOOL
73 log_must zdb -ed $TESTPOOL/
74 log_must zdb -ed $TESTPOOL/$TESTFS
75 log_must zdb -ed $TESTPOOL/$TESTFS@snap
77 log_must zpool import $TESTPOOL
81 log_pass "zdb -d works while multihost is enabled"