1 #
2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
7 #
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26 # ident "@(#)README 1.5 08/02/27 SMI"
27 #
28
29 The ZFS Test Suite Gate README - Apr 2nd, 2007
30
31 Table of Contents
32
33 1. Introduction
34
35 2. Building & Installation
36
37 2.1 Installing from Packages
38
39 2.2 Uninstalling the Test Suite Package
40
41 2.3 Building the Test Suite (optional)
42
43 3. Running the tests
44
45 3.1 Setting environment
46
47 3.2 Configuring and running in global zone
48
49 3.3 Configuring and running in local zone
50
51 3.4 Unconfigure
52
53 ================================================================================
54
55 1. Introduction
56
57 o This message contains the basics you need to know for the ZFS test suite
58
59 ================================================================================
60
61 2. Building & Installation
62
63 2.1 Installing from Packages
64
65 o In the majority of cases, the test suite can be installed from packages. The
66 package is called SUNWstc-zfs and installs into "/opt" by default. Installation is
67 via the standard Solaris package installation tool pkgadd(1m). To install
68 SUNWstc-zfs simply enter the following command line:
69
70 % sudo pkgadd -d <package location> SUNWstc-zfs
71
72 Where <package location> refers to the path containing the SUNWstc-zfs
73 package directory.
74
75 o It is recommended that you install the packages from scratch,
76 rather than on top of an existing installation. Thus, if an old
77 version of the tests is installed:
78
79 % sudo pkgrm SUNWstc-zfs
80
81 2.2 Uninstalling the Test Suite Package
82
83 o Prior to uninstalling the SUNWstc-zfs package, you may want to run stf_unconfigure
84 from the top level directory. Typically this will be "/opt/SUNWstc-zfs". Unconfiguring
85 the suite is recommended if you have previous run the suite in local zone mode. For
86 more detail on how to unconfigure the suite see section 3.4.
87
88 o To uninstall the package use the standard Solaris package installation tool pkgrm(1m)
89 as follows:
90
91 % sudo pkgrm SUNWstc-zfs
92
93 2.3 Building the Test Suite (optional)
94
95 o This method uses the standard STF techniques to create a
96 Solaris package, which will be installed under the base
97 directory "/opt/SUNWstc-zfs".
98
99 Briefly, this build and installation is performed as follows:
100
101 # set path to STF bin directory
102 % PATH=<path-to-STF>/bin/`uname -p`:$PATH
103 % export PATH
104
105 # if not using teamware, define CODEMGR_WS
106 % CODEMGR_WS=<path-to-workspace>
107 % export CODEMGR_WS
108
109 % cd ${CODEMGR_WS}/src/suites/zfs
110 % stf_build package
111 % cd ${CODEMGR_WS}/packages/`uname -p`
112 % sudo pkgadd -d `pwd` SUNWstc-zfs
113
114 o It is recommended that you install the packages from scratch,
115 rather than on top of an existing installation. Thus, if an old
116 version of the tests is installed:
117
118 % sudo pkgrm SUNWstc-zfs
119
120 ================================================================================
121
122 3. Running the tests
123
124 3.1 Setting environment
125
126 o Add <STF Tools Path>/proto/tools/stf/bin/`uname -p` to your PATH:
127
128 csh% set path = ( /ws/onnv-stc2/proto/tools/stf/bin/`uname -p` $path )
129
130 sh% PATH=/ws/onnv-stc2/proto/tools/stf/bin/`uname -p`:$PATH export PATH
131
132 o If no legal ip address was assigned to local zone, you need pkgadd
133 SUNWstc-stf in global zone
134
135 % sudo pkgadd -d /ws/onnv-stc2/packages/`uname -p` SUNWstc-stf
136
137 o When testing with NFS, you should set the remote access permission for
138 rsh/rcp on the remote server machine. You can add the permission to
139 ~root/.rhosts file in the server, for example:
140 server% echo "foo root" >~root/.rhosts
141 Here, the 'foo' is the local host name.
142
143 --------------------------------------------------------------------------------
144
145 3.2 Configuring and running in global zone
146
147 3.2.1 Configure the tests
148
149 o You'll need at least two scratch disks. Configure the two scratch disks,
150 c0t13d0 and c0t14d0 for example:
151
152 % cd /opt/SUNWstc-zfs; stf_configure -c DISKS="c0t13d0 c0t14d0"
153
154 o By default the test suite runs all test assertions. However, the test
155 suite can be configured for test runs of varying length by using the
156 RUNTIME parameter. Valid runtime lengths are: short, medium and
157 long (the default). For example, the following command will configure
158 the test suite for the shortest possible runtime:
159
160 % cd /opt/SUNWstc-zfs; stf_configure -c DISKS="c0t13d0 c0t14d0" \
161 -c "RUNTIME=short"
162
163 Note that hardware speed is also a significnat contributor to the
164 runtime length of the test suite.
165
166 o Configuring this test suite will destroy all existing pools.
167 If you want to preserve existing pools you should use the KEEP
168 parameter. For example:
169
170 % cd /opt/SUNWstc-zfs; stf_configure -c DISKS="c0t13d0 c0t14d0" \
171 -c "KEEP=poolA poolB"
172
173 o If you want to run the test suite with remote support, you should assign
174 one or more machines as remote testing hosts. Meanwhile, you also need to
175 specify disks for each remote host. Optionally, you can specify test
176 scripts location directory on the remote host. The descriptions of variables
177 are as follows:
178
179 RHOSTS -- The remote hosts list.
180 RDISKS -- The corresponding scratch disks list for each host in RHOSTS list.
181 You need to quote the disks of each host, for example:
182 RDISKS="'c0t0d0 c0t1d0' 'c0t2d0'"
183 which specifies scratch disks for two remote hosts.
184 You can assign 'detect' for a remote host, which means let
185 the program to detect any available disks for testing in a
186 remote host.
187 RTEST_ROOT -- The temporary directory to store test scripts and files on the
188 remote host. By default it's set to /var/tmp/SUNWstc-zfs/tmp.
189
190 Here is an example about how to customize the testing:
191 % cd /opt/SUNWstc-zfs
192 % stf_configure -c DISKS="c0t13d0 c0t14d0" -c RHOSTS="foo1 foo2" \
193 -c RDISKS="'c0t1d0 c0t2d0' 'detect'"
194 In this example, there are two remote hosts -- "foo1" and "foo2":
195 "foo1" is assigned two disks -- c0t1d0 and c0t2d0 for testing;
196 "foo2" is assigned 'detect', which will detect any available scratch
197 disks in "foo2" for remote support testing.
198
199 o If you want to run the test suite on iSCSI targets, you need to specify
200 iscsi variable to do the configuration, in addition to specify RHOSTS
201 and RDISKS.
202 Currently, only one value "remote" is supported for iscsi variable.
203
204 Here is an example
205 % cd /opt/SUNWstc-zfs
206 % stf_configure -c DISKS="c0t13d0 c0t14d0" -c RHOSTS="host1" \
207 -c RDISKS="'detect'" -c iscsi="remote"
208 In this example, all available scratch disks detected on host1 will
209 be configured as iSCSI targets on zfs, the local host will serve
210 as iSCSI initiator, the test suite will run on the iSCSI targets
211 at local host.
212
213 o In addition, all variables to stf_configure can be set through setting
214 environment variables or defining in a file. For example:
215 In Korn Shell, you can export all variables as environment variables:
216
217 % export DISKS="c0t13d0 c0t14d0"
218 % export KEEP="poolA poolB"
219 % export RUNTIME="long"
220 % export RHOSTS="foo1 foo2"
221 % export RDISKS="'c0t1d0 c0t2d0' 'detect'"
222 % export RTEST_ROOT="/export/tmp"
223 % stf_configure
224 ...
225 or, you can define all variables in a file and then via "-f" option of
226 stf_configure to export the vairables:
227 % echo "export DISKS=\"c0t13d0 c0t14d0\"" >/tmp/vars.cfg
228 % echo "export KEEP=\"poolA poolB\"" >>/tmp/vars.cfg
229 % echo "export RUNTIME=\"LONG\"" >>/tmp/vars.cfg
230 % echo "export RHOSTS=\"foo1 foo2\"" >>/tmp/vars.cfg
231 % echo "export RDISKS=\"'c0t1d0 c0t2d0' 'detect'\"" >>/tmp/vars.cfg
232 % echo "export RTEST_ROOT=\"/export/tmp\"" >>/tmp/vars.cfg
233 % stf_configure -f /tmp/vars.cfg
234
235 o For stf_configure options refer to the STF User's Guide.
236
237 3.2.2 Run the tests
238
239 o To execute all of the modes on current system platform:
240
241 % cd /opt/SUNWstc-zfs; stf_execute
242
243 o To execute in a specific mode:
244
245 % stf_execute -m <mode>
246
247 o To execute only test cases in a specific directory:
248
249 % cd /opt/SUNWstc-zfs/<test directory>; stf_execute
250
251 o For other stf_execute options, refer to the STF User's Guide.
252
253 o Note:
254
255 NIS client service will be disabled during tests/func/acl subsets
256 execution temporarily, and its state will be restored after that.
257
258 --------------------------------------------------------------------------------
259
260 3.3 Configuring and running in local zone
261
262 3.3.1 Configure the tests
263
264 o Firstly, configure in the global zone to create a local zone and export the
265 pool to the local zone. You'll need at least two scratch disks.
266 You can assign a zone name, zone root and IP address for the local zone.
267 All parameters are optional. Syntax as,
268
269 stf_configure -c DISKS="<DISKS>" -c zone=new [-c zone_name=<zone_name>] [-c zone_root=<zone_root>] [-c zone_ip=<zone_ip>]
270
271 For example,
272
273 % cd /opt/SUNWstc-zfs; stf_configure -c DISKS="c0t13d0 c0t14d0" -c zone=new
274
275 o Note: '-c zone=new' forces the creation a fresh zone. While 'zone=existing'
276 will try to use an existing zone if possible or create a new one if no
277 existing zone is found.
278
279 o Note:
280 If zone_name is NOT given, the default name of zone is `hostname`001
281 If zone_root is NOT given, the default residence of zone is /export/home
282
283 o Then, login to local zone.
284
285 % sudo zlogin zone001
286
287 o In local zone su to non-root user 'zone' which has be created automatically
288 during the stf_configure process which was executed from the global zone.
289
290 # su - zone
291
292 o Configure in local zone
293
294 % cd /opt/SUNWstc-zfs; /opt/SUNWstc-stf/bin/`uname -p`/stf_configure
295
296 3.3.2 Running the tests
297
298 o To execute all of the modes on current system platform
299
300 % cd /opt/SUNWstc-zfs;
301 % /opt/SUNWstc-stf/bin/`uname -p`/stf_execute
302
303 o To execute in a specific mode:
304
305 % /opt/SUNWstc-stf/bin/`uname -p`/stf_execute -m <mode>
306
307 o To execute only test cases in a specific directory:
308
309 % cd /opt/SUNWstc-zfs/<test directory>
310 % /opt/SUNWstc-stf/bin/`uname -p`/stf_execute
311
312 --------------------------------------------------------------------------------
313
314 3.4 Unconfigure the suite.
315
316 o Use the STF unconfigure tool.
317
318 % cd /opt/SUNWstc-zfs; stf_unconfigure
319
320 ================================================================================
321