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 Lawrence Livermore National Security, LLC.
18 .
$STF_SUITE/include
/libtest.shlib
22 # zdb will not produce redundant dumps of configurations
25 # 1. Create a pool with two vdevs
26 # 2. Copy label 1 from the first vdev to the second vdev
27 # 3. Collect zdb -l output for both vdevs
28 # 4. Verify that the correct number of configs is dumped for each
31 log_assert
"Verify zdb does not produce redundant dumps of configurations"
36 datasetexists
$TESTPOOL && destroy_pool
$TESTPOOL
39 verify_runnable
"global"
40 verify_disk_count
"$DISKS" 2
45 default_mirror_setup_noexit
$DISKS
47 DEVS
=$
(get_pool_devices
${TESTPOOL} ${DEV_RDSKDIR})
49 [[ -n $DEVS ]] && set -A DISK
$DEVS
51 log_must
dd if=/dev
/${DISK[0]} of
=/dev
/${DISK[1]} bs
=1K count
=256 conv
=notrunc
54 config_count
=$
(zdb
-l $DEV_RDSKDIR/${DISK[$x]} |
grep -c features_for_read
)
55 (( $?
!= 0)) && log_fail
"failed to get config_count from DISK[$x]"
56 log_note
"vdev $x: message_count $config_count"
57 [ $config_count -ne ${config_count[$x]} ] && \
58 log_fail
"zdb produces an incorrect number of configuration dumps."
63 log_pass
"zdb produces unique dumps of configurations."