#NEWLINE# def fileio( ) : #NEWLINE# #INDENT# "\n    This tests for the file read and write operations\n    Various modes of operations are\n\n    * sequential write\n    * sequential rewrite\n    * sequential read\n    * random read\n    * random write\n    * random read and write\n\n    The test works with 32 files with each file being 1Gb in size\n    The test consumes a lot of time. Be patient!\n\n    CLI Examples:\n\n    .. code-block:: bash\n\n        salt '*' sysbench.fileio\n    " #NEWLINE# test_modes = [ 'seqwr' , 'seqrewr' , 'seqrd' , 'rndrd' , 'rndwr' , 'rndrw' ] #NEWLINE# test_command = 'sysbench --num-threads=16 --test=fileio ' #NEWLINE# test_command += '--file-num=32 --file-total-size=1G --file-test-mode={0} ' #NEWLINE# result = None #NEWLINE# ret_val = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for mode in test_modes : #NEWLINE# #INDENT# key = 'Mode: {0}' . format ( mode ) #NEWLINE# run_command = ( test_command + 'prepare' ) . format ( mode ) #NEWLINE# __salt__ [ 'cmd.run' ] ( run_command ) #NEWLINE# run_command = ( test_command + 'run' ) . format ( mode ) #NEWLINE# result = __salt__ [ 'cmd.run' ] ( run_command ) #NEWLINE# ret_val [ key ] = _parser ( result ) #NEWLINE# run_command = ( test_command + 'cleanup' ) . format ( mode ) #NEWLINE# __salt__ [ 'cmd.run' ] ( run_command ) #NEWLINE# #UNINDENT# return ret_val