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