mirror_zfs/tests/zfs-tests/tests/functional
Olaf Faaland 3c9e0d673e Dump unique configurations and Uberblocks in zdb -lu
For zdb -l, detect when the configuration nvlist in some label l (l>0)
is the same as a configuration already dumped.  If so, do not dump it.

Make a similar check when dumping Uberblocks for zdb -lu.  Check whether
a label already dumped contains an identical Uberblock.  If so, do not
dump the Uberblock.

When dumping a configuration or Uberblock, state which labels it is
found in (0-3), for example: labels = 1 2 3

Detecting redundant uberblocks or configurations is accomplished by
calculating checksums of the uberblocks and the packed nvlists
containing the configuration.

If there is nothing unique to be dumped for a label (ie the
configuration and uberblocks have checksums matching those already
dumped) print nothing for that label.

With additional l's or u's, increase verbosity as follows:

-l      Dump each unique configuration only once.
        Indicate which labels it appears in.
-ll     In addition, dump label space usage stats.
-lll    Dump every configuration, unique or not.

-u      Dump each unique, valid, uberblock only once.
        Indicate which labels it appears in.
-uu     In addition, state which slots are invalid.
-uuu    Dump every uberblock, unique or not.
-uuuu   Dump the uberblock blockpointer (used to be -uuu)

Make exit values conform to the manual page.  Failing to unpack a
configuration nvlist is considered an error, as well as failing to open
or read from the device.

Add three tests, zdb_00{3,4,5}_pos to verify the above functionality.

An example of the output:
	------------------------------------
	LABEL 0
	------------------------------------
	    version: 5000
	    name: 'pool'
	    state: 1
	    txg: 880
	    < ... redacted ... >
	    features_for_read:
		com.delphix:hole_birth
		com.delphix:embedded_data
	    labels = 0
	    Uberblock[0]
		magic = 0000000000bab10c
		version = 5000
		txg = 0
		guid_sum = 3038694082047428541
		timestamp = 1487715500 UTC = Tue Feb 21 14:18:20 2017
		labels = 0 1 2 3
	    Uberblock[4]
		magic = 0000000000bab10c
		version = 5000
		txg = 772
		guid_sum = 9045970794941528051
		timestamp = 1487727291 UTC = Tue Feb 21 17:34:51 2017
		labels = 0
	    < ... redacted ... >
	------------------------------------
	LABEL 1
	------------------------------------
	    version: 5000
	    name: 'pool'
	    state: 1
	    txg: 14
	    < ... redacted ... >
		com.delphix:embedded_data
	    labels = 1 2 3
	    Uberblock[4]
		magic = 0000000000bab10c
		version = 5000
		txg = 4
		guid_sum = 7793930272573252584
		timestamp = 1487727521 UTC = Tue Feb 21 17:38:41 2017
		labels = 1 2 3
	    < ... redacted ... >

Reviewed-by: Tim Chase <tim@chase2k.com>
Reviewed-by: Don Brady <don.brady@intel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #5738
2017-03-06 16:01:45 -08:00
..
acl Fix spelling 2017-01-03 11:31:18 -06:00
atime Add zfs-tests for relatime 2016-04-05 18:56:06 -07:00
bootfs OpenZFS 7761 - bootfs_005_neg's pool destruction must handle EBUSY 2017-02-24 11:06:14 -08:00
cache OpenZFS 6580 - zfs-tests use undefined variable WRAPPER 2017-02-13 10:25:39 -08:00
cachefile OpenZFS 7104 - increase indirect block size 2017-02-09 10:27:02 -08:00
casenorm Fix spelling 2017-01-03 11:31:18 -06:00
chattr Add test for chattr 2016-12-16 16:07:41 -08:00
checksum Use 100MB pool for filetest_001_pos.ksh checksum test 2016-10-03 14:51:21 -07:00
clean_mirror OpenZFS - Performance regression suite for zfstest 2016-09-08 16:18:28 -07:00
cli_root Dump unique configurations and Uberblocks in zdb -lu 2017-03-06 16:01:45 -08:00
cli_user OpenZFS 7104 - increase indirect block size 2017-02-09 10:27:02 -08:00
compression Fix spelling 2017-01-03 11:31:18 -06:00
ctime Fix coverity defects: CID 147643, 152204, 49339 2016-10-18 10:43:22 -07:00
delegate Refresh Linux test suite runfile 2017-01-26 12:25:35 -08:00
devices Fix spelling 2017-01-03 11:31:18 -06:00
exec Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
fault Add auto-online test for ZED/FMA as part of the ZTS 2017-02-28 16:25:39 -08:00
features Fix unallocated object detection for large_dnode datasets 2017-01-13 15:47:34 -08:00
grow_pool Real disk partitioning now enabled in test suite for Linux 2016-09-08 13:45:34 -07:00
grow_replicas Real disk partitioning now enabled in test suite for Linux 2016-09-08 13:45:34 -07:00
history OpenZFS 7104 - increase indirect block size 2017-02-09 10:27:02 -08:00
inheritance OpenZFS 7337 - inherit_001_pos occasionally times out 2017-02-24 11:03:11 -08:00
inuse OpenZFS 7260 - disable libdiskmgmt in zfstest unless it's required 2017-02-15 11:09:33 -08:00
large_files Retire .write/.read file operations 2017-01-27 10:43:39 -08:00
largest_pool Replace ISAINFO with is_32bit function 2016-11-07 10:26:17 -08:00
libzfs OpenZFS 5704 - libzfs can only handle 255 file descriptors 2017-02-10 10:54:30 -08:00
link_count Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
migration Update migration tests 2016-10-31 14:55:40 -07:00
mmap Real disk partitioning now enabled in test suite for Linux 2016-09-08 13:45:34 -07:00
mount Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
mv_files Real disk partitioning now enabled in test suite for Linux 2016-09-08 13:45:34 -07:00
nestedfs Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
no_space Real disk partitioning now enabled in test suite for Linux 2016-09-08 13:45:34 -07:00
nopwrite Fix spelling 2017-01-03 11:31:18 -06:00
online_offline OpenZFS 7104 - increase indirect block size 2017-02-09 10:27:02 -08:00
pool_names Fix pool_names_001_pos test case 2017-01-23 17:04:26 -08:00
poolversion OpenZFS 7104 - increase indirect block size 2017-02-09 10:27:02 -08:00
privilege Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
quota Enable quota_002_pos, quota_004_pos and quota_005_pos 2016-10-14 09:33:51 -07:00
raidz SIMD implementation of vdev_raidz generate and reconstruct routines 2016-06-21 09:27:26 -07:00
redundancy OpenZFS 7104 - increase indirect block size 2017-02-09 10:27:02 -08:00
refquota Fix spelling 2017-01-03 11:31:18 -06:00
refreserv Fix spelling 2017-01-03 11:31:18 -06:00
rename_dirs Fix spelling 2017-01-03 11:31:18 -06:00
replacement OpenZFS 7104 - increase indirect block size 2017-02-09 10:27:02 -08:00
reservation OpenZFS 7104 - increase indirect block size 2017-02-09 10:27:02 -08:00
rootpool Fix spelling 2017-01-03 11:31:18 -06:00
rsend OpenZFS 7248 - large block support breaks rsend_009_pos 2017-02-15 17:28:36 -08:00
scrub_mirror Real disk partitioning now enabled in test suite for Linux 2016-09-08 13:45:34 -07:00
slog OpenZFS 6580 - zfs-tests use undefined variable WRAPPER 2017-02-13 10:25:39 -08:00
snapshot Add wait_freeing helper function to ZTS 2017-02-08 15:27:37 -08:00
snapused Refresh Linux test suite runfile 2017-01-26 12:25:35 -08:00
sparse Disable sparse_001_pos / truncate_001_pos.ksh on 32-bit systems 2017-02-03 19:00:00 -08:00
threadsappend Fix spelling 2017-01-03 11:31:18 -06:00
tmpfile Add tmpfile_003_pos to .gitignore 2017-02-03 13:42:49 -08:00
truncate Disable sparse_001_pos / truncate_001_pos.ksh on 32-bit systems 2017-02-03 19:00:00 -08:00
upgrade Fix file permissions 2016-10-08 14:57:56 -07:00
userquota Fix file permissions 2016-10-08 14:57:56 -07:00
vdev_zaps Per-vdev ZAP tests must use $ZPOOL and $ZDB 2016-05-06 18:13:17 -07:00
write_dirs Real disk partitioning now enabled in test suite for Linux 2016-09-08 13:45:34 -07:00
xattr Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
zvol Reduce size of zvol and enforce 4k blocksize in zvol tests 2017-03-01 12:58:12 -08:00
Makefile.am Add auto-online test for ZED/FMA as part of the ZTS 2017-02-28 16:25:39 -08:00