home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / sys / tests / nfs / unix-tests / README < prev    next >
Encoding:
Text File  |  1990-01-10  |  18.0 KB  |  509 lines

  1. #
  2. #    @(#)README    1.11 90/01/03 NFS Rev 2 Testsuite
  3. #
  4. NFS and Connectathon are trademarks of Sun Microsystems, Inc.
  5.  
  6.  
  7.  
  8. Introduction to the NFS Revision 2 Testsuites
  9. ---------------------------------------------
  10.  
  11. These 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 
  13. server 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.  
  19. This README is divided into six sections.  The first section is the introd-
  20. uction,  which you are reading now.  That is followed by a description of 
  21. what you have to do before you run the testsuites on your machine.  Then 
  22. comes a description of how the testsuites are run in general followed by a 
  23. description of how they are used at Connectathon.  The last sections describes 
  24. what each test does in detail.
  25.  
  26. This testsuite should run on both BSD and System V based systems.
  27. The System V port of the Connectathon Testsuite is provided courtesy
  28. of the Software Technologies Group, INTERACTIVE Systems Corporation,
  29. 1901 N. Naper Blvd., Naperville, IL. 60563
  30.  
  31.  
  32. Preparing to run the Testsuites
  33. -------------------------------
  34.  
  35. To prepare to run the testsuites on your machine,  change directories to the 
  36. highest level testsuite directory (it should be the same one that contains 
  37. this README file),  and type "make" to compile the test programs.  If you are 
  38. not sure your are in the correct directory,  type "ls -F" and you should see 
  39. the following files and directories:
  40.  
  41. Makefile    Testitems   domount.c   getopt.c    server*     tests.init
  42. README      basic/      general/    runtests*   special/    tools/
  43.  
  44. The "server" script uses "getopt" and a source file of a public-domain 
  45. version is included in the directory.  The makefile will compile it for you.
  46.  
  47. Changes may be required to the Makefile depending on the type of system
  48. you are testing on and what version of NFS you are testing.  Change the 
  49. COMPAT variable if you are running NFS3.2 to:
  50.  
  51.     COMPAT = -DNFS3_2
  52.  
  53. If you are running on a System V based system (SVR3) you will need to change:
  54.  
  55.     SYSTYPE=-DSVR3
  56.     LIBS=-lrpc
  57.  
  58. If you are running Lachman NFS for System V Release 3, you should set the 
  59. compatability variable to:
  60.  
  61.     COMPAT =  -DSVR3
  62.  
  63. Lachman NFS is based on NFS3.2, but you should not set NFS3_2.  That symbol 
  64. is used only for vnode-based systems, not FSS-based systems.
  65.  
  66. If you are testing on a BSD based system SYSTYPE and LIBS should not be
  67. set to anything.  Be sure and check the COMPAT variable if running 
  68. release 3.2 of NFS. 
  69.  
  70. Two 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 
  72. cause the compiled tests to be copied to "path".  "make dist DESTDIR="path"", 
  73. where "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 
  75. either of these targets.
  76.  
  77. Modifications may be required so the programs compile on your machine.  If 
  78. that is so,  we would like to know what they are so that we can incorporate 
  79. them into our distribution.  
  80.  
  81. When defaults are used,  the test programs expect /mnt to exist on the client 
  82. and /server to exist on the server.    These defaults can be overridden at 
  83. run time.  Read about how to run the testsuites for a description of how this 
  84. is done.
  85.  
  86. NOTE:  When running any of the tests, you should save stdout and stderr
  87.        output in a file for future reference.
  88.  
  89.  
  90.  
  91.  
  92. How to run the Testsuites
  93. -------------------------
  94.  
  95. There 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 
  97. server script to run the tests.
  98.  
  99.  
  100.  
  101. The server script:
  102.  
  103. The server script executes the basic and general tests. (It runs the 
  104. special tests only if use the -s option.)  It is set up to mount, 
  105. run tests using the runtests program, and unmount.  It will attempt to unmount 
  106. anything mounted on the mount point before attempting to mount the server file 
  107. system. 
  108.  
  109. server uses the domount program to mount and unmount the test file systems.  
  110. Since mount can only be executed by root,  domount must have root permission.  
  111. The Makefile will attempt to setuid the domount program to root.  The server 
  112. script can be run as a nonprivileged user. Alternately, you may login as root 
  113. before you run server.
  114.  
  115.  
  116.  
  117. server [-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.
  131. mnt_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.
  134. server_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.
  137. mntpoint    - specifies a mount point on your client. This argument is
  138.           optional.  The default is read from the initialization file,
  139.           tests.init.
  140. server_name - the server you want to exercise.  This is the only required 
  141.           argument. 
  142.  
  143. The test programs create a sub-directory in the mntpoint directory with the 
  144. name 'hostname'.test (where 'hostname' is the name of the machine on which 
  145. you run the tests).  This name can not be overridden if you use the server 
  146. script although it can be if you use runtests directly.  
  147.  
  148. Example:  (the client machine is eddie)
  149.  
  150. eddie% server -o hard,intr,rw slartibartfarst
  151. Start tests on path /mnt/eddie.test [y/n]? y
  152. <output from tests>
  153.          :
  154.          :
  155. All tests completed
  156. eddie%
  157.  
  158. See the script for more details.
  159.  
  160.  
  161.  
  162. Run tests yourself:
  163.  
  164. There is a runtest script in the highest level directory (the master runtests) 
  165. which uses tests.init to set up the test environment and then executes runtest 
  166. scripts 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.  
  186. test-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.  
  206. Running the tests without mounting your NFS server on /mnt will run the tests 
  207. locally (if /mnt is local disk).  We recommend that you do this once to make 
  208. sure the testsuites run properly before you use them to test NFS.
  209.  
  210. The runtests in sub-directories: basic, general, and special,  may be invoked 
  211. with the same arguments as the master runtests if you wish to run each suite 
  212. separately.
  213.  
  214.  
  215.  
  216.  
  217. How to run the Testsuites at Connectathon
  218. -----------------------------------------
  219.  
  220.  
  221. The tests should be run in the following order:  basic,  general, and special.
  222. The basic tests should be passed completely before other tests are attempted.
  223.  
  224. The NFS Test Suite should be run in three phases:
  225.  
  226. Phase 1 - Run test programs locally.
  227.  
  228. Phase 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.  
  232. Phase 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.  
  240. Test Descriptions
  241. -----------------
  242.  
  243. System and library calls that are used by the testsuites are included in paren-
  244. theses.  Look at the source if you are interested in how time statistics are 
  245. recorded since that is not included in this description.
  246.  
  247.  
  248.  
  249.  
  250. - BASIC TESTS:   
  251.  
  252. Many of the programs listed below have optional calling parameters that can be 
  253. used to override existing parameters.  These are not used at this time so they 
  254. are not described.  
  255.  
  256.  
  257. test1: File and Directory Creation Test
  258.  
  259. This program creates the test directory (mkdir)  on the client and changes 
  260. directories (chdir) to it,  unless the -n flag is used in which case it simply 
  261. changes directories to the test directory.  Then it builds a directory tree  
  262. N levels deep, where each directory (including the test directory) has M 
  263. files and P directories (creat, close, chdir, and mkdir).  For the -f 
  264. option N = 2, M = 2,  and P = 2 so a total of six files and six directories 
  265. are created.  For other options N = 5, M = 5, and P = 2.  The files that are 
  266. created are given names that begin with "file." and directories with names 
  267. that begin with "dir.".
  268.  
  269.  
  270.  
  271. test2: File and directory removal test
  272.  
  273. This program changes directory to the test directory (chdir and/or mkdir) and 
  274. removes the directory tree (unlink, chdir,  and rmdir) that was just created 
  275. by test1.  The number of levels, files, and directories,  and the name pre-
  276. fixes, are the same as in test1.
  277.  
  278. This routine will not remove a file or directory that was not created by test1 
  279. and will fail if it finds one.  It determines this by looking at the prefix on 
  280. the name of the object it's trying to remove.
  281.  
  282.  
  283.  
  284. test3: Lookups across mount point
  285.  
  286. This program changes directory to the test directory (chdir and/or mkdir) and 
  287. gets the file status of the working directory (getwd and stat).    
  288.  
  289.  
  290. test4: setattr, getattr, and lookup
  291.  
  292. This program changes directory to the test directory (chdir and/or mkdir) and 
  293. creates ten files (creat).    Then the permissions are changed (chmod) and the 
  294. file status is retrieved (stat) twice for each file. 
  295.  
  296.  
  297. test4a:  getattr, and lookup
  298.  
  299. This test exists but is not called as part of the testsuite.  You can edit
  300. runtests in the basic directory so this test is called.
  301.  
  302. This program changes directory to the test directory (chdir and/or mkdir) and 
  303. creates ten files (creat).    Then the file status is retrieved (stat) for 
  304. each file. 
  305.  
  306.  
  307.  
  308. test5: read and write
  309.              
  310. This program changes directory to the test directory (chdir and/or mkdir) and 
  311. then: 
  312.  
  313. 1) Creates a file (creat) 
  314. 2) Gets status of file (fstat)
  315. 3) Checks size of file
  316. 4) Writes 1048576 bytes into the file (write) in 8192 byte buffers.  
  317. 5) Closes file (close)
  318. 6) Gets status of file (stat)
  319. 7) Checks the size of the file
  320.  
  321. Then the file is opened (open) and read (read) in 8192 byte buffers.  It's 
  322. contents are compared with what was written.  The file is then closed (close).
  323.  
  324. Then the file is then re-opened (open) and re-read (read) before it is removed 
  325. (unlink).
  326.  
  327. test5a: write
  328.  
  329. This test exists but is not called as part of the testsuite.  You can edit
  330. runtests in the basic directory so this test is called.
  331.  
  332. This program changes directory to the test directory (chdir and/or mkdir) and 
  333. then: 
  334.  
  335. 1) Creates a file (creat) 
  336. 2) Gets status of file (fstat)
  337. 3) Checks size of file
  338. 4) Writes 1048576 bytes into the file (write) in 8192 byte buffers.  
  339. 5) Closes file (close)
  340. 6) Gets status of file (stat)
  341. 7) Checks the size of the file
  342.  
  343.  
  344. test5b: read
  345.  
  346. This test exists but is not called as part of the testsuite.  You can edit
  347. runtests in the basic directory so this test is called.
  348.  
  349. The file created in test5a is opened (open) and read (read) in 8192 byte 
  350. buffers.  It's contents are compared with what was written.  The file is 
  351. then closed (close) and removed (unlink).
  352.  
  353.  
  354.  
  355. test6: readdir
  356.  
  357. This program changes directory to the test directory (chdir and/or mkdir) and 
  358. creates 200 files (creat).  The current directory is opened (opendir), the 
  359. beginning is found (rewinddir), and the directory is read (readdir) in a loop 
  360. until the end is found.  Errors flagged are:
  361.  
  362. 1) No entry for "."
  363. 2) No entry for ".."
  364. 3) Duplicate entry
  365. 4) Filename that doesn't begin with "file."
  366. 5) The suffix of the filename is out of range
  367. 6) 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.  
  372. The directory is then closed (closedir) and the files that were created are 
  373. removed (unlink). 
  374.  
  375.  
  376.  
  377. test7: link and rename
  378.  
  379. This program changes directory to the test directory (chdir and/or mkdir) and 
  380. creates ten files.  For each of these files, the file is renamed (rename) and 
  381. file statistics are retrieved (stat) for both the new and old names.  Errors 
  382. that are flagged are:
  383.  
  384. 1) Old file still exists
  385. 2) New file doesn't exist (can't stat)
  386. 3) The new file's number of links doesn't equal one
  387.  
  388. Then an attempt is made to link the new file to it's old name (link) and file 
  389. stats are again retrieved (stat).  An error is flagged if:
  390.  
  391. 1) Can't link
  392. 2) Stats on new file can't be retrieved after link  
  393. 3) The new file's number of links doesn't equal two
  394. 4) Stats on old file can't be retrieved after link  
  395. 5) The old file's number of links doesn't equal two
  396.  
  397. Then the new file is removed (unlink) and file stats are retrieved for the old 
  398. file (stat).  An error is flagged if:
  399.  
  400. 1) Stats on old file can't be retrieved after unlink
  401. 2) The old file's number of links doesn't equal one
  402.  
  403. Any files that remain at the end of the test are removed (unlink).
  404.  
  405. test7a: rename
  406.  
  407. This test exists but is not called as part of the testsuite.  You can edit
  408. runtests in the basic directory so this test is called.
  409.  
  410. This program changes directory to the test directory (chdir and/or mkdir) and 
  411. creates ten files.  For each of these files, the file is renamed (rename) and 
  412. file statistics are retrieved (stat) for both the new and old names.  Errors 
  413. that are flagged are:
  414.  
  415. 1) Old file still exists
  416. 2) New file doesn't exist (can't stat)
  417. 3) The new file's number of links doesn't equal one
  418.  
  419. Any files that remain at the end of the test are removed (unlink).
  420.  
  421. test7b: link
  422.  
  423. This test exists but is not called as part of the testsuite.  You can edit
  424. runtests in the basic directory so this test is called.
  425.  
  426. This program changes directory to the test directory (chdir and/or mkdir) and 
  427. creates ten files.  A link (link) is done for each of these files, and file 
  428. stats are retrieved for the old and new files (stat).  An error is flagged 
  429. if:
  430.  
  431. 1) Can't link
  432. 2) Stats on either file can't be retrieved after link
  433. 3) The either file's number of links doesn't equal two
  434.  
  435. This is followed by an unlink (unlink) of the new file.  An error is 
  436. flagged if:
  437.  
  438. 1) Stats on the old file can't be retrieved after unlink
  439. 2) The old file's number of links doesn't equal one
  440.  
  441. Any files that remain at the end of the test are removed (unlink).
  442.  
  443.  
  444.  
  445. test8: symlink and readlink
  446.  
  447. NOTE:   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.  
  452. This program changes directory to the test directory (chdir and/or mkdir) and 
  453. makes 10 symlinks (symlink).  It reads (readlink), and gets statistics for 
  454. (lstat), each, and then removes them (unlink).  Errors flagged are:
  455.  
  456. 1) Unsupported function
  457. 2) Can't get statistics (lstat failed)
  458. 3) The mode in the stats is not symlink
  459. 4) The value of the symlink is incorrect (returned from readlink)
  460. 5) The linkname is wrong
  461. 6) The unlink failed
  462.  
  463.  
  464.  
  465. test9: statfs
  466.  
  467. This program changes directory to the test directory (chdir and/or mkdir) and 
  468. gets the file system status on the current directory (statfs).
  469.  
  470.  
  471.  
  472.  
  473. - GENERAL:  General tests to look at server loading.
  474.  
  475. Runs a small compile, Tbl, Nroff and a Large Compile. Four simultaneous
  476. large compiles are also run.
  477.  
  478.  
  479.  
  480.  
  481. - SPECIAL:  Information specific to the special tests
  482.  
  483. The special directory is set up to test special problems that have
  484. come up in the past.  These tests are meant to be advisory, ...
  485. things to watch out for.  It is not required that you "pass" these
  486. tests but we suggest you give them a try.
  487.  
  488. The 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.  
  504. Programs in 'tools' are provided for your use as you see fit.  Please
  505. feel free to add to this (or any other) directory!  If you do, please
  506. make sure that Cathe Ray (sun!cathe or cathe@sun.com) at Sun gets a copy 
  507. so we can add it to the master test distribution.
  508.  
  509.