nfstest.file_io (3) - Linux Manuals

nfstest.file_io: File I/O module

NAME

nfstest.file_io - File I/O module

DESCRIPTION

Provides an interface to create and manipulate files of different types. The arguments allow running for a specified period of time as well as running multiple processes. Each process modifies a single file at a time and the file name space is different for each process so there are no collisions between two different processes modifying the same file.

File types:
  - Regular file
  - Hard link
  - Symbolic link

File operations:
  - Open (create or re-open)
  - Open downgrade
 This is done by opening the file for read and write, then the file is
 opened again as read only and finally closing the read and write file
 descriptor
  - Read (sequential or random access)
  - Write (sequential or random access)
  - Remove
  - Rename
  - Truncate (path or file descriptor)
  - Readdir
  - Lock
  - Unlock
  - Tlock

CLASSES

class FileIO(baseobj.BaseObj)

FileIO object

Usage:
    from nfstest.file_io import FileIO

    # Instantiate FileIO object given top level directory
    x = FileIO(datadir="/tmp/data")

    # Run workload creating the top level directory if necessary
    x.run()


Methods defined here:
---------------------

__del__(self)
Destructor

__init__(self, **kwargs)
Constructor

Initialize object's private data

datadir:
Top level directory where files will be created, it will be created if it does not exist
seed:
Seed to initialized the random number generator [default: automatically generated]
nprocs:
Number of processes to use [default: 1]
runtime:
Run time [default: 0 (indefinitely)]
verbose:
Verbose level: none|info|debug|dbg1-7|all [default: 'none']
exiterr:
Exit on first error [default: False]
read:
Read file percentage [default: 40]
write:
Write file percentage [default: 40]
rdwr:
Read/write file percentage [default: 20]
randio:
Random file access percentage [default: 50]
iodelay:
Seconds to delay I/O operations [default: 0.0]
direct:
Use direct I/O [default: False]
rdwronly:
Use read and write only, no rename, remove, etc. [default: False]
create:
Create file percentage [default: 5]
odgrade:
Open downgrade percentage [default: 10]
osync:
Open file with O_SYNC [default: 20]
fsync:
Percentage of fsync after write [default: 5]
rename:
Rename file percentage [default: 5]
remove:
Remove file percentage [default: 5]
trunc:
Truncate file percentage [default: 5]
ftrunc:
Truncate opened file percentage [default: 5]
link:
Create hard link percentage [default: 2]
slink:
Create symbolic link percentage [default: 1]
readdir:
List contents of directory percentage [default: 1]
lock:
Lock file percentage [default: 20]
unlock:
Unlock file percentage [default: 80]
tlock:
Lock test percentage [default: 50]
lockfull:
Lock full file percentage [default: 50]
minfiles:
Mininum number of files to create before any file operation is executed [default: 10]
fsizeavg:
File size average [default: 1m]
fsizedev:
File size standard deviation [default: 256k]
rsize:
Read block size [default: 64k]
rsizedev:
Read block size standard deviation [default: 8k]
wsize:
Write block size [default: 64k]
wsizedev:
Write block size standard deviation [default: 8k]
sizemult:
Size multiplier [default: 1]
createlog:
Create log file [default: False]
createlogs:
Create a log file for each process [default: False]
logdir:
Log directory [default: '/tmp']
run(self) Main function where all processes are started run_process(self, tid=0) Main loop for each process

class FileObj(baseobj.BaseObj)

# File object

class TermSignal(exceptions.Exception)

Exception to be raised on SIGTERM signal

FUNCTIONS

stop_handler(signum, frame)

Signal handler to catch SIGTERM and allow for gracefull termination of subprocesses

BUGS

No known bugs.

AUTHOR

Jorge Mora (mora [at] netapp.com)

SEE ALSO

baseobj(3), formatstr(3)