Unix/Linux Go Back    

CentOS 7.0 - man page for nfstest.test_util (centos section 1)

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

NFSTEST.TEST_UTIL(1)		     nfstest.test_util 1.0.2		     NFSTEST.TEST_UTIL(1)

       nfstest.test_util - Test utilities module

       Provides  a  set of tools for testing either the NFS client or the NFS server, most of the
       functionality is focused mainly on testing the client.  These tools include the following:

	   - Process command line arguments
	   - Provide functionality for PASS/FAIL
	   - Provide test grouping functionality
	   - Provide multiple client support
	   - Logging mechanism
	   - Debug info control
	   - Mount/Unmount control
	   - Create files/directories
	   - Provide mechanism to start a packet trace
	   - Provide mechanism to simulate a network partition
	   - Support for pNFS testing

       In order to use some of the functionality available, the user id in all the  client  hosts
       must  have  access to run commands as root using the 'sudo' command without the need for a
       password, this includes the host where the test is being executed. This	is  used  to  run
       commands like 'mount' and 'umount'. Furthermore, the user id must be able to ssh to remote
       hosts without the need for a password if test requires the use of multiple clients.

       Network partition is simulated by the use of 'iptables',  please  be  advised  that  after
       every  test  run  the  iptables is flushed and reset so any rules previously setup will be
       lost. Currently, there is no mechanism to restore the iptables  rules  to  their  original

   class TestUtil(nfstest.nfs_util.NFSUtil)
       TestUtil object

       TestUtil() -> New server object

	   x = TestUtil()

	   # Process command line options

	   # Start packet trace using tcpdump

	   # Mount volume

	   # Create file

	   # Unmount volume

	   # Stop packet trace

	   # Exit script

       Methods defined here:


	      Gracefully stop the packet trace, cleanup files, unmount volume, and reset network.

       __init__(self, **kwargs)

	      Initialize object's private data.

	      usage: Usage string [default: '']

		     List  of  testnames [default: []] When this list is not empty, the --runtest
		     option is enabled and test scripts should use the run_tests() method to  run
		     all the tests. Test script should have methods named as <testname>_test.

		  x = TestUtil(testnames=['basic', 'lock'])

		  # The following methods should exist:

       abspath(self, filename, dir=None)
	      Return the absolute path for the given file name.

	      Clean up test environment.

	      Remove any files created: test files, trace files.

	      Close all files opened by open_files().

       config(self, msg)
	      Display config message and terminate test with an exit value of 2.

       create_dir(self, dir=None, mode=493)
	      Create a directory under the given directory with the given mode.

       create_file(self, offset=0, size=None, dir=None, mode=None)
	      Create  a  file  starting  to write at given offset with total size of written data
	      given by the size option.

		     File offset where data will be written to [default: 0]

	      size:  Total number of bytes to write [default: --filesize option]

	      dir:   Create file under this directory

	      mode:  File permissions [default: use default OS permissions]

	      Returns the file name created, the file name is also stored in the object attribute
	      filename	--  attribute  absfile is also available as the absolute path of the file
	      just created.

	      File created is removed at object destruction.

       create_host(self, host, user='')
	      Create client host object and set defaults.

       data_pattern(self, offset, size, pattern=None)
	      Return data pattern.

		     Starting offset of pattern

	      size:  Size of data to return

		     Data pattern to return, default is of the	form:  hex_offset(0x%08X)  abcde-

       delay_io(self, delay=None)
	      Delay I/O by value given or the value given in --iodelay option.

	      Terminate  script  with  an  exit value of 0 when all tests passed and a value of 1
	      when there is at least one test failure.

       get_dirname(self, dir=None)
	      Return a unique directory name under the given directory.

       get_filename(self, dir=None)
	      Return a unique file name under the given directory.

	      Get unique name for this instance.

       lock_files(self, lock_type=None, offset=0, length=0)
	      Lock all files opened by open_files().

       open_files(self, mode, create=True)
	      Open files according to given mode, the file descriptors are saved internally to be
	      used  with  write_files(),  read_files()	and close_files(). The number of files to
	      open is controlled by the command line option '--nfiles'.

	      The mode could be either 'r' or 'w'  for	opening  files	for  reading  or  writing
	      respectively.  The  open	flags  for  mode  'r'  is  O_RDONLY while for mode 'w' is
	      O_WRONLY|O_CREAT|O_SYNC. The O_SYNC is used to avoid the client buffering the writ-
	      ten data.

	      Read  a block of data (size given by --rsize) from all files opened by open_files()
	      for reading.

       run_tests(self, **kwargs)
	      Run all test specified by the --runtest option.

		     List of testnames to run [default: all tests given by --testnames]

	      All other arguments given are passed to the test methods.

	      Process command line options.

	      Process all the options in the file given by '--file', then the ones in the command
	      line. This allows for command line options to over write options given in the file.

	      Format of options file:
		  # For options expecting a value
		  <option_name> = <value>

		  # For boolean (flag) options

		Must use the long name of the option (--<option_name>) in the file.

       setup(self, nfiles=None)
	      Set up test environment.

	      Create nfiles number of files [default: --nfiles option]

       str_nfs(self, **kwargs)
	      Return the NFS string according to the given version and minorversion.

		     NFS version [default: --nfsversion option]

		     NFS minor version [default: --minorversion option]

       test(self, expr, msg, subtest=None, failmsg=None, terminate=False)
	      Test expr and display message as PASS/FAIL, terminate execution if terminate option
	      is True.

	      expr:  If expr is true, display as a PASS message, otherwise as a FAIL message

	      msg:   Message to display

		     If given, append this string to the displayed message and mark this test  as
		     a member of the sub-group given by msg

		     If  given,  append  this  string to the displayed message when expr is false
		     [default: None]

		     Terminate execution if true and expr is false [default: False]

	      If tverbose=normal or level 1:
		  Sub-group message is displayed as a PASS/FAIL message including
		  the number of tests that passed  and	failed	within	the  sub-group	If  tver-
	      bose=verbose or level 2:
		  All tests messages are displayed

       test_group(self, msg)
	      Display heading message and start a test group.

	      If tverbose=group or level 0:
		  Group message is displayed as a PASS/FAIL message including the
		  number  of  tests  that  passed  and	failed	within this test group.  If tver-
	      bose=normal|verbose or level 1|2:
		  Group message is displayed as a heading messages for the tests
		  belonging to this test group.

       test_info(self, msg)
	      Display info message.

       testid_count(self, tid)
	      Return the number of instances the testid has occurred.

       warning(self, msg)
	      Display warning message.

	      Write a block of data (size given by --wsize) to all files opened  by  open_files()
	      for writing.

       Static methods defined here:

       get_list(value, hash, type=<type 'str'>)
	      Return  a list of elements from the comma separated string.  Validate and translate
	      these elements using the input dictionary 'hash' where every element in the  string
	      is the key of 'hash' and its value is appended to the returned list.

       str_list(value, type=<type 'str'>)
	      Return a list of <type> elements from the comma separated string.

       baseobj(1), nfstest.host(1), nfstest.nfs_util(1)

       No known bugs.

       Jorge Mora (mora@netapp.com)

NFStest 1.0.2				  10 April 2013 		     NFSTEST.TEST_UTIL(1)
Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 05:03 PM.