Skip to content

Commit

Permalink
t/fiotestlib: pass command-line options to FioJobFileTest
Browse files Browse the repository at this point in the history
Add a means to specify arbitrary command-line options when we are
running a test that consists of a fio job file.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
vincentkfu committed Mar 20, 2024
1 parent 7d6c99e commit 2e97680
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions t/fiotestlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def __init__(self, fio_path, fio_job, success, testnum, artifact_root,

super().__init__(fio_path, success, testnum, artifact_root)

def setup(self, parameters=None):
def setup(self, parameters):
"""Setup instance variables for fio job test."""

self.filenames['fio_output'] = f"{os.path.basename(self.fio_job)}.output"
Expand All @@ -185,6 +185,8 @@ def setup(self, parameters=None):
f"--output={self.filenames['fio_output']}",
self.fio_job,
]
if parameters:
fio_args += parameters

super().setup(fio_args)

Expand All @@ -206,7 +208,7 @@ def run_pre_job(self):
self.testnum,
self.paths['artifacts'],
output_format=self.output_format)
precon.setup()
precon.setup(None)
precon.run()
precon.check_result()
self.precon_failed = not precon.passed
Expand Down Expand Up @@ -412,7 +414,7 @@ def run_fio_tests(test_list, test_env, args):
fio_pre_success=fio_pre_success,
output_format=output_format)
desc = config['job']
parameters = []
parameters = config['parameters'] if 'parameters' in config else None
elif issubclass(config['test_class'], FioJobCmdTest):
if not 'success' in config:
config['success'] = SUCCESS_DEFAULT
Expand Down

0 comments on commit 2e97680

Please sign in to comment.