diff options
author | JingLu5 <lvjing5@huawei.com> | 2017-10-13 08:15:18 +0000 |
---|---|---|
committer | JingLu5 <lvjing5@huawei.com> | 2017-10-17 01:03:42 +0000 |
commit | a5d0491b47fd1bab27fa603353861ea8eaba8da5 (patch) | |
tree | 94f6d0e75d14a8f50c0b88be47e22f58329fd606 /yardstick/benchmark/scenarios/storage/fio.py | |
parent | 2a0153c8b7edb099a84aca0e42673be52b7612a6 (diff) |
Fio: support input job file configuration
Change-Id: I4bb15a398819e54f7fb3e9eac17daa4059c03376
Signed-off-by: JingLu5 <lvjing5@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/storage/fio.py')
-rw-r--r-- | yardstick/benchmark/scenarios/storage/fio.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/yardstick/benchmark/scenarios/storage/fio.py b/yardstick/benchmark/scenarios/storage/fio.py index 98fe26973..125bc7ed4 100644 --- a/yardstick/benchmark/scenarios/storage/fio.py +++ b/yardstick/benchmark/scenarios/storage/fio.py @@ -32,6 +32,10 @@ class Fio(base.Scenario): type: string unit: na default: None + job_file_config - content of job configuration file + type: list + unit: na + default: None directory - mount directoey for test volume type: string unit: na @@ -90,15 +94,26 @@ class Fio(base.Scenario): self.client.wait(timeout=600) self.job_file = self.options.get("job_file", None) + config_lines = self.options.get("job_file_config", None) if self.job_file: self.job_file_script = pkg_resources.resource_filename( "yardstick.resources", 'files/' + self.job_file) - # copy script to host + # copy job file to host self.client._put_file_shell(self.job_file_script, '~/job_file.ini') + elif config_lines: + LOG.debug("Job file configuration received, Fio job file will be created.") + self.job_file = 'tmp_job_file.ini' + self.job_file_script = pkg_resources.resource_filename( + "yardstick.resources", 'files/' + self.job_file) + with open(self.job_file_script, 'w') as f: + f.write('\n'.join(str(line) for line in config_lines)) + # copy job file to host + self.client._put_file_shell(self.job_file_script, '~/job_file.ini') else: + LOG.debug("No job file configuration received, Fio will use parameters.") self.target_script = pkg_resources.resource_filename( "yardstick.benchmark.scenarios.storage", Fio.TARGET_SCRIPT) |