BSD 4_3_Net_2 release
[unix-history] / usr / src / sys / tests / nfs / unix-tests / README
CommitLineData
1c15e888
C
1#
2# @(#)README 1.11 90/01/03 NFS Rev 2 Testsuite
3#
4NFS and Connectathon are trademarks of Sun Microsystems, Inc.
5
6
7
8Introduction to the NFS Revision 2 Testsuites
9---------------------------------------------
10
11These directories contain programs that can be used to test an implementation
12 of Revision 2 of the NFS Protocol. The tests run on a UNIX client and test
13server and client functions. They are divided into three groups:
14
15 basic - basic NFS operations tests
16 general - general file system tests
17 special - tests that poke certain common problem areas
18
19This README is divided into six sections. The first section is the introd-
20uction, which you are reading now. That is followed by a description of
21what you have to do before you run the testsuites on your machine. Then
22comes a description of how the testsuites are run in general followed by a
23description of how they are used at Connectathon. The last sections describes
24what each test does in detail.
25
26This testsuite should run on both BSD and System V based systems.
27The System V port of the Connectathon Testsuite is provided courtesy
28of the Software Technologies Group, INTERACTIVE Systems Corporation,
291901 N. Naper Blvd., Naperville, IL. 60563
30
31
32Preparing to run the Testsuites
33-------------------------------
34
35To prepare to run the testsuites on your machine, change directories to the
36highest level testsuite directory (it should be the same one that contains
37this README file), and type "make" to compile the test programs. If you are
38not sure your are in the correct directory, type "ls -F" and you should see
39the following files and directories:
40
41Makefile Testitems domount.c getopt.c server* tests.init
42README basic/ general/ runtests* special/ tools/
43
44The "server" script uses "getopt" and a source file of a public-domain
45version is included in the directory. The makefile will compile it for you.
46
47Changes may be required to the Makefile depending on the type of system
48you are testing on and what version of NFS you are testing. Change the
49COMPAT variable if you are running NFS3.2 to:
50
51 COMPAT = -DNFS3_2
52
53If you are running on a System V based system (SVR3) you will need to change:
54
55 SYSTYPE=-DSVR3
56 LIBS=-lrpc
57
58If you are running Lachman NFS for System V Release 3, you should set the
59compatability variable to:
60
61 COMPAT = -DSVR3
62
63Lachman NFS is based on NFS3.2, but you should not set NFS3_2. That symbol
64is used only for vnode-based systems, not FSS-based systems.
65
66If you are testing on a BSD based system SYSTYPE and LIBS should not be
67set to anything. Be sure and check the COMPAT variable if running
68release 3.2 of NFS.
69
70Two special targets are included in the Makefiles: copy and dist. The command
71"make copy DESTDIR="path"", where "path" is the name of a directory, will
72cause the compiled tests to be copied to "path". "make dist DESTDIR="path"",
73where "path" is the name of a directory, will copy the test sources to
74"path". DESTDIR must be specified on the make command line when making
75either of these targets.
76
77Modifications may be required so the programs compile on your machine. If
78that is so, we would like to know what they are so that we can incorporate
79them into our distribution.
80
81When defaults are used, the test programs expect /mnt to exist on the client
82and /server to exist on the server. These defaults can be overridden at
83run time. Read about how to run the testsuites for a description of how this
84is done.
85
86NOTE: When running any of the tests, you should save stdout and stderr
87 output in a file for future reference.
88
89
90
91
92How to run the Testsuites
93-------------------------
94
95There are two ways to run the tests: (1) use the server shell script or
96(2) mount, run the tests yourself, and unmount. We recommend you use the
97server script to run the tests.
98
99
100
101The server script:
102
103The server script executes the basic and general tests. (It runs the
104special tests only if use the -s option.) It is set up to mount,
105run tests using the runtests program, and unmount. It will attempt to unmount
106anything mounted on the mount point before attempting to mount the server file
107system.
108
109server uses the domount program to mount and unmount the test file systems.
110Since mount can only be executed by root, domount must have root permission.
111The Makefile will attempt to setuid the domount program to root. The server
112script can be run as a nonprivileged user. Alternately, you may login as root
113before you run server.
114
115
116
117server [-a|-b|-g|-s] [-|-f|-t|-n] [-o mnt_options] [-p server_path] [-m mntpoint] server_name
118
119
120-a|-b|-g|-s - will be passed on to the runtests scripts. This argument is
121 optional. The default is read from the initialization file,
122 tests.init.
123 This argument selects which tests to run:
124 -a run basic and general tests
125 -b run basic tests only
126 -g run general tests only
127 -s run special tests only
128-f|-t|-n - will be passed on to the runtests scripts. This argument is
129 optional. The default is read from the initialization file,
130 tests.init.
131mnt_options - will be passed on to the mount command. This argument is
132 optional. The default is read from the initialization file,
133 tests.init.
134server_path - specifies a directory on the server to mount. This argument
135 is optional. The default is read from the initialization file,
136 tests.init.
137mntpoint - specifies a mount point on your client. This argument is
138 optional. The default is read from the initialization file,
139 tests.init.
140server_name - the server you want to exercise. This is the only required
141 argument.
142
143The test programs create a sub-directory in the mntpoint directory with the
144name 'hostname'.test (where 'hostname' is the name of the machine on which
145you run the tests). This name can not be overridden if you use the server
146script although it can be if you use runtests directly.
147
148Example: (the client machine is eddie)
149
150eddie% server -o hard,intr,rw slartibartfarst
151Start tests on path /mnt/eddie.test [y/n]? y
152<output from tests>
153 :
154 :
155All tests completed
156eddie%
157
158See the script for more details.
159
160
161
162Run tests yourself:
163
164There is a runtest script in the highest level directory (the master runtests)
165which uses tests.init to set up the test environment and then executes runtest
166scripts in the basic, general, and/or special sub-directories.
167
168
169 runtests [-a|-b|-g|-s] [-f|-n|-t] [test-directory]
170
171
172-a - Run the basic and general tests. This is the default.
173-b - Run the basic tests.
174-g - Run the general tests.
175-s - Run the special tests.
176-f - Set parameters for a quick functional test. This is the
177 default. It applies only to basic tests.
178-n - Suppress directory operations (mkdir and rmdir) on the
179 test-directory. See descriptions of basic tests for more
180 details.
181-t - Run full-length test with running time statistics. It only
182 applies to basic tests. You will want to rerun with "-t" after
183 all the "-f" (default option) tests run successfully.
184
185
186test-directory - The name of test directory that the test programs create
187 on the client. runtests executes the basic tests in place
188 and they work on the test directory. The general tests are
189 copied over to the test directory and executed there. When
190 the -n flag is used, the test directory is assumed to already
191 exist.
192
193 The default test-directory is /mnt/'hostname'.test (where
194 'hostname' is the name of the machine on which you are
195 running the tests). There are three ways to override the
196 default test directory name. One it to put the
197 test_directory on the command line. Another way is to set
198 the environment variable NFSTESTDIR equal to the directory
199 name. The command line method overrides setting the
200 environment variable. The third way can only be used
201 for the tests in the basic sub-directory. There you
202 can set the TESTDIR variable in tests.h. The command
203 line and environment variable both override this
204 method.
205
206Running the tests without mounting your NFS server on /mnt will run the tests
207locally (if /mnt is local disk). We recommend that you do this once to make
208sure the testsuites run properly before you use them to test NFS.
209
210The runtests in sub-directories: basic, general, and special, may be invoked
211with the same arguments as the master runtests if you wish to run each suite
212separately.
213
214
215
216
217How to run the Testsuites at Connectathon
218-----------------------------------------
219
220
221The tests should be run in the following order: basic, general, and special.
222The basic tests should be passed completely before other tests are attempted.
223
224The NFS Test Suite should be run in three phases:
225
226Phase 1 - Run test programs locally.
227
228Phase 2 - Run the tests against a Sun. Run them on your machine using the
229 Sun as the server and then run them on the Sun using your machine
230 as the server.
231
232Phase 3 - NxN Testing. Run the tests on your machine using every other
233 machine as a server, one at a time. After the tests are
234 successfully completed using a particular server, log that
235 with the electronic board software provided. Check the electronic
236 board to make sure that the tests run successfully on
237 every other machine that uses your machine as a server.
238
239
240Test Descriptions
241-----------------
242
243System and library calls that are used by the testsuites are included in paren-
244theses. Look at the source if you are interested in how time statistics are
245recorded since that is not included in this description.
246
247
248
249
250- BASIC TESTS:
251
252Many of the programs listed below have optional calling parameters that can be
253used to override existing parameters. These are not used at this time so they
254are not described.
255
256
257test1: File and Directory Creation Test
258
259This program creates the test directory (mkdir) on the client and changes
260directories (chdir) to it, unless the -n flag is used in which case it simply
261changes directories to the test directory. Then it builds a directory tree
262N levels deep, where each directory (including the test directory) has M
263files and P directories (creat, close, chdir, and mkdir). For the -f
264option N = 2, M = 2, and P = 2 so a total of six files and six directories
265are created. For other options N = 5, M = 5, and P = 2. The files that are
266created are given names that begin with "file." and directories with names
267that begin with "dir.".
268
269
270
271test2: File and directory removal test
272
273This program changes directory to the test directory (chdir and/or mkdir) and
274removes the directory tree (unlink, chdir, and rmdir) that was just created
275by test1. The number of levels, files, and directories, and the name pre-
276fixes, are the same as in test1.
277
278This routine will not remove a file or directory that was not created by test1
279and will fail if it finds one. It determines this by looking at the prefix on
280the name of the object it's trying to remove.
281
282
283
284test3: Lookups across mount point
285
286This program changes directory to the test directory (chdir and/or mkdir) and
287gets the file status of the working directory (getwd and stat).
288
289
290test4: setattr, getattr, and lookup
291
292This program changes directory to the test directory (chdir and/or mkdir) and
293creates ten files (creat). Then the permissions are changed (chmod) and the
294file status is retrieved (stat) twice for each file.
295
296
297test4a: getattr, and lookup
298
299This test exists but is not called as part of the testsuite. You can edit
300runtests in the basic directory so this test is called.
301
302This program changes directory to the test directory (chdir and/or mkdir) and
303creates ten files (creat). Then the file status is retrieved (stat) for
304each file.
305
306
307
308test5: read and write
309
310This program changes directory to the test directory (chdir and/or mkdir) and
311then:
312
3131) Creates a file (creat)
3142) Gets status of file (fstat)
3153) Checks size of file
3164) Writes 1048576 bytes into the file (write) in 8192 byte buffers.
3175) Closes file (close)
3186) Gets status of file (stat)
3197) Checks the size of the file
320
321Then the file is opened (open) and read (read) in 8192 byte buffers. It's
322contents are compared with what was written. The file is then closed (close).
323
324Then the file is then re-opened (open) and re-read (read) before it is removed
325(unlink).
326
327test5a: write
328
329This test exists but is not called as part of the testsuite. You can edit
330runtests in the basic directory so this test is called.
331
332This program changes directory to the test directory (chdir and/or mkdir) and
333then:
334
3351) Creates a file (creat)
3362) Gets status of file (fstat)
3373) Checks size of file
3384) Writes 1048576 bytes into the file (write) in 8192 byte buffers.
3395) Closes file (close)
3406) Gets status of file (stat)
3417) Checks the size of the file
342
343
344test5b: read
345
346This test exists but is not called as part of the testsuite. You can edit
347runtests in the basic directory so this test is called.
348
349The file created in test5a is opened (open) and read (read) in 8192 byte
350buffers. It's contents are compared with what was written. The file is
351then closed (close) and removed (unlink).
352
353
354
355test6: readdir
356
357This program changes directory to the test directory (chdir and/or mkdir) and
358creates 200 files (creat). The current directory is opened (opendir), the
359beginning is found (rewinddir), and the directory is read (readdir) in a loop
360until the end is found. Errors flagged are:
361
3621) No entry for "."
3632) No entry for ".."
3643) Duplicate entry
3654) Filename that doesn't begin with "file."
3665) The suffix of the filename is out of range
3676) An entry is returned for an unlinked file. (This error can only be
368 found when the test is run with an option other than -f. For other
369 options the readdir loop is done multiple times and a file is unlinked
370 each time).
371
372The directory is then closed (closedir) and the files that were created are
373removed (unlink).
374
375
376
377test7: link and rename
378
379This program changes directory to the test directory (chdir and/or mkdir) and
380creates ten files. For each of these files, the file is renamed (rename) and
381file statistics are retrieved (stat) for both the new and old names. Errors
382that are flagged are:
383
3841) Old file still exists
3852) New file doesn't exist (can't stat)
3863) The new file's number of links doesn't equal one
387
388Then an attempt is made to link the new file to it's old name (link) and file
389stats are again retrieved (stat). An error is flagged if:
390
3911) Can't link
3922) Stats on new file can't be retrieved after link
3933) The new file's number of links doesn't equal two
3944) Stats on old file can't be retrieved after link
3955) The old file's number of links doesn't equal two
396
397Then the new file is removed (unlink) and file stats are retrieved for the old
398file (stat). An error is flagged if:
399
4001) Stats on old file can't be retrieved after unlink
4012) The old file's number of links doesn't equal one
402
403Any files that remain at the end of the test are removed (unlink).
404
405test7a: rename
406
407This test exists but is not called as part of the testsuite. You can edit
408runtests in the basic directory so this test is called.
409
410This program changes directory to the test directory (chdir and/or mkdir) and
411creates ten files. For each of these files, the file is renamed (rename) and
412file statistics are retrieved (stat) for both the new and old names. Errors
413that are flagged are:
414
4151) Old file still exists
4162) New file doesn't exist (can't stat)
4173) The new file's number of links doesn't equal one
418
419Any files that remain at the end of the test are removed (unlink).
420
421test7b: link
422
423This test exists but is not called as part of the testsuite. You can edit
424runtests in the basic directory so this test is called.
425
426This program changes directory to the test directory (chdir and/or mkdir) and
427creates ten files. A link (link) is done for each of these files, and file
428stats are retrieved for the old and new files (stat). An error is flagged
429if:
430
4311) Can't link
4322) Stats on either file can't be retrieved after link
4333) The either file's number of links doesn't equal two
434
435This is followed by an unlink (unlink) of the new file. An error is
436flagged if:
437
4381) Stats on the old file can't be retrieved after unlink
4392) The old file's number of links doesn't equal one
440
441Any files that remain at the end of the test are removed (unlink).
442
443
444
445test8: symlink and readlink
446
447NOTE: Not all operating systems support symlink and readlink. If the
448 errno EOPNOTSUPP is returned during test8, the test will be
449 counted as passing. For clients not supporting S_IFLNK, the
450 test will not be attempted.
451
452This program changes directory to the test directory (chdir and/or mkdir) and
453makes 10 symlinks (symlink). It reads (readlink), and gets statistics for
454(lstat), each, and then removes them (unlink). Errors flagged are:
455
4561) Unsupported function
4572) Can't get statistics (lstat failed)
4583) The mode in the stats is not symlink
4594) The value of the symlink is incorrect (returned from readlink)
4605) The linkname is wrong
4616) The unlink failed
462
463
464
465test9: statfs
466
467This program changes directory to the test directory (chdir and/or mkdir) and
468gets the file system status on the current directory (statfs).
469
470
471
472
473- GENERAL: General tests to look at server loading.
474
475Runs a small compile, Tbl, Nroff and a Large Compile. Four simultaneous
476large compiles are also run.
477
478
479
480
481- SPECIAL: Information specific to the special tests
482
483The special directory is set up to test special problems that have
484come up in the past. These tests are meant to be advisory, ...
485things to watch out for. It is not required that you "pass" these
486tests but we suggest you give them a try.
487
488The tests try to:
489
490 check for proper open/unlink operation
491 check for proper open/chmod 0 operation
492 check for lost reply on non-idempotent requests
493 test exclusive create
494 test negative seek
495 test rename
496
497
498
499
500- MISC:
501
502'Testitems' is a list of NFS functionality that can be used for reference.
503
504Programs in 'tools' are provided for your use as you see fit. Please
505feel free to add to this (or any other) directory! If you do, please
506make sure that Cathe Ray (sun!cathe or cathe@sun.com) at Sun gets a copy
507so we can add it to the master test distribution.
508