d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# This file and its contents are supplied under the terms of the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# Common Development and Distribution License ("CDDL"), version 1.0.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# You may only use this file in accordance with the terms of version
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# 1.0 of the CDDL.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# A full copy of the text of the CDDL should have accompanied this
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# source. A copy of the CDDL is also available via the Internet at
7b1753e64ab6c8c68e7cd79acbedfdfba12bd7f8John Wren Kennedy# Copyright (c) 2013 by Delphix. All rights reserved.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyZFS Test Suite README
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy1. Building and installing the ZFS Test Suite
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy2. Running the ZFS Test Suite
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy3. Test results
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy--------------------------------------------------------------------------------
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy1. Building and installing the ZFS Test Suite
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyThe ZFS Test Suite runs under the testrunner framework (which can be installed
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyas pkg:/system/test/testrunner). To build both the ZFS Test Suite and the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedytestrunner without running a full nightly:
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy build_machine$ bldenv [-d] <your_env_file>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy build_machine$ cd $SRC/test
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy build_machine$ dmake install
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy build_machine$ cd $SRC/pkg
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy build_machine$ dmake install
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyThen set the publisher on the test machine to point to your repository and
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyinstall the ZFS Test Suite.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy test_machine# pkg install pkg:/system/test/zfstest
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyNote, the framework will be installed automatically, as the ZFS Test Suite
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy2. Running the ZFS Test Suite
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyThe pre-requisites for running the ZFS Test Suite are:
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy - Three scratch disks
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy - Specify the disks you wish to use in the $DISKS variable, as a
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy space delimited list like this: DISKS='c3t1d0 c3t2d0 c3t3d0'
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy - Use the '-a' option to the zfstest script and all unused disks on
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy the system are eligible. With '-a' specified, $DISKS is ignored.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy - A non-root user with the full set of basic privileges and the ability
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy to sudo(1M) to root without a password to run the test.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy - Specify any pools you wish to preserve as a space delimited list in
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy the $KEEP variable. The root pool is added automatically.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyOnce the pre-requisites are satisfied, simply run the zfstest script:
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy test_machine$ /opt/zfs-tests/bin/zfstest [-aq]
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyWhen the '-q' option is specified, it is passed to run(1) which causes output
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyto be written to the console only for tests that do not pass and the results
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyThe ZFS Test Suite allows the user to specify a subset of the tests via a
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyrunfile. The format of the runfile is explained in run(1), and the files that
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyzfstest uses are available for reference under /opt/zfs-tests/runfiles. To
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyspecify a custom runfile, use the -c option:
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy test_machine$ /opt/zfs-tests/bin/zfstest [-aq] -c my_tests.run
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy3. Test results
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyWhile the ZFS Test Suite is running, one informational line is printed at the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyend of each test, and a results summary is printed at the end of the run. The
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyresults summary includes the location of the complete logs, which is of the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyform /var/tmp/test_results/<ISO 8601 date>.