|ZTEST(1)||General Commands Manual||ZTEST(1)|
was written by the ZFS Developers as a ZFS unit test
ztestwas written by the ZFS Developers as a ZFS unit test. The tool was developed in tandem with the ZFS functionality and was executed nightly as one of the many regression test against the daily build. As features were added to ZFS, unit tests were also added to
ztest. In addition, a separate test development team wrote and executed more functional and stress tests. By default
ztestruns for ten minutes and uses block files (stored in /tmp) to create pools rather than using physical disks. Block files afford
ztestits flexibility to play around with zpool components without requiring large hardware configurations. However, storing the block files in /tmp may not work for you if you have a small tmp directory. By default is non-verbose. This is why entering the command above will result in
ztestquietly executing for 5 minutes. The
-Voption can be used to increase the verbosity of the tool. Adding multiple
-Voptions is allowed and the more you add the more chatty
ztestbecomes. After the
ztestrun completes, you should notice many ztest.* files lying around. Once the run completes you can safely remove these files. Note that you shouldn't remove these files during a run. You can re-use these files in your next
ztestrun by using the
- Print a help summary.
--vdevs= (default: 5)
- Number of vdevs.
--vdev-size= (default: 64M)
- Size of each vdev.
--alignment-shift= (default: 9) (use 0 for random)
- Alignment shift used in test.
--mirror-copies= (default: 2)
- Number of mirror copies.
--raid-disks= (default: 4 for raidz/16 for draid)
- Number of raidz/draid disks.
--raid-parity= (default: 1)
- Raid parity (raidz & draid).
--raid-kind=raidz|draid|random (default: random)
- The kind of RAID config to use. With random the kind alternates between raidz and draid.
--draid-data= (default: 4)
- Number of data disks in a dRAID redundancy group.
--draid-spares= (default: 1)
- Number of dRAID distributed spare disks.
--datasets= (default: 7)
- Number of datasets.
--threads= (default: 23)
- Number of threads.
--gang-block-threshold= (default: 32K)
- Gang block threshold.
--init-count= (default: 1)
- Number of pool initializations.
--kill-percentage= (default: 70%)
- Kill percentage.
--pool-name= (default: ztest)
- Pool name.
--vdev-file-directory= (default: /tmp)
- File directory for vdev files.
- Multi-host; simulate pool imported on remote host.
- Use existing pool (use existing pool instead of creating new one).
--run-time= (default: 300s)
- Total test run time.
--pass-time= (default: 60s)
- Time per pass.
--freeze-loops= (default: 50)
- Max loops in
- Alternate ztest path.
--vdev-class-state=on|off|random (default: random)
- The vdev allocation class state.
- Set global variable to an unsigned 32-bit integer value (little-endian only).
- Dump zfs_dbgmsg buffer before exiting due to an error.
- Verbose (use multiple times for ever more verbosity).
To get an idea of what
# ztest -f /
ztestis actually testing try this:
Maybe you'd like to run
# ztest -f / -VVV
ztestfor longer? To do so simply use the
-Toption and specify the runlength in seconds like so:
# ztest -f / -V -T 120
- Use id instead of the SPL hostid to identify
this host. Intended for use with
ztest, but this environment variable will affect any utility which uses libzpool, including zpool(8). Since the kernel is unaware of this setting, results with utilities other than ztest are undefined.
- Limit the default stack size to stacksize bytes for the purpose of detecting and debugging kernel stack overflows. This value defaults to 32K which is double the default 16K Linux kernel stack size. In practice, setting the stack size slightly higher is needed because differences in stack usage between kernel and user space can lead to spurious stack overflows (especially when debugging is enabled). The specified value will be rounded up to a floor of PTHREAD_STACK_MIN which is the minimum stack required for a NULL procedure in user space. By default the stack size is limited to 256K.
|May 26, 2021||Debian|