xref: /titanic_50/usr/src/test/zfs-tests/doc/README (revision 7b1753e64ab6c8c68e7cd79acbedfdfba12bd7f8)
1d583b39bSJohn Wren Kennedy#
2d583b39bSJohn Wren Kennedy# This file and its contents are supplied under the terms of the
3d583b39bSJohn Wren Kennedy# Common Development and Distribution License ("CDDL"), version 1.0.
4d583b39bSJohn Wren Kennedy# You may only use this file in accordance with the terms of version
5d583b39bSJohn Wren Kennedy# 1.0 of the CDDL.
6d583b39bSJohn Wren Kennedy#
7d583b39bSJohn Wren Kennedy# A full copy of the text of the CDDL should have accompanied this
8d583b39bSJohn Wren Kennedy# source.  A copy of the CDDL is also available via the Internet at
9d583b39bSJohn Wren Kennedy# http://www.illumos.org/license/CDDL.
10d583b39bSJohn Wren Kennedy#
11d583b39bSJohn Wren Kennedy
12d583b39bSJohn Wren Kennedy#
13*7b1753e6SJohn Wren Kennedy# Copyright (c) 2013 by Delphix. All rights reserved.
14d583b39bSJohn Wren Kennedy#
15d583b39bSJohn Wren Kennedy
16d583b39bSJohn Wren KennedyZFS Test Suite README
17d583b39bSJohn Wren Kennedy
18d583b39bSJohn Wren Kennedy1. Building and installing the ZFS Test Suite
19d583b39bSJohn Wren Kennedy2. Running the ZFS Test Suite
20d583b39bSJohn Wren Kennedy3. Test results
21d583b39bSJohn Wren Kennedy
22d583b39bSJohn Wren Kennedy--------------------------------------------------------------------------------
23d583b39bSJohn Wren Kennedy
24d583b39bSJohn Wren Kennedy1. Building and installing the ZFS Test Suite
25d583b39bSJohn Wren Kennedy
26d583b39bSJohn Wren KennedyThe ZFS Test Suite runs under the testrunner framework (which can be installed
27d583b39bSJohn Wren Kennedyas pkg:/system/test/testrunner). To build both the ZFS Test Suite and the
28d583b39bSJohn Wren Kennedytestrunner without running a full nightly:
29d583b39bSJohn Wren Kennedy
30d583b39bSJohn Wren Kennedy	build_machine$ bldenv [-d] <your_env_file>
31d583b39bSJohn Wren Kennedy	build_machine$ cd $SRC/test
32d583b39bSJohn Wren Kennedy	build_machine$ dmake install
33d583b39bSJohn Wren Kennedy	build_machine$ cd $SRC/pkg
34d583b39bSJohn Wren Kennedy	build_machine$ dmake install
35d583b39bSJohn Wren Kennedy
36d583b39bSJohn Wren KennedyThen set the publisher on the test machine to point to your repository and
37d583b39bSJohn Wren Kennedyinstall the ZFS Test Suite.
38d583b39bSJohn Wren Kennedy
39d583b39bSJohn Wren Kennedy	test_machine# pkg install pkg:/system/test/zfstest
40d583b39bSJohn Wren Kennedy
41d583b39bSJohn Wren KennedyNote, the framework will be installed automatically, as the ZFS Test Suite
42d583b39bSJohn Wren Kennedydepends on it.
43d583b39bSJohn Wren Kennedy
44d583b39bSJohn Wren Kennedy2. Running the ZFS Test Suite
45d583b39bSJohn Wren Kennedy
46d583b39bSJohn Wren KennedyThe pre-requisites for running the ZFS Test Suite are:
47d583b39bSJohn Wren Kennedy	- Three scratch disks
48d583b39bSJohn Wren Kennedy	  - Specify the disks you wish to use in the $DISKS variable, as a
49d583b39bSJohn Wren Kennedy	    space delimited list like this: DISKS='c3t1d0 c3t2d0 c3t3d0'
50d583b39bSJohn Wren Kennedy	  - Use the '-a' option to the zfstest script and all unused disks on
51d583b39bSJohn Wren Kennedy	    the system are eligible. With '-a' specified, $DISKS is ignored.
52d583b39bSJohn Wren Kennedy	- A non-root user with the full set of basic privileges and the ability
53d583b39bSJohn Wren Kennedy	  to sudo(1M) to root without a password to run the test.
54d583b39bSJohn Wren Kennedy	- Specify any pools you wish to preserve as a space delimited list in
55d583b39bSJohn Wren Kennedy	  the $KEEP variable. The root pool is added automatically.
56d583b39bSJohn Wren Kennedy
57d583b39bSJohn Wren KennedyOnce the pre-requisites are satisfied, simply run the zfstest script:
58d583b39bSJohn Wren Kennedy
59d583b39bSJohn Wren Kennedy	test_machine$ /opt/zfs-tests/bin/zfstest [-aq]
60d583b39bSJohn Wren Kennedy
61d583b39bSJohn Wren KennedyWhen the '-q' option is specified, it is passed to run(1) which causes output
62d583b39bSJohn Wren Kennedyto be written to the console only for tests that do not pass and the results
63d583b39bSJohn Wren Kennedysummary.
64d583b39bSJohn Wren Kennedy
65d583b39bSJohn Wren KennedyThe ZFS Test Suite allows the user to specify a subset of the tests via a
66d583b39bSJohn Wren Kennedyrunfile. The format of the runfile is explained in run(1), and the files that
67d583b39bSJohn Wren Kennedyzfstest uses are available for reference under /opt/zfs-tests/runfiles. To
68d583b39bSJohn Wren Kennedyspecify a custom runfile, use the -c option:
69d583b39bSJohn Wren Kennedy
70d583b39bSJohn Wren Kennedy	test_machine$ /opt/zfs-tests/bin/zfstest [-aq] -c my_tests.run
71d583b39bSJohn Wren Kennedy
72d583b39bSJohn Wren Kennedy3. Test results
73d583b39bSJohn Wren Kennedy
74d583b39bSJohn Wren KennedyWhile the ZFS Test Suite is running, one informational line is printed at the
75d583b39bSJohn Wren Kennedyend of each test, and a results summary is printed at the end of the run. The
76d583b39bSJohn Wren Kennedyresults summary includes the location of the complete logs, which is of the
77d583b39bSJohn Wren Kennedyform /var/tmp/test_results/<ISO 8601 date>.
78