Add options to select different test szenarios
Added: - test for read-write - make iointerface selectable
This commit is contained in:
parent
c115a9e38e
commit
64256add50
@ -11,6 +11,14 @@ import sys
|
||||
################################################################################
|
||||
# Global variables and defaults
|
||||
################################################################################
|
||||
iointerfaces_allowed = [
|
||||
'async',
|
||||
'cached',
|
||||
'direct',
|
||||
'sync',
|
||||
'dsync'
|
||||
]
|
||||
|
||||
ioping_arguments = {
|
||||
'location': '',
|
||||
'cmd': 'ioping --batch',
|
||||
@ -94,15 +102,19 @@ def get_parser():
|
||||
parser.add_argument('-i', '--interval',
|
||||
help = 'interval between requests',
|
||||
default = '1s')
|
||||
parser.add_argument('--iointerface',
|
||||
help = 'Which ionterface to use: async|cached|direct|sync|dsync',
|
||||
default = '')
|
||||
parser.add_argument('-l', '--location',
|
||||
help = 'directory|file|device to test. Best would be a directory to not shred anything accidentially',
|
||||
default = '/tmp')
|
||||
parser.add_argument('-m', '--mode',
|
||||
help = 'Which output mode to use: shell|telegraf',
|
||||
help = 'Which output to use: shell|telegraf',
|
||||
default = 'telegraf')
|
||||
parser.add_argument('-o', '--options',
|
||||
help = 'Arbitary options from the ioping options, like -read-write',
|
||||
default = '')
|
||||
parser.add_argument('-w', '--read-write',
|
||||
help = 'Use read-write test instead of read.',
|
||||
action = 'store_true',
|
||||
default = 'False')
|
||||
return parser
|
||||
|
||||
|
||||
@ -114,7 +126,12 @@ def main():
|
||||
ioping_arguments['location'] = args.location
|
||||
ioping_arguments['count'] = args.count
|
||||
ioping_arguments['interval'] = args.interval
|
||||
ioping_arguments['options'] = args.options
|
||||
if args.read_write == True:
|
||||
ioping_arguments['options'] += '--read-write '
|
||||
if not args.iointerface == '':
|
||||
if args.iointerface in iointerfaces_allowed:
|
||||
ioping_arguments['options'] += '--%s ' % args.iointerface
|
||||
|
||||
|
||||
if args.mode == 'shell':
|
||||
returncode = ioping_output_shell()
|
||||
@ -131,4 +148,3 @@ def main():
|
||||
################################################################################
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user