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