Enhancements to support mixed read/write tests

1. Enhancements to support mixed read/write tests;
2. Add a name field for each storage test cases;
3. Support to run customized storage tests by supplying 'extra_opts';
4. Fixed the get status API error when staging resources;

Change-Id: Iecd4001268757ed24fedbc17813f0c0fb8110c68
This commit is contained in:
Yichen Wang 2016-02-25 16:20:49 -08:00
parent 2e107ac060
commit 5766ff9893
4 changed files with 36 additions and 12 deletions

View File

@ -127,8 +127,8 @@ class KB_Instance(object):
# Run fio
@staticmethod
def run_fio(dest_path, name, mode, block_size, iodepth,
runtime, rate_iops=None, rate=None, status_interval=None):
def run_fio(dest_path, name, description, mode, block_size, iodepth, runtime,
rate_iops=None, rate=None, rwmixread=None, status_interval=None, extra_opts=None):
fixed_opt = '--thread --ioengine=libaio --output-format=json+ --direct=1 '
fixed_opt += '--filename=/mnt/volume/kb_storage_test.bin '
required_opt = '--name=%s --rw=%s --bs=%s --iodepth=%s --runtime=%s ' %\
@ -136,7 +136,9 @@ class KB_Instance(object):
optional_opt = ''
optional_opt += '--rate_iops=%s ' % rate_iops if rate_iops else ''
optional_opt += '--rate=%s ' % rate if rate else ''
optional_opt += '--rwmixread=%s ' % rwmixread if rwmixread else ''
optional_opt += '--status-interval=%s ' % status_interval if status_interval else ''
optional_opt += extra_opts if extra_opts else ''
cmd = '%s %s %s %s' % (dest_path, fixed_opt, required_opt, optional_opt)
return cmd

View File

@ -97,14 +97,11 @@ class KBController(object):
kloudbuster = kb_session.kloudbuster
status_dict = {'status': status}
if status == "STAGING":
if hasattr(kloudbuster, 'kloud'):
status_dict['server_vm_count'] = kloudbuster.kloud.vm_up_count
else:
status_dict['server_vm_count'] = 0
status_dict['server_vm_count'] =\
getattr(getattr(kloudbuster, 'kloud', None), 'vm_up_count', 0)
status_dict['client_vm_count'] = kloudbuster.testing_kloud.vm_up_count
return json.dumps(status_dict)
@expose(generic=True)
@check_session_id
def log(self, *args, **kwargs):

View File

@ -212,9 +212,11 @@ client:
# (4) Sequential write
#
# Accepted testing parameters for each scenario:
# description: (Required)
# A string describing the test case
# mode: (Required)
# Self-explained with the name, must be one of the below:
# ['randread', 'randwrite', 'read', 'write']
# ['randread', 'randwrite', 'randrw', 'read', 'write', 'rw']
# runtime: (Required)
# Test duration in seconds
# block_size: (Required, default=4k)
@ -225,27 +227,49 @@ client:
# Cap the bandwidth to this number of IOPS
# rate: (Optional, default=unlimited)
# Cap the bandwidth to this number of bytes/sec, normal postfix rules apply
# rwmixread: (Required when mode is 'randrw' or 'rw')
# Percentage of a mixed workload that should be reads
# extra_opts: (Optional, default=None)
# Extra options that will be added to the FIO client
storage_tool_configs:
- mode: 'randread'
- description: 'Random Read Test Case'
mode: 'randread'
runtime: 30
block_size: '4k'
iodepth: 4
rate_iops: 100
- mode: 'randwrite'
- description: 'Random Write Test Case'
mode: 'randwrite'
runtime: 30
block_size: '4k'
iodepth: 4
rate_iops: 100
- mode: 'read'
- description: 'Random Read/Write Test Case'
mode: 'randrw'
runtime: 30
block_size: '4k'
iodepth: 4
rate_iops: 100
rwmixread: 70
- description: 'Sequential Read Test Case'
mode: 'read'
runtime: 30
block_size: '64k'
iodepth: 64
rate: '60M'
- mode: 'write'
- description: 'Sequential Write Test Case'
mode: 'write'
runtime: 30
block_size: '64k'
iodepth: 64
rate: '60M'
- description: 'Sequential Read/Write Test Case'
mode: 'rw'
runtime: 30
block_size: '64k'
iodepth: 64
rate: '60M'
rwmixread: 70
# Volumes size in GB for each VM
# Will effect only in storage testing mode

View File

@ -91,6 +91,7 @@ class KBRunner_Storage(KBRunner):
# Call the method in corresponding tools to consolidate results
LOG.kbdebug(self.result.values())
tc_result = perf_tool.consolidate_results(self.result.values())
tc_result['description'] = cur_config['description']
tc_result['mode'] = cur_config['mode']
tc_result['block_size'] = cur_config['block_size']
tc_result['iodepth'] = cur_config['iodepth']